Skip to content

detent

detent get NAME [--hash VAL] [--switch VAL] [--default VAL]
[--config PATH] [--defaults PATH] [--runtime-dir PATH] [--system]
[--generation-dir PATH] [--managed PRIVATE_CONFIG]
detent help | --help

detent get reads one knob and prints its value: true, false, or an integer. It maps the managed agent’s published generation read-only and evaluates locally; it doesn’t send a request to the agent. With neither --managed nor --generation-dir (or managed_path and generation_dir in agent.json), it fails with no source configured.


OptionMeaning
--hash VALHash value for rollouts (a stable user, account or host ID)
--switch VALSwitch value for group overrides
--default VALFallback printed if the knob can’t be read; publishes nothing
--config PATHUse this agent.json
--defaults PATHTyped fallback knobs when no generation is present or one omits a knob
--runtime-dir PATHRuntime directory holding the agent’s pid and log
--systemAttach to the system agent; never start one
--generation-dir PATHRead a managed agent’s durable generation directory
--managed PRIVATE_CONFIGManaged credential file for a newly started managed agent

  1. get reads the selected durable generation in the generation directory, even while the managed agent is stopped.
  2. If no generation is present and --managed is set, get starts the agent (a sibling detent-agent binary, or one on PATH) with the given startup settings and waits up to three minutes for the first generation.
  3. With --system, get attaches to the service-managed agent and never starts one.
  4. If no generation arrives, get answers from --defaults when it can, and otherwise fails.

SituationStdoutExit status
Read succeededtrue, false or an integer0
Read failed, --default givenThe default0
Read failedERR <Category>: <name> (<detail>)1
Agent couldn’t start, or no source configuredAn error on stderr1
Unknown option, missing option value or extra positional argumentOne argument error on stderr, without starting an agent or using --default1
Terminal window
detent get payments:new_processor --hash user-42 --switch beta
# true
detent get checkout:nope
# ERR MissingKnob: checkout:nope (not present in current snapshot)
detent get checkout:nope --default false
# false

DETENT_MANAGED_CONFIG, DETENT_GENERATION_DIR, DETENT_DEFAULTS_PATH and DETENT_RUNTIME_DIR configure a newly started agent; see detent-agent.