akm-cli 0.7.4 → 0.8.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/{CHANGELOG.md → .github/CHANGELOG.md} +34 -1
  2. package/.github/LICENSE +374 -0
  3. package/dist/cli/parse-args.js +86 -0
  4. package/dist/cli.js +1223 -650
  5. package/dist/commands/agent-dispatch.js +107 -0
  6. package/dist/commands/agent-support.js +62 -0
  7. package/dist/commands/config-cli.js +68 -84
  8. package/dist/commands/consolidate.js +812 -0
  9. package/dist/commands/curate.js +1 -0
  10. package/dist/commands/distill-promotion-policy.js +658 -0
  11. package/dist/commands/distill.js +224 -39
  12. package/dist/commands/eval-cases.js +40 -0
  13. package/dist/commands/events.js +12 -24
  14. package/dist/commands/graph.js +222 -0
  15. package/dist/commands/health.js +376 -0
  16. package/dist/commands/help/help-accept.md +9 -0
  17. package/dist/commands/help/help-improve.md +53 -0
  18. package/dist/commands/help/help-proposals.md +15 -0
  19. package/dist/commands/help/help-propose.md +17 -0
  20. package/dist/commands/help/help-reject.md +8 -0
  21. package/dist/commands/history.js +3 -30
  22. package/dist/commands/improve.js +1161 -0
  23. package/dist/commands/info.js +2 -2
  24. package/dist/commands/init.js +2 -2
  25. package/dist/commands/install-audit.js +5 -1
  26. package/dist/commands/installed-stashes.js +118 -138
  27. package/dist/commands/knowledge.js +133 -0
  28. package/dist/commands/lint/agent-linter.js +46 -0
  29. package/dist/commands/lint/base-linter.js +291 -0
  30. package/dist/commands/lint/command-linter.js +46 -0
  31. package/dist/commands/lint/default-linter.js +13 -0
  32. package/dist/commands/lint/index.js +145 -0
  33. package/dist/commands/lint/knowledge-linter.js +13 -0
  34. package/dist/commands/lint/memory-linter.js +58 -0
  35. package/dist/commands/lint/registry.js +33 -0
  36. package/dist/commands/lint/skill-linter.js +42 -0
  37. package/dist/commands/lint/task-linter.js +47 -0
  38. package/dist/commands/lint/types.js +1 -0
  39. package/dist/commands/lint/vault-key-rules.js +67 -0
  40. package/dist/commands/lint/workflow-linter.js +53 -0
  41. package/dist/commands/lint.js +1 -0
  42. package/dist/commands/migration-help.js +2 -2
  43. package/dist/commands/proposal.js +8 -7
  44. package/dist/commands/propose.js +106 -43
  45. package/dist/commands/reflect.js +167 -41
  46. package/dist/commands/registry-search.js +2 -2
  47. package/dist/commands/remember.js +55 -1
  48. package/dist/commands/schema-repair.js +130 -0
  49. package/dist/commands/search.js +21 -5
  50. package/dist/commands/show.js +135 -55
  51. package/dist/commands/source-add.js +10 -10
  52. package/dist/commands/source-manage.js +11 -19
  53. package/dist/commands/tasks.js +385 -0
  54. package/dist/commands/url-checker.js +39 -0
  55. package/dist/commands/vault.js +173 -87
  56. package/dist/core/action-contributors.js +25 -0
  57. package/dist/core/asset-ref.js +4 -0
  58. package/dist/core/asset-registry.js +5 -17
  59. package/dist/core/asset-spec.js +11 -1
  60. package/dist/core/common.js +100 -0
  61. package/dist/core/concurrent.js +22 -0
  62. package/dist/core/config.js +240 -127
  63. package/dist/core/events.js +87 -123
  64. package/dist/core/frontmatter.js +0 -6
  65. package/dist/core/markdown.js +17 -0
  66. package/dist/core/memory-improve.js +678 -0
  67. package/dist/core/parse.js +155 -0
  68. package/dist/core/paths.js +101 -3
  69. package/dist/core/proposal-validators.js +61 -0
  70. package/dist/core/proposals.js +49 -38
  71. package/dist/core/state-db.js +731 -0
  72. package/dist/core/time.js +51 -0
  73. package/dist/core/warn.js +59 -1
  74. package/dist/indexer/db-search.js +86 -472
  75. package/dist/indexer/db.js +418 -59
  76. package/dist/indexer/ensure-index.js +133 -0
  77. package/dist/indexer/graph-boost.js +247 -94
  78. package/dist/indexer/graph-db.js +201 -0
  79. package/dist/indexer/graph-dedup.js +99 -0
  80. package/dist/indexer/graph-extraction.js +417 -74
  81. package/dist/indexer/index-context.js +10 -0
  82. package/dist/indexer/indexer.js +480 -298
  83. package/dist/indexer/llm-cache.js +47 -0
  84. package/dist/indexer/matchers.js +124 -160
  85. package/dist/indexer/memory-inference.js +63 -29
  86. package/dist/indexer/metadata-contributors.js +26 -0
  87. package/dist/indexer/metadata.js +196 -197
  88. package/dist/indexer/path-resolver.js +89 -0
  89. package/dist/indexer/ranking-contributors.js +204 -0
  90. package/dist/indexer/ranking.js +74 -0
  91. package/dist/indexer/search-hit-enrichers.js +22 -0
  92. package/dist/indexer/search-source.js +24 -9
  93. package/dist/indexer/semantic-status.js +2 -16
  94. package/dist/indexer/walker.js +25 -0
  95. package/dist/integrations/agent/builders.js +109 -0
  96. package/dist/integrations/agent/config.js +203 -3
  97. package/dist/integrations/agent/index.js +5 -2
  98. package/dist/integrations/agent/model-aliases.js +63 -0
  99. package/dist/integrations/agent/profiles.js +67 -5
  100. package/dist/integrations/agent/prompts.js +114 -29
  101. package/dist/integrations/agent/sdk-runner.js +120 -0
  102. package/dist/integrations/agent/spawn.js +158 -34
  103. package/dist/integrations/lockfile.js +10 -18
  104. package/dist/integrations/session-logs/index.js +65 -0
  105. package/dist/integrations/session-logs/providers/claude-code.js +56 -0
  106. package/dist/integrations/session-logs/providers/opencode.js +52 -0
  107. package/dist/integrations/session-logs/types.js +1 -0
  108. package/dist/llm/call-ai.js +74 -0
  109. package/dist/llm/client.js +63 -86
  110. package/dist/llm/feature-gate.js +27 -16
  111. package/dist/llm/graph-extract.js +297 -64
  112. package/dist/llm/memory-infer.js +52 -71
  113. package/dist/llm/metadata-enhance.js +39 -22
  114. package/dist/llm/prompts/graph-extract-user-prompt.md +12 -0
  115. package/dist/output/cli-hints-full.md +277 -0
  116. package/dist/output/cli-hints-short.md +65 -0
  117. package/dist/output/cli-hints.js +2 -309
  118. package/dist/output/renderers.js +226 -257
  119. package/dist/output/shapes.js +109 -96
  120. package/dist/output/text.js +274 -36
  121. package/dist/registry/providers/skills-sh.js +61 -49
  122. package/dist/registry/providers/static-index.js +44 -48
  123. package/dist/registry/resolve.js +8 -16
  124. package/dist/setup/setup.js +510 -11
  125. package/dist/sources/provider-factory.js +2 -1
  126. package/dist/sources/providers/filesystem.js +16 -23
  127. package/dist/sources/providers/git.js +45 -4
  128. package/dist/sources/providers/website.js +15 -22
  129. package/dist/sources/website-ingest.js +4 -0
  130. package/dist/tasks/backends/cron.js +200 -0
  131. package/dist/tasks/backends/exec-utils.js +25 -0
  132. package/dist/tasks/backends/index.js +32 -0
  133. package/dist/tasks/backends/launchd-template.xml +19 -0
  134. package/dist/tasks/backends/launchd.js +184 -0
  135. package/dist/tasks/backends/schtasks-template.xml +29 -0
  136. package/dist/tasks/backends/schtasks.js +212 -0
  137. package/dist/tasks/parser.js +198 -0
  138. package/dist/tasks/resolveAkmBin.js +84 -0
  139. package/dist/tasks/runner.js +432 -0
  140. package/dist/tasks/schedule.js +208 -0
  141. package/dist/tasks/schema.js +13 -0
  142. package/dist/tasks/validator.js +59 -0
  143. package/dist/wiki/index-template.md +12 -0
  144. package/dist/wiki/ingest-workflow-template.md +54 -0
  145. package/dist/wiki/log-template.md +8 -0
  146. package/dist/wiki/schema-template.md +61 -0
  147. package/dist/wiki/wiki-templates.js +12 -0
  148. package/dist/wiki/wiki.js +10 -61
  149. package/dist/workflows/authoring.js +5 -25
  150. package/dist/workflows/db.js +9 -0
  151. package/dist/workflows/renderer.js +8 -3
  152. package/dist/workflows/runs.js +73 -88
  153. package/dist/workflows/scope-key.js +76 -0
  154. package/dist/workflows/validator.js +1 -1
  155. package/dist/workflows/workflow-template.md +24 -0
  156. package/docs/README.md +5 -2
  157. package/docs/migration/release-notes/0.7.0.md +1 -1
  158. package/docs/migration/release-notes/0.7.4.md +1 -1
  159. package/docs/migration/release-notes/0.7.5.md +20 -0
  160. package/docs/migration/release-notes/0.8.0.md +43 -0
  161. package/package.json +4 -3
  162. package/dist/templates/wiki-templates.js +0 -100
