Command Reference

All /topgun flags, output files, auth token configuration, and topgun-tools commands.

/topgun Flags

All flags are optional. TopGun works with zero flags for most use cases.

Usage
/topgun <task description> [flags]
--registries
--registries <registry1,registry2,…>

Restrict the FindSkills search to a comma-separated list of registry names. By default, all enabled adapters run. Use this to target specific sources or speed up searches when you know where the skill lives.

/topgun web scraping skill --registries skills.sh,npm /topgun git automation --registries github,smithery
--offline
--offline

Skip all live registry queries. TopGun uses the previously written found-skills-<hash>.json artifact for the current query and any matching entries in ~/.topgun/audit-cache/. Useful when working without internet access or when you want to re-run a pipeline on already-fetched candidates without hitting rate limits.

/topgun deployment skill --offline
--reset
--reset

Discard any saved pipeline state (~/.topgun/state.json) and start the pipeline from scratch. Without this flag, an interrupted pipeline will resume from its last completed stage.

/topgun code review skill --reset
--force-audit
--force-audit

Bypass the audit cache and always run fresh SENTINEL passes, even if a clean result for this contentSha was cached within the last 24 hours. Use this when you want to re-audit a skill after the SENTINEL ruleset has been updated.

/topgun test runner skill --force-audit
--auto-approve
--auto-approve

Skip the manual approval gate and automatically install the winning skill after a successful 2-pass SENTINEL audit. The full audit record is still written to ~/.topgun/audit-<hash>.json for review after the fact. Use with care in automated workflows.

/topgun linting skill --auto-approve
--auto-approve does not bypass the SENTINEL audit — it only skips the interactive approval prompt. The 2-pass requirement is always enforced.

Output Files

TopGun writes all pipeline artifacts to ~/.topgun/. These files are useful for debugging, audit trails, and pipeline resume.

state.json
Current pipeline state. Written after each stage completes and reused by resume logic. The file persists between runs; --reset clears the active run before a fresh pipeline starts.
registry-<hash>-<registry>.json
Per-registry partial result written by each FindSkills adapter. These files make registry coverage explicit and are the inputs enforced by validate-partials.sh.
found-skills-<hash>.json
Aggregated FindSkills result after partials are normalized, deduplicated, and wrapped in the shared schema. Includes registry coverage metadata, elapsed time, and candidate details.
comparison-<hash>.json
CompareSkills output for a single run. Stores candidate scores across capability, security, popularity, and recency plus the selected winner.
audit-<hash>.json
Full SecureSkills audit trail for the selected skill: pass history, findings, hashes, secured-path metadata, and final clean status. This is the artifact shown at the approval gate.
installed.json
Append-only TopGun install registry. Records every successful install with its source registry, install method, secured-path provenance, and timestamp.
audit-cache/
Content-SHA keyed cache for audit results and related metadata. Managed by cache-lookup, cache-write, and cache-invalidate.
secured/
Holds the secured SKILL.md copies produced by the audit stage, organized by content SHA before installation.
topgun-lock.json
Reproducibility lock written after a successful install. Pins the selected skill, source registry, content SHA, and audit hash for later inspection.

Auth Token Storage

TopGun stores registry auth tokens in the macOS Keychain (or the OS credential store on Linux/Windows). Tokens are never written to disk in plaintext.

Configuring tokens

Use the bundled keychain helpers to store a token. The default account name is topgun, so the short two-argument form is usually enough:

topgun-tools
# GitHub personal access token (read:public_repo scope) node topgun-tools.cjs keychain-set github_token <your-token> # Smithery API token node topgun-tools.cjs keychain-set smithery_token <your-token> # GitLab personal access token (read_api scope) node topgun-tools.cjs keychain-set gitlab_token <your-token>

Token usage by registry

  • GitHub — increases rate limit from 60 to 5,000 requests/hour. Required if you search GitHub topics frequently.
  • Smithery — unlocks private skill listings. Not required for public skills.
  • GitLab — required only for private group or project repositories. Public GitLab repos work without a token.
If no GitHub token is configured and you hit the rate limit, TopGun will log a warning and return whatever GitHub results were fetched before the limit was reached. It will not fail the pipeline.

topgun-tools.cjs

topgun-tools.cjs is a CLI utility bundled with TopGun for managing keychain tokens, cached audits, hooks, and pipeline state outside the main /topgun flow.

CommandDescription
init Create the ~/.topgun/ directory tree, state file, and install registry if they do not already exist
state-read Print the current state.json document
state-write <key> <value> Update a single field in state.json
sha256 <text> Return the SHA-256 hash for a string payload
cache-lookup <sha> Read an audit-cache entry, including stale or ETag metadata when present
cache-write <sha> <json> Write a JSON payload into ~/.topgun/audit-cache/
cache-invalidate <sha> | --all Delete one cached audit entry or clear the entire audit cache
lock-write <json> Write the reproducibility lock at ~/.topgun/topgun-lock.json
lock-read Print the current reproducibility lock
keychain-get <service> [account] Read a stored token from the OS credential store
keychain-set <service> [account] <password> Store or replace a token in the OS credential store
schemas [schema] Print the built-in JSON schema definitions used by the pipeline artifacts
validate-partials --hash <hash> [--expected <N>] Check that all expected per-registry partial files exist for a FindSkills run
Example usage
# From the TopGun repo or an installed bundle node bin/topgun-tools.cjs init node bin/topgun-tools.cjs keychain-set github_token <your-token> node bin/topgun-tools.cjs validate-partials --hash abc123