AgentKit
ReferenceCLI commands
BetaYou are reading docs for the beta channel (2.4.1-beta.1) — updated automatically on every beta release.Switch to stable →

CLI commands

ak kit refresh

Refresh an installed kit and remove stale generated files

Re-emit an installed kit with force enabled. This refreshes active native or plugin output and unloads generated files that disappeared from the kit source, such as retired agents, rules, hooks, or commands.

Who it's for: Users and maintainers applying a kit update after AgentKit trimmed or renamed exported content.

When to use it: After upgrading AgentKit, after changing bundled kit exports, or when ak audit reports plugin drift. Uses the same snapshot-backed write path as ak kit init --force.

What changes on disk: Snapshots AgentKit-owned content, removes stale generated files through the force refresh path, and writes the current kit output. Use --no-backup only if you accept no recovery snapshot.

Usage

ak kit refresh <kit-name> [flags]

Examples

ak kit refresh engineer --yes                    # remote is the default; refresh project-native Claude Code
ak kit refresh engineer --switch-to-plugin --yes # refresh detected project plugin targets
ak kit refresh engineer --global --yes           # refresh a global paid install
ak kit refresh engineer --target codex --yes     # refresh a paid registry kit
ak kit refresh engineer --local --kits-dir ./kits --switch-to-plugin --yes # explicit local development source
ak kit refresh engineer --switch-to-plugin --yes --json --no-interactive # scripted project refresh

Flags

FlagDescription
--channel stringRemote registry channel (beta requires explicit opt-in) (default "stable")
-g, --globalRefresh the adapter user directory instead of the current project
-h, --helphelp for refresh
--jsonEmit machine-readable JSON (implies --no-interactive)
--kits-dir stringKits directory override (default: embedded kits; overrides: --kits-dir or $AGENTKIT_KITS_DIR)
--localRefresh from the embedded/local kit source instead of the remote registry (dev/CI). Paid kits still require remote access (the default) or an explicit --kits-dir.
--no-backupSkip the pre-refresh snapshot (power users only)
--no-interactiveDisable interactive prompts (CI-safe)
-q, --quietSuppress non-error output on stderr
--registry-url stringAgentKit registry base URL (default: $AGENTKIT_REGISTRY_URL, then dev/staging https://staging.agentkit.best or release https://agentkit.best)
--remoteRefresh from the authenticated remote registry (default; use --local for the embedded/dev source) (default true)
--switch-to-pluginExplicitly refresh the Claude Code project plugin mode
--target stringEmitter target ID or comma-separated IDs; default detects the installed kit targets
-V, --verboseExtra diagnostic output on stderr (loses to --quiet)
--version stringRemote kit version (defaults to channel latest)
-y, --yesAssume yes for all prompts

Output modes

ModeBehavior
prettydefault on TTY (colors, ASCII markers)
plainauto when stdout piped or --no-interactive
json--json (single-object envelope, NDJSON-safe)

Exit codes

CodeMeaning
0success
1runtime error
2invalid flags
3user-cancel (SIGINT, prompt-cancel)
5kit not found in --kits-dir
6target directory cannot be refreshed safely
  • ak kit — Kit management commands

On this page