An agent-driven CLI for authoring, validating, versioning, running, and observing agent skills.
Knack turns your clunky Skill.md files into managed workflows: structured folders of instructions, examples, tests, and metadata that any agent (Claude, Cursor, Codex, Cowork) can load. The artifact is inspectable and immutable; every skill run is logged. When a skill misses an edge case, you flag it, the skill gets a new rule, and the next run is sharper than the last.
skills/email-triage/
├── SKILL.md # the playbook the agent loads — includes a `## Intuition`
│ # section with `### Always` / `### Except when` /
│ # `### Edge cases` subsections that hold every rule
├── meta.knack.yaml # name, slug, author, version, description
├── examples/ # input/output pairs from real past work
├── scripts/ # optional helper scripts
├── assets/ # optional static files
├── references/ # optional reference material
└── tests/ # optional assertions that run pre-publish
This is compatible with the open Anthropic Skills format, so it's portable across agent providers.
curl -fsSL https://getknack.ai/install | shWindows (PowerShell):
irm https://getknack.ai/install.ps1 | iexSelf-host (GitHub). Skills live in a private GitHub repo under your account. No Knack account, no Knack server, no telemetry leaves your machine, no caps. Publishing is a git commit, a per-skill tag, and a push.
Prereqs: git on PATH, GitHub CLI on PATH, and
gh auth login already run. knack init --self-host shells out to gh
to create the repo and to git to commit/push; it will not authenticate
either tool for you.
knack init --self-host --github-repo <you>/<your-skills-repo>Knack Cloud. Zero setup. Public marketplace and team features (sharing, roles, audit log, SSO) live here. Free tier at getknack.ai.
knack init --cloud
knack auth login # 90-day PAT by default
knack auth login --scope read # read-only PAT for CI
knack auth login --never-expires # no-expiry, vault-onlySame commands. Same skill folder format. The backend just decides where
versions and run logs go. Pick once at knack init; switch later by
re-running it.
Read-scoped PATs (--scope read) authenticate on GETs but are denied at
write routes with a small allowlist for knack mark, feedback posts,
and revoking themselves. Useful when a CI agent only needs to poll
telemetry.
- Author.
knack create my-skillscaffolds. Your agent runs the four-phase interview (Genesis, Artifacts, Intuition, Dry Run), filling inSKILL.md(procedure plus the## Intuitionsubsections) andexamples/. - Validate.
knack validate my-skillcatches schema mistakes locally before you burn a version number. - Publish.
knack publish my-skillbumps the version, commits, tags, pushes. Tag ismy-skill/v<X.Y.Z>. Immutable. - Run.
knack run my-skill --input .... The agent does the actual work using SKILL.md as its playbook. CLI generates therun_idand writes thestartedevent. - Mark.
knack mark <run-id> succeeded --output ...(orfailed --reason "..."). The note text feeds back into the next interview pass. - Bump. When a miss matters, edit the relevant subsection of
SKILL.md's## Intuitionblock (add an### Except whencarve-out or an### Edge casesbullet), thenknack publishagain. Version goes from 0.1.1 to 0.1.2. The git log is the history.
The full lifecycle, with no cloud round-trip:
| Command | What it does in self-host |
|---|---|
knack init --self-host |
Creates the GitHub repo (if missing), clones locally, scaffolds layout, pushes the initial commit |
knack auth status |
Shows backend, repo, local clone, resolved gh user |
knack auth login |
Probes gh api user and reports whether gh is installed + authenticated. No Knack token minted; the gh credential is what every subsequent command uses. |
knack create <slug> |
Scaffolds a new skill folder in your clone |
knack validate <slug> |
Pre-flight checks SKILL.md + meta.knack.yaml + tests/ |
knack publish <slug> |
Bumps version in meta.knack.yaml, commits, tags <slug>/v<X.Y.Z>, pushes |
knack list |
Walks your local clone, shows every skill + current version |
knack search <q> |
Greps the local clone for matches in slug / description / SKILL.md |
knack pull <slug> |
Resolves the latest tag, writes the skill folder into your workspace |
knack pull <slug>@<ver> |
Pulls a specific historical version |
knack pull @other-user/<slug> |
Fetches from any public <owner>/knack-skills repo via the GitHub Contents API |
knack pull @other-user/<repo>:<slug>@<ver> |
Full external spec: owner, repo, slug, optional version |
knack export |
Self-host: points at the local skills/ directory (no work to do). Cloud: bulk-pulls every skill in the library into ./knack-export-<date>/<scope>/<slug>/. |
knack run <slug> --input ... --input ... |
Registers a run, writes a started event to local JSONL with all inputs. --no-push skips the telemetry git push (so does KNACK_AUTO_PUSH=0 or auto_push: false in knack.yaml). |
knack mark <run-id> succeeded --output ... --output ... --note ... |
Closes the loop with outputs, note, and a computed duration_ms. Pass a comma-separated list (a,b,c) to bulk-verdict several runs at once. |
knack runs overview [--team <slug-or-id>] |
Portfolio dashboard: every skill the caller can read, with regression and stale flags. --team scopes to one team's library (cloud only). |
knack runs list <slug> |
Page past runs, filter by --status, --version, --agent, --since, --until, --note-contains |
knack runs show <run-id> |
Single run snapshot, including the note and computed duration |
knack runs stats <slug> --group-by [version|agent|version,agent] |
Cohort rollup; supports cross-tab grouping |
knack runs trend <slug> --interval day|week |
Time-bucketed series; every period emits a point (gap-free) |
knack runs diff <slug> <ver-a> <ver-b> |
Side-by-side cohort comparison; deltas null when either cohort empty |
Every knack run and knack mark appends one line to
<your-repo>/runs/<YYYY-MM>/<YYYY-MM-DD>.jsonl. Same schema in both
modes; in cloud mode it also lands server-side for the rollups.
knack mark returns a RunSnapshot that also includes duration_ms
(computed from the two events' timestamps). Fields are documented in
crates/knack-backend-github/src/runs.rs.
Push policy. Every knack run and knack mark auto-commits the
affected JSONL file and pushes to the repo's default remote/branch.
The commit message is telemetry: <event> <skill> <run_id>. Only the
day's JSONL is staged, so unrelated working-tree changes are NOT swept
into the telemetry commit. If the push fails (offline, branch diverged),
the local append still succeeds and the CLI prints a stderr warning
telling you how to recover; the next successful run / mark /
publish carries the queued commits.
The remote name and default branch are resolved per-repo (in order):
KNACK_REMOTE_NAME / KNACK_REMOTE_BRANCH env vars → local
git symbolic-ref refs/remotes/<remote>/HEAD → gh repo view --json defaultBranchRef → origin/main fallback. So master-default repos,
fork workflows, and custom remotes work without configuration.
Three ways to opt out of the auto-push (the local commit still lands either way; only the network hop is skipped):
knack run --no-push # per-invocation
KNACK_AUTO_PUSH=0 knack run ... # per-shell
# or in <repo>/knack.yaml:
auto_push: false # persistent per-workspace
Operating surface, when you're driving the CLI on a user's behalf:
- Binary is
knack.knack --helpfor the full tree;knack introspect --jsonfor a machine-readable command catalog. - User's backend mode is at
~/.knack/config.yaml. Read it before anything else:mode: githubskips cloud auth;mode: cloudrequiresknack auth login. - Skill folders are at
<workspace>/skills/<slug>/. Required:SKILL.md(with frontmattername,description; rules live inside under## Intuitionwith### Always/### Except when/### Edge casessubsections) andmeta.knack.yaml(withname,slug,author,version). Optional:examples/,scripts/,assets/,references/,tests/. (Skills pulled from older cloud versions may also ship a sidecarintuition.md; the pull/publish path tolerates it for back-compat but new authoring does not produce one.) - The four-phase interview skill is embedded in the binary. Start it with
knack interview start. The CLI writes the skill into<cwd>/.claude/skills/knack-interview/and returns a session id you pass to subsequentknack interview save / advancecalls. - Pre-flight validation:
knack validate <slug>returns a structured issues list. Fix and retry locally before paying any publish round-trip. --inputonknack runand--outputonknack markare both repeatable. Pass each file separately.- Every command supports
--json. Stdout is JSON; stderr is chatter. - Exit codes are stable:
0success,1user,2auth,3network,4conflict,5plan limit,6partial failure (bulk op — some items succeeded, some didn't),64usage,70internal. Seeknack docs exit-codesfor the full list. - The canonical agent playbook is
knack info. It fetchesgetknack.ai/agent.txtand falls back to the embedded copy on offline.
Bug fixes, typo fixes, and documentation improvements are welcome. Feature PRs are kept narrow. Open a Discussion first so we can talk through direction before code lands. See CONTRIBUTING.md.
MIT. See LICENSE.