AgentKit
ReferenceCLI commands

CLI commands

ak kit refresh

Refresh an installed kit and remove stale generated files

ak kit refresh

Refresh an installed kit and remove stale generated files

Synopsis

What it does: 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.

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

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.

Output modes: pretty default on TTY (colors, ASCII markers) plain auto when stdout piped or --no-interactive json --json (single-object envelope, NDJSON-safe)

Exit codes: 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

ak kit refresh <kit-name> [flags]

Options

      --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

SEE ALSO

  • ak kit - Kit management commands

On this page