@@ -0,0 +1,277 @@
1
+ # akm CLI — Full Reference
2
+
3
+ You have access to a searchable library of scripts, skills, commands, agents, knowledge documents, workflows, wikis, and memories via `akm`. Search your sources first before writing something from scratch.
4
+
5
+ ## Search
6
+
7
+ ```sh
8
+ akm search "<query>" # Search all sources
9
+ akm curate "<task>" # Curate the best matches for a task
10
+ akm search "<query>" --type workflow # Filter by asset type
11
+ akm search "<query>" --source both # Also search registries
12
+ akm search "<query>" --source registry # Search registries only
13
+ akm search "<query>" --limit 10 # Limit results
14
+ akm search "<query>" --detail full # Include scores, paths, timing
15
+ ```
16
+
17
+ | Flag | Values | Default |
18
+ | --- | --- | --- |
19
+ | `--type` | `skill`, `command`, `agent`, `knowledge`, `workflow`, `script`, `memory`, `vault`, `wiki`, `any` | `any` |
20
+ | `--source` | `stash`, `registry`, `both` | `stash` |
21
+ | `--limit` | number | `20` |
22
+ | `--format` | `json`, `jsonl`, `text`, `yaml` | `json` |
23
+ | `--detail` | `brief`, `normal`, `full`, `summary`, `agent` | `brief` |
24
+ | `--for-agent` | boolean (deprecated — use `--detail agent`) | `false` |
25
+
26
+ ## Curate
27
+
28
+ Combine search + follow-up hints into a dense summary for a task or prompt.
29
+
30
+ ```sh
31
+ akm curate "plan a release" # Pick top matches across asset types
32
+ akm curate "deploy a Bun app" --limit 3 # Keep the summary shorter
33
+ akm curate "review architecture" --type workflow # Restrict to one asset type
34
+ ```
35
+
36
+ ## Show
37
+
38
+ Display an asset by ref. Knowledge assets support view modes as positional arguments.
39
+
40
+ ```sh
41
+ akm show script:deploy.sh # Show script (returns run command)
42
+ akm show skill:code-review # Show skill (returns full content)
43
+ akm show command:release # Show command (returns template)
44
+ akm show agent:architect # Show agent (returns system prompt)
45
+ akm show workflow:ship-release # Show parsed workflow steps
46
+ akm show knowledge:guide toc # Table of contents
47
+ akm show knowledge:guide section "Auth" # Specific section
48
+ akm show knowledge:guide lines 10 30 # Line range
49
+ akm show knowledge:my-doc # Show content (local or remote)
50
+ ```
51
+
52
+ | Type | Key fields returned |
53
+ | --- | --- |
54
+ | script | `run`, `setup`, `cwd` |
55
+ | skill | `content` (full SKILL.md) |
56
+ | command | `template`, `description`, `parameters` |
57
+ | agent | `prompt`, `description`, `modelHint`, `toolPolicy` |
58
+ | knowledge | `content` (with view modes: `full`, `toc`, `frontmatter`, `section`, `lines`) |
59
+ | workflow | `workflowTitle`, `workflowParameters`, `steps` |
60
+ | memory | `content` (recalled context) |
61
+ | vault | `keys`, `comments` |
62
+ | wiki | `content` (same view modes as knowledge). For any wiki task, run `akm wiki list` then `akm wiki ingest <name>` for the workflow. |
63
+
64
+ ## Capture Knowledge While You Work
65
+
66
+ ```sh
67
+ akm remember "Deployment needs VPN access" # Record a memory in your stash
68
+ akm remember --name release-retro < notes.md # Save multiline memory from stdin
69
+ akm remember "note" --target my-other-stash # Route write to a named writable stash source
70
+ akm import ./docs/auth-flow.md # Import a file as knowledge
71
+ akm import - --name scratch-notes < notes.md # Import stdin as a knowledge doc
72
+ akm import https://example.com/docs/auth # Fetch one URL and import it as knowledge
73
+ akm import ./doc.md --target my-other-stash # Route import to a named writable stash source
74
+ akm workflow create ship-release # Create a workflow asset in the stash
75
+ akm workflow validate workflows/foo.md # Validate a workflow file or ref; lists every error
76
+ akm workflow next workflow:ship-release # Start or resume the next workflow step
77
+ akm feedback skill:code-review --positive # Record that an asset helped
78
+ akm feedback agent:reviewer --negative # Record that an asset missed the mark
79
+ akm feedback memory:deployment-notes --positive # Works for memories too
80
+ akm feedback vault:prod --positive # Records vault feedback without surfacing values
81
+ ```
82
+
83
+ Use `akm feedback` whenever an asset materially helps or fails so future search
84
+ ranking can learn from actual usage.
85
+
86
+ ## Wikis
87
+
88
+ Multi-wiki knowledge bases (Karpathy-style). A stash-owned wiki lives at
89
+ `<stashDir>/wikis/<name>/`; external directories or repos can also be registered
90
+ as first-class wikis. akm owns lifecycle + raw-slug + lint + index regeneration
91
+ for stash-owned wikis; page edits use your native Read/Write/Edit tools.
92
+
93
+ ```sh
94
+ akm wiki list # List wikis (name, pages, raws, last-modified)
95
+ akm wiki create research # Scaffold a new wiki
96
+ akm wiki register ics-docs ~/code/ics-documentation # Register an external wiki
97
+ akm wiki show research # Path, description, counts, last 3 log entries
98
+ akm wiki pages research # Page refs + descriptions (excludes schema/index/log; includes raw/)
99
+ akm wiki search research "attention" # Scoped search (equivalent to --type wiki --wiki research)
100
+ akm wiki stash research ./paper.md # Copy source into raw/<slug>.md (never overwrites)
101
+ akm wiki stash research https://example.com/paper # Fetch one URL into raw/<slug>.md
102
+ akm wiki stash research ./paper.md --target my-stash # Route write to a named writable stash source
103
+ echo "..." | akm wiki stash research - # stdin form
104
+ akm wiki lint research # Structural checks: orphans, broken xrefs, uncited raws, stale index
105
+ akm wiki ingest research # Print the ingest workflow for this wiki (no action)
106
+ akm wiki remove research --force # Delete pages/schema/index/log; preserves raw/
107
+ akm wiki remove research --force --with-sources # Full nuke, including raw/
108
+ ```
109
+
110
+ **For any wiki task, start with `akm wiki list`, then `akm wiki ingest <name>`
111
+ to get the step-by-step workflow.** Wiki pages are also addressable as
112
+ `wiki:<name>/<page-path>` and show up in stash-wide `akm search` as
113
+ `type: wiki`. Files under `raw/` and the wiki root infrastructure files
114
+ `schema.md`, `index.md`, and `log.md` are not indexed and do not appear in
115
+ search results. No `--llm` anywhere — akm never reasons about page content.
116
+
117
+ ## Vaults
118
+
119
+ Encrypted-at-rest key/value stores for secrets. Each vault is a `.env`-format
120
+ file at `<stashDir>/vaults/<name>.env`.
121
+
122
+ ```sh
123
+ akm vault create prod # Create a new vault
124
+ akm vault set prod DB_URL postgres://... # Set a key (or KEY=VALUE combined form)
125
+ akm vault set prod DB_URL=postgres://... # Combined KEY=VALUE form also works
126
+ akm vault unset prod DB_URL # Remove a key
127
+ akm vault list # List all vaults across all stashes with key names
128
+ akm vault path vault:prod # Print the vault file path for shell loading
129
+ akm vault run vault:prod -- env # Run one command with all vault vars injected
130
+ akm vault run vault:prod/DB_URL -- printenv DB_URL # Inject one key for one command
131
+ ```
132
+
133
+ ## Workflows
134
+
135
+ Step-based workflows stored as `<stashDir>/workflows/<name>.md`.
136
+
137
+ Ref-based workflow commands are scoped to the current project/worktree/directory,
138
+ so one active run does not block unrelated directories from starting the same
139
+ workflow. Direct run-id commands still target the exact run.
140
+
141
+ ```sh
142
+ akm workflow template # Print a starter workflow template
143
+ akm workflow create ship-release # Scaffold a new workflow asset
144
+ akm workflow start workflow:ship-release # Start a new run in the current scope
145
+ akm workflow next workflow:ship-release # Advance to the next step (or auto-start) in the current scope
146
+ akm workflow complete <run-id> # Mark a step complete and advance
147
+ akm workflow status <run-id> # Show the exact run by id
148
+ akm workflow resume <run-id> # Resume a blocked or failed run
149
+ akm workflow list # List workflow runs in the current scope
150
+ ```
151
+
152
+ ## Clone
153
+
154
+ Copy an asset to the working stash or a custom destination for editing.
155
+
156
+ ```sh
157
+ akm clone <ref> # Clone to working stash
158
+ akm clone <ref> --name new-name # Rename on clone
159
+ akm clone <ref> --dest ./project/.claude # Clone to custom location
160
+ akm clone <ref> --force # Overwrite existing
161
+ akm clone "npm:@scope/pkg//script:deploy.sh" # Clone from remote package
162
+ ```
163
+
164
+ When `--dest` is provided, `akm init` is not required first.
165
+
166
+ ## Save
167
+
168
+ Commit local changes in a git-backed stash. Behaviour adapts automatically:
169
+
170
+ - **Not a git repo** — no-op (silent skip)
171
+ - **Git repo, no remote** — stage and commit only (the default stash always falls here)
172
+ - **Git repo, has remote, not writable** — stage and commit only
173
+ - **Git repo, has remote, `writable: true`** — stage, commit, and push
174
+
175
+ ```sh
176
+ akm save # Save primary stash (timestamp message)
177
+ akm save -m "Add deploy skill" # Save with explicit message
178
+ akm save my-skills # Save a named writable git stash
179
+ akm save my-skills -m "Update patterns" # Save named stash with message
180
+ ```
181
+
182
+ The `--writable` flag on `akm add` opts a remote git stash into push-on-save:
183
+
184
+ ```sh
185
+ akm add git@github.com:org/skills.git --provider git --name my-skills --writable
186
+ ```
187
+
188
+ ## Add & Manage Sources
189
+
190
+ ```sh
191
+ akm add <ref> # Add a source
192
+ akm add @scope/stash # From npm (managed)
193
+ akm add owner/repo # From GitHub (managed)
194
+ akm add ./path/to/local/stash # Local directory
195
+ akm add git@github.com:org/repo.git --provider git --name my-skills --writable
196
+ akm enable skills.sh # Enable the skills.sh registry
197
+ akm disable skills.sh # Disable the skills.sh registry
198
+ akm list # List all sources
199
+ akm list --kind managed # List managed sources only
200
+ akm remove <target> # Remove by id, ref, path, or name
201
+ akm update --all # Update all managed sources
202
+ akm update <target> --force # Force re-download
203
+ ```
204
+
205
+ ## Registries
206
+
207
+ ```sh
208
+ akm registry list # List configured registries
209
+ akm registry add <url> # Add a registry
210
+ akm registry add <url> --name my-team # Add with label
211
+ akm registry add <url> --provider skills-sh # Specify provider type
212
+ akm registry remove <url-or-name> # Remove a registry
213
+ akm registry search "<query>" # Search all registries
214
+ akm registry search "<query>" --assets # Include asset-level results
215
+ akm registry build-index # Build the default cache-backed index.json
216
+ akm registry build-index --out dist/index.json # Build to a custom path
217
+ ```
218
+
219
+ ## Configuration
220
+
221
+ ```sh
222
+ akm config list # Show current config
223
+ akm config get <key> # Read a value
224
+ akm config set <key> <value> # Set a value
225
+ akm config unset <key> # Remove a key
226
+ akm config path --all # Show all config paths
227
+ ```
228
+
229
+ ## Other Commands
230
+
231
+ ```sh
232
+ akm init # Initialize working stash
233
+ akm index # Rebuild search index (metadata enrichment when configured)
234
+ akm index --full # Full reindex (metadata enrichment when configured)
235
+ akm list # List all sources
236
+ akm upgrade # Upgrade akm using its install method
237
+ akm upgrade --check # Check for updates
238
+ akm help migrate 0.6.0 # Print migration notes for a release (or: latest)
239
+ akm hints # Print this reference
240
+ akm completions # Print bash completion script
241
+ akm completions --install # Install completions
242
+ ```
243
+
244
+ ## Proposals & Improvement (0.8.0+)
245
+
246
+ ```sh
247
+ akm improve <ref> # Propose improvement for an asset
248
+ akm proposals # List pending proposals
249
+ akm show proposal <id> # Render the proposal body
250
+ akm diff <ref-or-id> # Diff by ref, UUID, or 8-char prefix (proposal positional optional)
251
+ akm diff skill:akm-dream # Diff by asset ref
252
+ akm accept 7c115132 # Accept by UUID prefix
253
+ akm accept <id> --target team-stash # Accept to a named writable stash source
254
+ akm reject skill:my-skill --reason "not ready" # Reject by asset ref
255
+ akm reject <id> --reason "..." # Archive with a reason
256
+ ```
257
+
258
+ Per-task `timeoutMs`: task markdown frontmatter may set `timeoutMs: null` to
259
+ disable the agent kill timer for long-running local-model tasks, or a number
260
+ (milliseconds) to override `config.agent.timeoutMs` for that task only.
261
+
262
+ ## Output Control
263
+
264
+ All commands accept `--format` and `--detail` flags:
265
+
266
+ - `--format json` (default) — structured JSON
267
+ - `--format jsonl` — one JSON object per line (streaming-friendly)
268
+ - `--format text` — human-readable plain text
269
+ - `--format yaml` — YAML output
270
+ - `--detail brief` (default) — compact output
271
+ - `--detail normal` — adds tags, refs, origins
272
+ - `--detail full` — includes scores, paths, timing, debug info
273
+ - `--detail summary` — metadata only (no content/template/prompt), under 200 tokens
274
+ - `--detail agent` — agent-optimized output: strips non-actionable fields
275
+ - `--for-agent` — deprecated alias for `--detail agent`
276
+
277
+ Run `akm -h` or `akm <command> -h` for per-command help.
@@ -0,0 +1,65 @@
1
+ # akm CLI
2
+
3
+ You have access to a searchable library of scripts, skills, commands, agents, knowledge documents, workflows, wikis, and memories via `akm`. Search your sources first before writing something from scratch.
4
+
5
+ ## Agent Task Loop
6
+
7
+ For any task, follow this loop:
8
+ 1. `akm curate "<task>"` — find the best matching asset
9
+ 2. `akm show <ref>` — read the schema (field names and structure)
10
+ 3. Edit the workspace file using schema field names + task-specific values from your README
11
+ 4. `akm feedback <ref> --positive` — record success
12
+
13
+ For workflow tasks:
14
+ 1. `akm workflow next workflow:<name>` — get current step instructions
15
+ 2. Do the step work in your workspace
16
+ 3. `akm workflow complete <run-id> --step <step-id>` — mark done, get next step
17
+
18
+ Workflow runs are scoped to your current project/worktree/directory. Ref-based
19
+ commands like `workflow next workflow:<name>`, `workflow status workflow:<name>`,
20
+ and `workflow list` operate within the current scope only.
21
+
22
+ ## Quick Reference
23
+
24
+ ```sh
25
+ akm search "<query>" # Search all sources
26
+ akm curate "<task>" # Curate the best matches for a task
27
+ akm search "<query>" --type workflow # Filter to workflow assets
28
+ akm search "<query>" --source both # Also search registries
29
+ akm show <ref> # View asset details
30
+ akm workflow next <ref> # Start or resume a workflow
31
+ akm remember "Deployment needs VPN access" # Record a memory in your stash
32
+ akm remember "note" --target my-stash # Route write to a named writable stash source
33
+ akm import ./notes/release-checklist.md # Import a knowledge doc into your stash
34
+ akm import ./doc.md --target my-stash # Route import to a named writable stash source
35
+ akm wiki list # List available wikis
36
+ akm wiki ingest <name> # Print the ingest workflow for a wiki
37
+ akm wiki stash <name> ./paper.md --target my-stash # Route wiki stash write to a named source
38
+ akm diff skill:akm-dream # Diff proposal by ref, UUID, or 8-char prefix
39
+ akm accept 7c115132 # Accept by UUID prefix (proposal positional optional)
40
+ akm reject skill:my-skill --reason "..." # Reject by ref (proposal positional optional)
41
+ akm feedback <ref> --positive|--negative # Record whether an asset helped
42
+ akm add <ref> # Add a source (npm, GitHub, git, local dir)
43
+ akm clone <ref> # Copy an asset to the working stash (optional --dest arg to clone to specific location)
44
+ akm save # Commit (and push if writable remote) changes in the primary stash
45
+ akm registry search "<query>" # Search all registries
46
+ ```
47
+
48
+ ## Primary Asset Types
49
+
50
+ | Type | What `akm show` returns |
51
+ | --- | --- |
52
+ | script | A `run` command you can execute directly |
53
+ | skill | Instructions to follow (read the full content) |
54
+ | command | A prompt template with placeholders to fill in |
55
+ | agent | A system prompt with model and tool hints |
56
+ | knowledge | A reference doc (use `toc` or `section "..."` to navigate) |
57
+ | workflow | Parsed steps plus workflow-specific execution commands |
58
+ | memory | Recalled context (read the content for background information) |
59
+ | vault | Key names only; use `akm vault path` or `akm vault run` to use values safely |
60
+ | wiki | A page in a multi-wiki knowledge base. For any wiki task, start with `akm wiki list`, then `akm wiki ingest <name>` for the workflow. Run `akm wiki -h` for the full surface. |
61
+
62
+ When an asset meaningfully helps or fails, record that with `akm feedback` so
63
+ future search ranking can learn from real usage.
64
+
65
+ Run `akm -h` for the full command reference.
@@ -7,313 +7,6 @@
7
7
  * `EMBEDDED_HINTS` (default reference, ~40 lines) and
