AgentKit
DocsKitsCLI ReferenceDesktop App

prefs

ak config prefs

Choose a preference lookup, validation, or bounded Hook, journal.auto, worktree root, agent model, or semantic_decision mutation while preserving scope, defaults, secrets, and backup boundaries.

Use ak config prefs to discover the commands that resolve or change AgentKit's authored preference values. The group command itself prints help; it does not read or write a config file.

Usage

ak config prefs

The command has no command-specific flags. Shared flags are described in CLI conventions, but --json does not turn group help into a preference payload.

Choose a preference command

GoalCommandEffect
See effective authored valuesak config prefs resolveReads user and current-project config, then deep-merges project over user.
Check config syntax and schemaak config prefs validateReads existing user/project files, or one explicit --file; writes nothing.
Pin one Hook toggle, the automatic journal step, the default worktree root, one runtime capability-tier agent model, or one semantic decision settingak config prefs set <key> <value>Backs up an existing selected config, then atomically writes one hooks.<name> boolean, the exact journal.auto leaf, the exact worktree.root path, one agent_models tier, per-Agent, or OMP role value, or one semantic_decision.* leaf.
Stop pinning one Hook toggle, journal.auto, worktree.root, an agent model, or a semantic decision settingak config prefs unset <key>Removes one selected-scope hooks.<name>, journal.auto, worktree.root, agent_models, or semantic_decision.* leaf when present, with a backup before rewrite.

These commands do not edit provider keys, API tokens, update settings, or other setup-owned sections. Semantic decision credentials come from the process environment or $AGENTKIT_HOME/.env, never from config. See providers and credentials.

Understand scope and precedence

The candidate files are:

  1. user scope: ~/.agentkit/config.yaml, or $AGENTKIT_HOME/config.yaml;
  2. project scope: .agentkit/config.yaml in the project directory.

The project directory is the nearest directory, from the working directory upward, that holds .agentkit/config.yaml or .git; if none is found, it is the working directory. The search never selects your home directory, a directory above it, or the AgentKit home, so there is no project scope when you run from your home directory, and a project-scope write there fails with exit 1.

Resolve deep-merges project values over user values. A project mapping can override one nested key while preserving user values beside it. These are authored values only: missing keys are not filled with binary defaults. Each Kit Hook applies its own built-in default when a value is absent, and journal.auto defaults to true.

set and unset default to user scope; pass --scope project to select the project file found from the working directory, so a command run from a subdirectory reads and writes the same file as one run from the repository root. Scope is not based on a registered project chosen elsewhere.

A marker above the working directory counts only when you, root, or the user who ran sudo owns it, and the .agentkit directory holding it is not a link. Reads skip an untrusted marker or config with a note on stderr (silent with --json or --quiet); resolve shows the skipped project config as skipped: not trusted. A project-scope set or unset refuses with exit 1 and error_code conflict when the write would land in an untrusted config (config.prefs.untrusted_project_config), in a stray config below a repository whose marker was skipped (config.prefs.untrusted_project_marker), or, when run as root, in a project another user owns (config.prefs.root_project_write).

semantic_decision is an exception to project-over-user precedence. Only user scope can grant provider consent or choose provider settings; project scope can only set semantic_decision.enabled or a semantic_decision.consumers.<consumer> entry to false. See ak eval decision for how the grant is resolved and what it sends.

Privacy and output boundary

Resolve allowlists preference sections and converts their field names to the legacy camel-case spelling consumed by Kit Hooks. Setup credential sections, including keys and api, are excluded. The extensions section is passed through verbatim, however, so treat preference output as potentially sensitive user-authored data and review it before sharing logs.

set, unset, and validate write the shared schema_version/kind/data success envelope. resolve keeps its raw preference document because Kit Hooks parse it directly. Bare ak config prefs prints ordinary Cobra help to stdout and normally exits 0.

With --json, a failure in these preference commands, including a flag-parse error (exit 2), writes the shared error envelope to stderr. Use the process exit status and validate success output before consuming it. An unknown subcommand or extra positional token instead follows the generic runtime error path and exits 1.

Write and recovery boundary

Set/unset writes preserve unmodelled YAML sections, comments, key order, and the schema editor directive. Replacement uses a sibling temporary file and mode 0600. An existing target is copied first under ~/.agentkit/backups/config/; the success output reports the exact backup path.

Backups are individual config-file copies, not a transaction across user and project scopes. Avoid concurrent config writers. To recover, stop other writers, inspect the reported backup, and copy that file back to the reported config path; no automatic preference rollback command is provided.