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 refreshFlags
| Flag | Description |
|---|---|
--channel string | Remote registry channel (beta requires explicit opt-in) (default "stable") |
-g, --global | Refresh the adapter user directory instead of the current project |
-h, --help | help for refresh |
--json | Emit machine-readable JSON (implies --no-interactive) |
--kits-dir string | Kits directory override (default: embedded kits; overrides: --kits-dir or $AGENTKIT_KITS_DIR) |
--local | Refresh 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-backup | Skip the pre-refresh snapshot (power users only) |
--no-interactive | Disable interactive prompts (CI-safe) |
-q, --quiet | Suppress non-error output on stderr |
--registry-url string | AgentKit registry base URL (default: $AGENTKIT_REGISTRY_URL, then dev/staging https://staging.agentkit.best or release https://agentkit.best) |
--remote | Refresh from the authenticated remote registry (default; use --local for the embedded/dev source) (default true) |
--switch-to-plugin | Explicitly refresh the Claude Code project plugin mode |
--target string | Emitter target ID or comma-separated IDs; default detects the installed kit targets |
-V, --verbose | Extra diagnostic output on stderr (loses to --quiet) |
--version string | Remote kit version (defaults to channel latest) |
-y, --yes | Assume yes for all prompts |
Output modes
| Mode | Behavior |
|---|---|
pretty | default on TTY (colors, ASCII markers) |
plain | auto when stdout piped or --no-interactive |
json | --json (single-object envelope, NDJSON-safe) |
Exit codes
| Code | Meaning |
|---|---|
0 | success |
1 | runtime error |
2 | invalid flags |
3 | user-cancel (SIGINT, prompt-cancel) |
5 | kit not found in --kits-dir |
6 | target directory cannot be refreshed safely |
Related commands
ak kit— Kit management commands