8
8
  * `EMBEDDED_HINTS_FULL` (`--detail full`, ~250 lines).
9
9
  */
10
- const EMBEDDED_HINTS = `# akm CLI
11
-
12
- You have access to a searchable library of scripts, skills, commands, agents, knowledge documents, workflows, wikis, and memories via \`akm\`. Search your sources first before writing something from scratch.
13
-
14
- ## Agent Task Loop
15
-
16
- For any task, follow this loop:
17
- 1. \`akm curate "<task>"\` — find the best matching asset
18
- 2. \`akm show <ref>\` — read the schema (field names and structure)
19
- 3. Edit the workspace file using schema field names + task-specific values from your README
20
- 4. \`akm feedback <ref> --positive\` — record success
21
-
22
- For workflow tasks:
23
- 1. \`akm workflow next workflow:<name>\` — get current step instructions
24
- 2. Do the step work in your workspace
25
- 3. \`akm workflow complete <run-id> --step <step-id>\` — mark done, get next step
26
-
27
- ## Quick Reference
28
-
29
- \`\`\`sh
30
- akm search "<query>" # Search all sources
31
- akm curate "<task>" # Curate the best matches for a task
32
- akm search "<query>" --type workflow # Filter to workflow assets
33
- akm search "<query>" --source both # Also search registries
34
- akm show <ref> # View asset details
35
- akm workflow next <ref> # Start or resume a workflow
36
- akm remember "Deployment needs VPN access" # Record a memory in your stash
37
- akm import ./notes/release-checklist.md # Import a knowledge doc into your stash
38
- akm wiki list # List available wikis
39
- akm wiki ingest <name> # Print the ingest workflow for a wiki
40
- akm feedback <ref> --positive|--negative # Record whether an asset helped
41
- akm add <ref> # Add a source (npm, GitHub, git, local dir)
42
- akm clone <ref> # Copy an asset to the working stash (optional --dest arg to clone to specific location)
43
- akm save # Commit (and push if writable remote) changes in the primary stash
44
- akm registry search "<query>" # Search all registries
45
- \`\`\`
46
-
47
- ## Primary Asset Types
48
-
49
- | Type | What \`akm show\` returns |
50
- | --- | --- |
51
- | script | A \`run\` command you can execute directly |
52
- | skill | Instructions to follow (read the full content) |
53
- | command | A prompt template with placeholders to fill in |
54
- | agent | A system prompt with model and tool hints |
55
- | knowledge | A reference doc (use \`toc\` or \`section "..."\` to navigate) |
56
- | workflow | Parsed steps plus workflow-specific execution commands |
57
- | memory | Recalled context (read the content for background information) |
58
- | vault | Key names only; use vault commands to inspect or load values safely |
59
- | wiki | A page in a multi-wiki knowledge base. For any wiki task, start with \`akm wiki list\`, then \`akm wiki ingest <name>\` for the workflow. Run \`akm wiki -h\` for the full surface. |
60
-
61
- When an asset meaningfully helps or fails, record that with \`akm feedback\` so
62
- future search ranking can learn from real usage.
63
-
64
- Run \`akm -h\` for the full command reference.
65
- `;
66
- const EMBEDDED_HINTS_FULL = `# akm CLI — Full Reference
67
-
68
- You have access to a searchable library of scripts, skills, commands, agents, knowledge documents, workflows, wikis, and memories via \`akm\`. Search your sources first before writing something from scratch.
69
-
70
- ## Search
71
-
72
- \`\`\`sh
73
- akm search "<query>" # Search all sources
74
- akm curate "<task>" # Curate the best matches for a task
75
- akm search "<query>" --type workflow # Filter by asset type
76
- akm search "<query>" --source both # Also search registries
77
- akm search "<query>" --source registry # Search registries only
78
- akm search "<query>" --limit 10 # Limit results
79
- akm search "<query>" --detail full # Include scores, paths, timing
80
- \`\`\`
81
-
82
- | Flag | Values | Default |
83
- | --- | --- | --- |
84
- | \`--type\` | \`skill\`, \`command\`, \`agent\`, \`knowledge\`, \`workflow\`, \`script\`, \`memory\`, \`vault\`, \`wiki\`, \`any\` | \`any\` |
85
- | \`--source\` | \`stash\`, \`registry\`, \`both\` | \`stash\` |
86
- | \`--limit\` | number | \`20\` |
87
- | \`--format\` | \`json\`, \`jsonl\`, \`text\`, \`yaml\` | \`json\` |
88
- | \`--detail\` | \`brief\`, \`normal\`, \`full\`, \`summary\`, \`agent\` | \`brief\` |
89
- | \`--for-agent\` | boolean (deprecated — use \`--detail agent\`) | \`false\` |
90
-
91
- ## Curate
92
-
93
- Combine search + follow-up hints into a dense summary for a task or prompt.
94
-
95
- \`\`\`sh
96
- akm curate "plan a release" # Pick top matches across asset types
97
- akm curate "deploy a Bun app" --limit 3 # Keep the summary shorter
98
- akm curate "review architecture" --type workflow # Restrict to one asset type
99
- \`\`\`
100
-
101
- ## Show
102
-
103
- Display an asset by ref. Knowledge assets support view modes as positional arguments.
104
-
105
- \`\`\`sh
106
- akm show script:deploy.sh # Show script (returns run command)
107
- akm show skill:code-review # Show skill (returns full content)
108
- akm show command:release # Show command (returns template)
109
- akm show agent:architect # Show agent (returns system prompt)
110
- akm show workflow:ship-release # Show parsed workflow steps
111
- akm show knowledge:guide toc # Table of contents
112
- akm show knowledge:guide section "Auth" # Specific section
113
- akm show knowledge:guide lines 10 30 # Line range
114
- akm show knowledge:my-doc # Show content (local or remote)
115
- \`\`\`
116
-
117
- | Type | Key fields returned |
118
- | --- | --- |
119
- | script | \`run\`, \`setup\`, \`cwd\` |
120
- | skill | \`content\` (full SKILL.md) |
121
- | command | \`template\`, \`description\`, \`parameters\` |
122
- | agent | \`prompt\`, \`description\`, \`modelHint\`, \`toolPolicy\` |
123
- | knowledge | \`content\` (with view modes: \`full\`, \`toc\`, \`frontmatter\`, \`section\`, \`lines\`) |
124
- | workflow | \`workflowTitle\`, \`workflowParameters\`, \`steps\` |
125
- | memory | \`content\` (recalled context) |
126
- | vault | \`keys\`, \`comments\` |
127
- | wiki | \`content\` (same view modes as knowledge). For any wiki task, run \`akm wiki list\` then \`akm wiki ingest <name>\` for the workflow. |
128
-
129
- ## Capture Knowledge While You Work
130
-
131
- \`\`\`sh
132
- akm remember "Deployment needs VPN access" # Record a memory in your stash
133
- akm remember --name release-retro < notes.md # Save multiline memory from stdin
134
- akm import ./docs/auth-flow.md # Import a file as knowledge
135
- akm import - --name scratch-notes < notes.md # Import stdin as a knowledge doc
136
- akm import https://example.com/docs/auth # Fetch one URL and import it as knowledge
137
- akm workflow create ship-release # Create a workflow asset in the stash
138
- akm workflow validate workflows/foo.md # Validate a workflow file or ref; lists every error
139
- akm workflow next workflow:ship-release # Start or resume the next workflow step
140
- akm feedback skill:code-review --positive # Record that an asset helped
141
- akm feedback agent:reviewer --negative # Record that an asset missed the mark
142
- akm feedback memory:deployment-notes --positive # Works for memories too
143
- akm feedback vault:prod --positive # Records vault feedback without surfacing values
144
- \`\`\`
145
-
146
- Use \`akm feedback\` whenever an asset materially helps or fails so future search
147
- ranking can learn from actual usage.
148
-
149
- ## Wikis
150
-
151
- Multi-wiki knowledge bases (Karpathy-style). A stash-owned wiki lives at
152
- \`<stashDir>/wikis/<name>/\`; external directories or repos can also be registered
153
- as first-class wikis. akm owns lifecycle + raw-slug + lint + index regeneration
154
- for stash-owned wikis; page edits use your native Read/Write/Edit tools.
155
-
156
- \`\`\`sh
157
- akm wiki list # List wikis (name, pages, raws, last-modified)
158
- akm wiki create research # Scaffold a new wiki
159
- akm wiki register ics-docs ~/code/ics-documentation # Register an external wiki
160
- akm wiki show research # Path, description, counts, last 3 log entries
161
- akm wiki pages research # Page refs + descriptions (excludes schema/index/log; includes raw/)
162
- akm wiki search research "attention" # Scoped search (equivalent to --type wiki --wiki research)
163
- akm wiki stash research ./paper.md # Copy source into raw/<slug>.md (never overwrites)
164
- akm wiki stash research https://example.com/paper # Fetch one URL into raw/<slug>.md
165
- echo "..." | akm wiki stash research - # stdin form
166
- akm wiki lint research # Structural checks: orphans, broken xrefs, uncited raws, stale index
167
- akm wiki ingest research # Print the ingest workflow for this wiki (no action)
168
- akm wiki remove research --force # Delete pages/schema/index/log; preserves raw/
169
- akm wiki remove research --force --with-sources # Full nuke, including raw/
170
- \`\`\`
171
-
172
- **For any wiki task, start with \`akm wiki list\`, then \`akm wiki ingest <name>\`
173
- to get the step-by-step workflow.** Wiki pages are also addressable as
174
- \`wiki:<name>/<page-path>\` and show up in stash-wide \`akm search\` as
175
- \`type: wiki\`. Files under \`raw/\` and the wiki root infrastructure files
176
- \`schema.md\`, \`index.md\`, and \`log.md\` are not indexed and do not appear in
177
- search results. No \`--llm\` anywhere — akm never reasons about page content.
178
-
179
- ## Vaults
180
-
181
- Encrypted-at-rest key/value stores for secrets. Each vault is a \`.env\`-format
182
- file at \`<stashDir>/vaults/<name>.env\`.
183
-
184
- \`\`\`sh
185
- akm vault create prod # Create a new vault
186
- akm vault set prod DB_URL postgres://... # Set a key (or KEY=VALUE combined form)
187
- akm vault set prod DB_URL=postgres://... # Combined KEY=VALUE form also works
188
- akm vault unset prod DB_URL # Remove a key
189
- akm vault list vault:prod # List key names (no values)
190
- akm vault show vault:prod # Same as list (alias)
191
- akm vault load vault:prod # Print export statements to source
192
- \`\`\`
193
-
194
- ## Workflows
195
-
196
- Step-based workflows stored as \`<stashDir>/workflows/<name>.md\`.
197
-
198
- \`\`\`sh
199
- akm workflow template # Print a starter workflow template
200
- akm workflow create ship-release # Scaffold a new workflow asset
201
- akm workflow start workflow:ship-release # Start a new run
202
- akm workflow next workflow:ship-release # Advance to the next step (or auto-start)
203
- akm workflow complete <run-id> # Mark a step complete and advance
204
- akm workflow status <run-id> # Show current run status
205
- akm workflow resume <run-id> # Resume a blocked or failed run
206
- akm workflow list # List all workflow runs
207
- \`\`\`
208
-
209
- ## Clone
210
-
211
- Copy an asset to the working stash or a custom destination for editing.
212
-
213
- \`\`\`sh
214
- akm clone <ref> # Clone to working stash
215
- akm clone <ref> --name new-name # Rename on clone
216
- akm clone <ref> --dest ./project/.claude # Clone to custom location
217
- akm clone <ref> --force # Overwrite existing
218
- akm clone "npm:@scope/pkg//script:deploy.sh" # Clone from remote package
219
- \`\`\`
220
-
221
- When \`--dest\` is provided, \`akm init\` is not required first.
222
-
223
- ## Save
224
-
225
- Commit local changes in a git-backed stash. Behaviour adapts automatically:
226
-
227
- - **Not a git repo** — no-op (silent skip)
228
- - **Git repo, no remote** — stage and commit only (the default stash always falls here)
229
- - **Git repo, has remote, not writable** — stage and commit only
230
- - **Git repo, has remote, \`writable: true\`** — stage, commit, and push
231
-
232
- \`\`\`sh
233
- akm save # Save primary stash (timestamp message)
234
- akm save -m "Add deploy skill" # Save with explicit message
235
- akm save my-skills # Save a named writable git stash
236
- akm save my-skills -m "Update patterns" # Save named stash with message
237
- \`\`\`
238
-
239
- The \`--writable\` flag on \`akm add\` opts a remote git stash into push-on-save:
240
-
241
- \`\`\`sh
242
- akm add git@github.com:org/skills.git --provider git --name my-skills --writable
243
- \`\`\`
244
-
245
- ## Add & Manage Sources
246
-
247
- \`\`\`sh
248
- akm add <ref> # Add a source
249
- akm add @scope/stash # From npm (managed)
250
- akm add owner/repo # From GitHub (managed)
251
- akm add ./path/to/local/stash # Local directory
252
- akm add git@github.com:org/repo.git --provider git --name my-skills --writable
253
- akm enable skills.sh # Enable the skills.sh registry
254
- akm disable skills.sh # Disable the skills.sh registry
255
- akm list # List all sources
256
- akm list --kind managed # List managed sources only
257
- akm remove <target> # Remove by id, ref, path, or name
258
- akm update --all # Update all managed sources
259
- akm update <target> --force # Force re-download
260
- \`\`\`
261
-
262
- ## Registries
263
-
264
- \`\`\`sh
265
- akm registry list # List configured registries
266
- akm registry add <url> # Add a registry
267
- akm registry add <url> --name my-team # Add with label
268
- akm registry add <url> --provider skills-sh # Specify provider type
269
- akm registry remove <url-or-name> # Remove a registry
270
- akm registry search "<query>" # Search all registries
271
- akm registry search "<query>" --assets # Include asset-level results
272
- akm registry build-index # Build the default cache-backed index.json
273
- akm registry build-index --out dist/index.json # Build to a custom path
274
- \`\`\`
275
-
276
- ## Configuration
277
-
278
- \`\`\`sh
279
- akm config list # Show current config
280
- akm config get <key> # Read a value
281
- akm config set <key> <value> # Set a value
282
- akm config unset <key> # Remove a key
283
- akm config path --all # Show all config paths
284
- \`\`\`
285
-
286
- ## Other Commands
287
-
288
- \`\`\`sh
289
- akm init # Initialize working stash
290
- akm index # Rebuild search index (no LLM enrichment)
291
- akm index --full # Full reindex (no LLM enrichment)
292
- akm index --enrich # Reindex with LLM inference/enrichment passes
293
- akm list # List all sources
294
- akm upgrade # Upgrade akm using its install method
295
- akm upgrade --check # Check for updates
296
- akm help migrate 0.6.0 # Print migration notes for a release (or: latest)
297
- akm hints # Print this reference
298
- akm completions # Print bash completion script
299
- akm completions --install # Install completions
300
- \`\`\`
301
-
302
- ## Output Control
303
-
304
- All commands accept \`--format\` and \`--detail\` flags:
305
-
306
- - \`--format json\` (default) — structured JSON
307
- - \`--format jsonl\` — one JSON object per line (streaming-friendly)
308
- - \`--format text\` — human-readable plain text
309
- - \`--format yaml\` — YAML output
310
- - \`--detail brief\` (default) — compact output
311
- - \`--detail normal\` — adds tags, refs, origins
312
- - \`--detail full\` — includes scores, paths, timing, debug info
313
- - \`--detail summary\` — metadata only (no content/template/prompt), under 200 tokens
314
- - \`--detail agent\` — agent-optimized output: strips non-actionable fields
315
- - \`--for-agent\` — deprecated alias for \`--detail agent\`
316
-
317
- Run \`akm -h\` or \`akm <command> -h\` for per-command help.
318
- `;
10
+ import EMBEDDED_HINTS_FULL from "./cli-hints-full.md" with { type: "text" };
11
+ import EMBEDDED_HINTS from "./cli-hints-short.md" with { type: "text" };
319
12
  export { EMBEDDED_HINTS, EMBEDDED_HINTS_FULL };