akm-cli 0.5.0-rc4 → 0.6.0-rc1

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 (74) hide show
  1. package/CHANGELOG.md +32 -5
  2. package/dist/asset-registry.js +29 -5
  3. package/dist/asset-spec.js +12 -5
  4. package/dist/cli-hints.js +300 -0
  5. package/dist/cli.js +218 -1357
  6. package/dist/common.js +147 -50
  7. package/dist/config.js +224 -13
  8. package/dist/create-provider-registry.js +1 -1
  9. package/dist/curate.js +258 -0
  10. package/dist/{local-search.js → db-search.js} +30 -19
  11. package/dist/db.js +168 -62
  12. package/dist/embedder.js +49 -273
  13. package/dist/embedders/cache.js +47 -0
  14. package/dist/embedders/local.js +152 -0
  15. package/dist/embedders/remote.js +121 -0
  16. package/dist/embedders/types.js +39 -0
  17. package/dist/errors.js +14 -3
  18. package/dist/frontmatter.js +61 -7
  19. package/dist/indexer.js +38 -7
  20. package/dist/info.js +2 -2
  21. package/dist/install-audit.js +16 -1
  22. package/dist/{installed-kits.js → installed-stashes.js} +48 -22
  23. package/dist/llm-client.js +92 -0
  24. package/dist/llm.js +14 -126
  25. package/dist/lockfile.js +28 -1
  26. package/dist/matchers.js +1 -1
  27. package/dist/metadata-enhance.js +53 -0
  28. package/dist/migration-help.js +75 -44
  29. package/dist/output-context.js +77 -0
  30. package/dist/output-shapes.js +198 -0
  31. package/dist/output-text.js +520 -0
  32. package/dist/paths.js +4 -4
  33. package/dist/providers/index.js +11 -0
  34. package/dist/providers/skills-sh.js +1 -1
  35. package/dist/providers/static-index.js +47 -45
  36. package/dist/registry-build-index.js +36 -29
  37. package/dist/registry-factory.js +2 -2
  38. package/dist/registry-resolve.js +8 -4
  39. package/dist/registry-search.js +62 -5
  40. package/dist/remember.js +172 -0
  41. package/dist/renderers.js +52 -0
  42. package/dist/search-source.js +73 -42
  43. package/dist/setup-steps.js +45 -0
  44. package/dist/setup.js +149 -76
  45. package/dist/stash-add.js +94 -38
  46. package/dist/stash-clone.js +4 -4
  47. package/dist/stash-provider-factory.js +2 -2
  48. package/dist/stash-provider.js +3 -1
  49. package/dist/stash-providers/filesystem.js +31 -1
  50. package/dist/stash-providers/git.js +209 -8
  51. package/dist/stash-providers/index.js +1 -0
  52. package/dist/stash-providers/npm.js +159 -0
  53. package/dist/stash-providers/provider-utils.js +162 -0
  54. package/dist/stash-providers/sync-from-ref.js +45 -0
  55. package/dist/stash-providers/tar-utils.js +151 -0
  56. package/dist/stash-providers/website.js +80 -4
  57. package/dist/stash-resolve.js +5 -5
  58. package/dist/stash-search.js +4 -4
  59. package/dist/stash-show.js +3 -3
  60. package/dist/wiki.js +6 -6
  61. package/dist/workflow-authoring.js +12 -4
  62. package/dist/workflow-markdown.js +9 -0
  63. package/dist/workflow-runs.js +12 -2
  64. package/docs/README.md +30 -0
  65. package/docs/migration/release-notes/0.0.13.md +4 -0
  66. package/docs/migration/release-notes/0.1.0.md +6 -0
  67. package/docs/migration/release-notes/0.2.0.md +6 -0
  68. package/docs/migration/release-notes/0.3.0.md +5 -0
  69. package/docs/migration/release-notes/0.5.0.md +6 -0
  70. package/docs/migration/release-notes/0.6.0.md +29 -0
  71. package/docs/migration/release-notes/README.md +21 -0
  72. package/package.json +3 -2
  73. package/dist/registry-install.js +0 -532
  74. /package/dist/{kit-include.js → stash-include.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -6,20 +6,47 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.6.0] - 2026-04-23
10
+
11
+ ### Changed (breaking)
12
+
13
+ - **Terminology cleanup — clean break from "kit" → "stash"** (#148). Pre-v1, no fallback period.
14
+ - **Wire format**: `RegistryIndex.kits[]` renamed to `RegistryIndex.stashes[]`. Schema version bumped to **v3** — `akm-cli >= 0.6.0` only parses indexes with `version: 3`. v1/v2 indexes are no longer accepted. Every static-index registry must regenerate its `index.json` with `version: 3` to be readable. The official `akm-registry` ships a regenerated index alongside this release.
15
+ - **Discovery**: npm packages and GitHub repos are now discovered via the `akm-stash` keyword/topic only. Legacy `akm-kit` and `agentikit` keywords/topics are no longer honored. Publishers must retag.
16
+ - **Schemas**: `schemas/registry-index.json` and `docs/technical/registry-index.schema.json` updated (`RegistryKit` → `RegistryStash`, `kits` → `stashes`).
17
+ - **Internal types**: `RegistryKitEntry` → `RegistryStashEntry`, `InstalledKitEntry` → `InstalledStashEntry`, `KitInstallStatus` → `StashInstallStatus`, `KitSource` → `StashSource`. Files `src/kit-include.ts` → `src/stash-include.ts` and `src/installed-kits.ts` → `src/installed-stashes.ts`.
18
+ - **Asset hit field**: `RegistryAssetSearchHit.kit` → `RegistryAssetSearchHit.stash`.
19
+ - **Docs**: `docs/kit-makers.md` → `docs/stash-makers.md`. All user-facing "kit" references in docs and the README replaced with "stash".
20
+ - **Preserved**: the *Agent Kit Manager* tagline, the `akm-cli` npm package name, and the `akm.include` package.json field.
21
+ - **Migration**: a curated registry author should regenerate their `index.json` (rename `kits` → `stashes`, drop legacy keyword filtering). Publishers should add the `akm-stash` keyword/topic and remove `akm-kit`/`agentikit`.
22
+ - **`akm registry` description**: changed from "Manage kit registries" to "Manage stash registries".
23
+
9
24
  ## [0.5.0] - 2026-04-22
10
25
 
11
26
  ### Added
12
27
 
13
- - **Multi-wiki support** (#119, #121): new `wiki` asset type with nine CLI verbs under `akm wiki …` (`create`, `list`, `show`, `remove`, `pages`, `search`, `stash`, `lint`, `ingest`). Each wiki lives at `<stashDir>/wikis/<name>/` with `schema.md`, `index.md`, `log.md`, `raw/`, and agent-authored pages. Wiki pages are first-class in stash-wide `akm search`. `akm index` regenerates each wiki's `index.md` as a side effect. See `docs/wikis.md` for the full guide. Design principle: **akm surfaces, the agent writes** — no LLM calls, no network access; akm owns only operations with invariants an agent can't reliably enforce (lifecycle, raw-slug uniqueness, structural lint, index regeneration, workflow discovery).
14
- - **Workflow asset type** (#118): new `workflow` type with `akm workflow create <name>` and `akm workflow next <ref>` for authoring and stepping through multi-step workflows stored in the stash
15
- - **Vault asset type** (#117): new `vault` type backed by `.env` files; `akm vault` subcommand with `list`, `show`, `load` (emits a `source` snippet for the current shell); values never appear in structured output
16
- - **`--trust` flag for installs**: `akm add <source> --trust` performs a one-off trusted install, bypassing the install audit for that source
17
- - **Writable git stash + `akm save`** (#114): `akm add --writable` opts a remote git-backed stash into push-on-save; `akm save [name] [-m message]` commits (and pushes when writable + remote is set); default stash is auto-initialized as a git repo; git stash provider now uses `git clone` instead of HTTP tarball download
28
+ - **Multi-wiki support** (#119, #121, #136, #139, #144): new `wiki` asset type with ten CLI verbs under `akm wiki …` (`create`, `register`, `list`, `show`, `remove`, `pages`, `search`, `stash`, `lint`, `ingest`). Each wiki lives at `<stashDir>/wikis/<name>/` with `schema.md`, `index.md`, `log.md`, `raw/`, and agent-authored pages. Wiki pages are first-class in stash-wide `akm search`. `akm index` regenerates each wiki's `index.md` as a side effect and is resilient to malformed workflow assets. Raw sources under `raw/` and the `schema.md` / `index.md` / `log.md` infrastructure files are intentionally excluded from the search index. See `docs/wikis.md` for the full guide. Design principle: **akm surfaces, the agent writes** — no LLM calls, no network access; akm owns only operations with invariants an agent can't reliably enforce (lifecycle, raw-slug uniqueness, structural lint, index regeneration, workflow discovery).
29
+ - **External wiki registration** (#139, #144): `akm wiki register <name> <path-or-repo>` and `akm add --type wiki --name <name> <source>` register an existing directory or git/website repo as a first-class wiki without copying or mutating it; source and wiki search state are refreshed immediately and refs/state are normalized on subsequent indexing.
30
+ - **Workflow asset type** (#118): new `workflow` type with `akm workflow` subcommands `template`, `create`, `start`, `next`, `complete`, `status`, `list`, and `resume` for authoring and stepping through multi-step workflows stored in the stash. Runs snapshot their step list at start so edits to the source workflow do not affect an in-flight run.
31
+ - **Vault asset type** (#117): new `vault` type backed by `.env` files; `akm vault` subcommand with `list`, `show`, `create`, `set`, `unset`, and `load` (emits a `source` snippet for the current shell via a mode-0600 temp file); values never appear in structured output.
32
+ - **`--trust` flag for installs**: `akm add <source> --trust` performs a one-off trusted install, bypassing the install audit for that source. Blocked install errors now include a `hint` pointing to `--trust` as a remediation option.
33
+ - **Writable git stash + `akm save`** (#114): `akm add … --writable` opts a remote git-backed stash into push-on-save; `akm save [name] [-m message]` commits (and pushes when writable + remote is set); default stash is auto-initialized as a git repo; git stash provider now uses `git clone` instead of HTTP tarball download.
34
+ - **`akm help migrate <version>`** (#132): prints the release notes and migration guidance for a given version (accepts `0.5.0`, `v0.5.0`, or `latest`). Pulls the matching section from `CHANGELOG.md` when available and supplements it with embedded migration notes for major releases.
35
+ - **Broader `akm upgrade` coverage** (#132, #134): self-update now detects and upgrades npm, bun, pnpm, and standalone-binary installs (previously binary-only). Runtime assets covered by the upgrade flow were also expanded so newly shipped asset types stay current.
36
+
37
+ ### Fixed
38
+
39
+ - **0.5.0 QA follow-ups** (#130): fixes across the new wiki, workflow, vault, and save/trust surfaces surfaced during release-candidate QA.
18
40
 
19
41
  ### Removed (breaking)
20
42
 
21
43
  - The unreleased single-wiki LLM POC: removes `akm lint` command, `akm import --llm` / `--dry-run` flags, `knowledge.pageKinds` config, and the `ingestKnowledgeSource` / `lintKnowledge` LLM prompts. Users of the POC should migrate to the new `akm wiki …` surface; raw content can be manually moved to `wikis/<name>/raw/`.
22
44
 
45
+ ### Documentation
46
+
47
+ - **Technical docs refresh** (#138): stash and search architecture docs updated to match the current implementation.
48
+ - **Wiki configuration guide** (#115): new docs page covering wiki configuration and ingest flow.
49
+
23
50
  ## [0.4.1] - 2026-04-21
24
51
 
25
52
  ### Added
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * Central registry for asset type renderer and action builder maps.
3
3
  *
4
- * Previously these maps lived in `local-search.ts` and were wired into
5
- * `asset-spec.ts` via a fragile `_setAssetTypeHooks` deferred callback
6
- * pattern. If `local-search.ts` was imported after `registerAssetType()`
7
- * calls, hooks would be silently dropped.
4
+ * Previously these maps lived in `db-search.ts` (then `local-search.ts`) and
5
+ * were wired into `asset-spec.ts` via a fragile `_setAssetTypeHooks` deferred
6
+ * callback pattern. If the search module was imported after
7
+ * `registerAssetType()` calls, hooks would be silently dropped.
8
8
  *
9
9
  * This module is a simple singleton that both `asset-spec.ts` and
10
- * `local-search.ts` import from, eliminating the import-order dependency
10
+ * `db-search.ts` import from, eliminating the import-order dependency
11
11
  * entirely.
12
12
  */
13
13
  import { buildWorkflowAction } from "./renderers";
@@ -53,3 +53,27 @@ export function registerTypeRenderer(type, rendererName) {
53
53
  export function registerActionBuilder(type, builder) {
54
54
  ACTION_BUILDERS[type] = builder;
55
55
  }
56
+ export const defaultRendererRegistry = {
57
+ rendererNameFor(type) {
58
+ return TYPE_TO_RENDERER[type];
59
+ },
60
+ actionBuilderFor(type) {
61
+ return ACTION_BUILDERS[type];
62
+ },
63
+ };
64
+ /**
65
+ * Build a registry from explicit maps. Useful for tests that need to assert
66
+ * rendering behavior without touching the global singletons.
67
+ */
68
+ export function createRendererRegistry(maps) {
69
+ const renderers = maps.renderers ?? {};
70
+ const actionBuilders = maps.actionBuilders ?? {};
71
+ return {
72
+ rendererNameFor(type) {
73
+ return renderers[type];
74
+ },
75
+ actionBuilderFor(type) {
76
+ return actionBuilders[type];
77
+ },
78
+ };
79
+ }
@@ -129,8 +129,6 @@ export const ASSET_SPECS = ASSET_SPECS_INTERNAL;
129
129
  export function registerAssetType(type, spec) {
130
130
  ASSET_SPECS_INTERNAL[type] = spec;
131
131
  TYPE_DIRS[type] = spec.stashDir;
132
- ASSET_TYPES.length = 0;
133
- ASSET_TYPES.push(...getAssetTypes());
134
132
  // Auto-register renderer and action builder if provided in spec
135
133
  if (spec.rendererName) {
136
134
  registerTypeRenderer(type, spec.rendererName);
@@ -139,11 +137,20 @@ export function registerAssetType(type, spec) {
139
137
  registerActionBuilder(type, spec.actionBuilder);
140
138
  }
141
139
  }
140
+ /**
141
+ * Remove a previously-registered asset type.
142
+ *
143
+ * Primarily used by tests for cleanup after `registerAssetType` calls so
144
+ * subsequent tests see a pristine type registry. Built-in types should not
145
+ * normally be deregistered at runtime.
146
+ */
147
+ export function deregisterAssetType(type) {
148
+ delete ASSET_SPECS_INTERNAL[type];
149
+ delete TYPE_DIRS[type];
150
+ }
142
151
  export function getAssetTypes() {
143
152
  return Object.keys(ASSET_SPECS_INTERNAL);
144
153
  }
145
- /** Warning: mutable array — stale if captured before `registerAssetType()` calls. Prefer `getAssetTypes()`. */
146
- export const ASSET_TYPES = getAssetTypes();
147
154
  export const TYPE_DIRS = Object.fromEntries(Object.entries(ASSET_SPECS_INTERNAL).map(([type, spec]) => [type, spec.stashDir]));
148
155
  export function isRelevantAssetFile(assetType, fileName) {
149
156
  return ASSET_SPECS[assetType]?.isRelevantFile(fileName) ?? false;
@@ -158,7 +165,7 @@ export function deriveCanonicalAssetNameFromStashRoot(assetType, stashRoot, file
158
165
  // When the first segment matches the canonical type dir (e.g. "agents"),
159
166
  // use it as the type root so canonical names are relative to it.
160
167
  // Otherwise fall back to stashRoot — this preserves the full relative path
161
- // as the canonical name, which is correct for installed kits that live
168
+ // as the canonical name, which is correct for installed stashes that live
162
169
  // under custom directories (e.g. "tools/agents/svelte-file-editor").
163
170
  const typeRoot = firstSegment === TYPE_DIRS[assetType] ? path.join(stashRoot, firstSegment) : stashRoot;
164
171
  return deriveCanonicalAssetName(assetType, typeRoot, filePath);
@@ -0,0 +1,300 @@
1
+ /**
2
+ * Embedded "agent CLI hints" rendered by `akm hints` when no other source
3
+ * is available.
4
+ *
5
+ * Extracted from `src/cli.ts` so it does not bloat the CLI module and so
6
+ * docs/CI tooling can re-use the same constants. Two flavors:
7
+ * `EMBEDDED_HINTS` (default reference, ~40 lines) and
8
+ * `EMBEDDED_HINTS_FULL` (`--detail full`, ~250 lines).
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
+ ## Quick Reference
15
+
16
+ \`\`\`sh
17
+ akm search "<query>" # Search all sources
18
+ akm curate "<task>" # Curate the best matches for a task
19
+ akm search "<query>" --type workflow # Filter to workflow assets
20
+ akm search "<query>" --source both # Also search registries
21
+ akm show <ref> # View asset details
22
+ akm workflow next <ref> # Start or resume a workflow
23
+ akm remember "Deployment needs VPN access" # Record a memory in your stash
24
+ akm import ./notes/release-checklist.md # Import a knowledge doc into your stash
25
+ akm wiki list # List available wikis
26
+ akm wiki ingest <name> # Print the ingest workflow for a wiki
27
+ akm feedback <ref> --positive|--negative # Record whether an asset helped
28
+ akm add <ref> # Add a source (npm, GitHub, git, local dir)
29
+ akm clone <ref> # Copy an asset to the working stash (optional --dest arg to clone to specific location)
30
+ akm save # Commit (and push if writable remote) changes in the primary stash
31
+ akm registry search "<query>" # Search all registries
32
+ \`\`\`
33
+
34
+ ## Primary Asset Types
35
+
36
+ | Type | What \`akm show\` returns |
37
+ | --- | --- |
38
+ | script | A \`run\` command you can execute directly |
39
+ | skill | Instructions to follow (read the full content) |
40
+ | command | A prompt template with placeholders to fill in |
41
+ | agent | A system prompt with model and tool hints |
42
+ | knowledge | A reference doc (use \`toc\` or \`section "..."\` to navigate) |
43
+ | workflow | Parsed steps plus workflow-specific execution commands |
44
+ | memory | Recalled context (read the content for background information) |
45
+ | vault | Key names only; use vault commands to inspect or load values safely |
46
+ | 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. |
47
+
48
+ When an asset meaningfully helps or fails, record that with \`akm feedback\` so
49
+ future search ranking can learn from real usage.
50
+
51
+ Run \`akm -h\` for the full command reference.
52
+ `;
53
+ const EMBEDDED_HINTS_FULL = `# akm CLI — Full Reference
54
+
55
+ 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.
56
+
57
+ ## Search
58
+
59
+ \`\`\`sh
60
+ akm search "<query>" # Search all sources
61
+ akm curate "<task>" # Curate the best matches for a task
62
+ akm search "<query>" --type workflow # Filter by asset type
63
+ akm search "<query>" --source both # Also search registries
64
+ akm search "<query>" --source registry # Search registries only
65
+ akm search "<query>" --limit 10 # Limit results
66
+ akm search "<query>" --detail full # Include scores, paths, timing
67
+ \`\`\`
68
+
69
+ | Flag | Values | Default |
70
+ | --- | --- | --- |
71
+ | \`--type\` | \`skill\`, \`command\`, \`agent\`, \`knowledge\`, \`workflow\`, \`script\`, \`memory\`, \`vault\`, \`wiki\`, \`any\` | \`any\` |
72
+ | \`--source\` | \`stash\`, \`registry\`, \`both\` | \`stash\` |
73
+ | \`--limit\` | number | \`20\` |
74
+ | \`--format\` | \`json\`, \`jsonl\`, \`text\`, \`yaml\` | \`json\` |
75
+ | \`--detail\` | \`brief\`, \`normal\`, \`full\`, \`summary\`, \`agent\` | \`brief\` |
76
+ | \`--for-agent\` | boolean (deprecated — use \`--detail agent\`) | \`false\` |
77
+
78
+ ## Curate
79
+
80
+ Combine search + follow-up hints into a dense summary for a task or prompt.
81
+
82
+ \`\`\`sh
83
+ akm curate "plan a release" # Pick top matches across asset types
84
+ akm curate "deploy a Bun app" --limit 3 # Keep the summary shorter
85
+ akm curate "review architecture" --type workflow # Restrict to one asset type
86
+ \`\`\`
87
+
88
+ ## Show
89
+
90
+ Display an asset by ref. Knowledge assets support view modes as positional arguments.
91
+
92
+ \`\`\`sh
93
+ akm show script:deploy.sh # Show script (returns run command)
94
+ akm show skill:code-review # Show skill (returns full content)
95
+ akm show command:release # Show command (returns template)
96
+ akm show agent:architect # Show agent (returns system prompt)
97
+ akm show workflow:ship-release # Show parsed workflow steps
98
+ akm show knowledge:guide toc # Table of contents
99
+ akm show knowledge:guide section "Auth" # Specific section
100
+ akm show knowledge:guide lines 10 30 # Line range
101
+ akm show knowledge:my-doc # Show content (local or remote)
102
+ \`\`\`
103
+
104
+ | Type | Key fields returned |
105
+ | --- | --- |
106
+ | script | \`run\`, \`setup\`, \`cwd\` |
107
+ | skill | \`content\` (full SKILL.md) |
108
+ | command | \`template\`, \`description\`, \`parameters\` |
109
+ | agent | \`prompt\`, \`description\`, \`modelHint\`, \`toolPolicy\` |
110
+ | knowledge | \`content\` (with view modes: \`full\`, \`toc\`, \`frontmatter\`, \`section\`, \`lines\`) |
111
+ | workflow | \`workflowTitle\`, \`workflowParameters\`, \`steps\` |
112
+ | memory | \`content\` (recalled context) |
113
+ | vault | \`keys\`, \`comments\` |
114
+ | wiki | \`content\` (same view modes as knowledge). For any wiki task, run \`akm wiki list\` then \`akm wiki ingest <name>\` for the workflow. |
115
+
116
+ ## Capture Knowledge While You Work
117
+
118
+ \`\`\`sh
119
+ akm remember "Deployment needs VPN access" # Record a memory in your stash
120
+ akm remember --name release-retro < notes.md # Save multiline memory from stdin
121
+ akm import ./docs/auth-flow.md # Import a file as knowledge
122
+ akm import - --name scratch-notes < notes.md # Import stdin as a knowledge doc
123
+ akm workflow create ship-release # Create a workflow asset in the stash
124
+ akm workflow next workflow:ship-release # Start or resume the next workflow step
125
+ akm feedback skill:code-review --positive # Record that an asset helped
126
+ akm feedback agent:reviewer --negative # Record that an asset missed the mark
127
+ \`\`\`
128
+
129
+ Use \`akm feedback\` whenever an asset materially helps or fails so future search
130
+ ranking can learn from actual usage.
131
+
132
+ ## Wikis
133
+
134
+ Multi-wiki knowledge bases (Karpathy-style). A stash-owned wiki lives at
135
+ \`<stashDir>/wikis/<name>/\`; external directories or repos can also be registered
136
+ as first-class wikis. akm owns lifecycle + raw-slug + lint + index regeneration
137
+ for stash-owned wikis; page edits use your native Read/Write/Edit tools.
138
+
139
+ \`\`\`sh
140
+ akm wiki list # List wikis (name, pages, raws, last-modified)
141
+ akm wiki create research # Scaffold a new wiki
142
+ akm wiki register ics-docs ~/code/ics-documentation # Register an external wiki
143
+ akm wiki show research # Path, description, counts, last 3 log entries
144
+ akm wiki pages research # Page refs + descriptions (excludes schema/index/log/raw)
145
+ akm wiki search research "attention" # Scoped search (equivalent to --type wiki --wiki research)
146
+ akm wiki stash research ./paper.md # Copy source into raw/<slug>.md (never overwrites)
147
+ echo "..." | akm wiki stash research - # stdin form
148
+ akm wiki lint research # Structural checks: orphans, broken xrefs, uncited raws, stale index
149
+ akm wiki ingest research # Print the ingest workflow for this wiki (no action)
150
+ akm wiki remove research --force # Delete pages/schema/index/log; preserves raw/
151
+ akm wiki remove research --force --with-sources # Full nuke, including raw/
152
+ \`\`\`
153
+
154
+ **For any wiki task, start with \`akm wiki list\`, then \`akm wiki ingest <name>\`
155
+ to get the step-by-step workflow.** Wiki pages are also addressable as
156
+ \`wiki:<name>/<page-path>\` and show up in stash-wide \`akm search\` as
157
+ \`type: wiki\`. Files under \`raw/\` and the wiki root infrastructure files
158
+ \`schema.md\`, \`index.md\`, and \`log.md\` are not indexed and do not appear in
159
+ search results. No \`--llm\` anywhere — akm never reasons about page content.
160
+
161
+ ## Vaults
162
+
163
+ Encrypted-at-rest key/value stores for secrets. Each vault is a \`.env\`-format
164
+ file at \`<stashDir>/vaults/<name>.env\`.
165
+
166
+ \`\`\`sh
167
+ akm vault create prod # Create a new vault
168
+ akm vault set prod DB_URL postgres://... # Set a key (or KEY=VALUE combined form)
169
+ akm vault set prod DB_URL=postgres://... # Combined KEY=VALUE form also works
170
+ akm vault unset prod DB_URL # Remove a key
171
+ akm vault list vault:prod # List key names (no values)
172
+ akm vault show vault:prod # Same as list (alias)
173
+ akm vault load vault:prod # Print export statements to source
174
+ \`\`\`
175
+
176
+ ## Workflows
177
+
178
+ Step-based workflows stored as \`<stashDir>/workflows/<name>.md\`.
179
+
180
+ \`\`\`sh
181
+ akm workflow template # Print a starter workflow template
182
+ akm workflow create ship-release # Scaffold a new workflow asset
183
+ akm workflow start workflow:ship-release # Start a new run
184
+ akm workflow next workflow:ship-release # Advance to the next step (or auto-start)
185
+ akm workflow complete <run-id> # Mark a step complete and advance
186
+ akm workflow status <run-id> # Show current run status
187
+ akm workflow resume <run-id> # Resume a blocked or failed run
188
+ akm workflow list # List all workflow runs
189
+ \`\`\`
190
+
191
+ ## Clone
192
+
193
+ Copy an asset to the working stash or a custom destination for editing.
194
+
195
+ \`\`\`sh
196
+ akm clone <ref> # Clone to working stash
197
+ akm clone <ref> --name new-name # Rename on clone
198
+ akm clone <ref> --dest ./project/.claude # Clone to custom location
199
+ akm clone <ref> --force # Overwrite existing
200
+ akm clone "npm:@scope/pkg//script:deploy.sh" # Clone from remote package
201
+ \`\`\`
202
+
203
+ When \`--dest\` is provided, \`akm init\` is not required first.
204
+
205
+ ## Save
206
+
207
+ Commit local changes in a git-backed stash. Behaviour adapts automatically:
208
+
209
+ - **Not a git repo** — no-op (silent skip)
210
+ - **Git repo, no remote** — stage and commit only (the default stash always falls here)
211
+ - **Git repo, has remote, not writable** — stage and commit only
212
+ - **Git repo, has remote, \`writable: true\`** — stage, commit, and push
213
+
214
+ \`\`\`sh
215
+ akm save # Save primary stash (timestamp message)
216
+ akm save -m "Add deploy skill" # Save with explicit message
217
+ akm save my-skills # Save a named writable git stash
218
+ akm save my-skills -m "Update patterns" # Save named stash with message
219
+ \`\`\`
220
+
221
+ The \`--writable\` flag on \`akm add\` opts a remote git stash into push-on-save:
222
+
223
+ \`\`\`sh
224
+ akm add git@github.com:org/skills.git --provider git --name my-skills --writable
225
+ \`\`\`
226
+
227
+ ## Add & Manage Sources
228
+
229
+ \`\`\`sh
230
+ akm add <ref> # Add a source
231
+ akm add @scope/stash # From npm (managed)
232
+ akm add owner/repo # From GitHub (managed)
233
+ akm add ./path/to/local/stash # Local directory
234
+ akm add git@github.com:org/repo.git --provider git --name my-skills --writable
235
+ akm enable skills.sh # Enable the skills.sh registry
236
+ akm disable skills.sh # Disable the skills.sh registry
237
+ akm list # List all sources
238
+ akm list --kind managed # List managed sources only
239
+ akm remove <target> # Remove by id, ref, path, or name
240
+ akm update --all # Update all managed sources
241
+ akm update <target> --force # Force re-download
242
+ \`\`\`
243
+
244
+ ## Registries
245
+
246
+ \`\`\`sh
247
+ akm registry list # List configured registries
248
+ akm registry add <url> # Add a registry
249
+ akm registry add <url> --name my-team # Add with label
250
+ akm registry add <url> --provider skills-sh # Specify provider type
251
+ akm registry remove <url-or-name> # Remove a registry
252
+ akm registry search "<query>" # Search all registries
253
+ akm registry search "<query>" --assets # Include asset-level results
254
+ akm registry build-index # Build ./index.json
255
+ akm registry build-index --out dist/index.json # Build to a custom path
256
+ \`\`\`
257
+
258
+ ## Configuration
259
+
260
+ \`\`\`sh
261
+ akm config list # Show current config
262
+ akm config get <key> # Read a value
263
+ akm config set <key> <value> # Set a value
264
+ akm config unset <key> # Remove a key
265
+ akm config path --all # Show all config paths
266
+ \`\`\`
267
+
268
+ ## Other Commands
269
+
270
+ \`\`\`sh
271
+ akm init # Initialize working stash
272
+ akm index # Rebuild search index
273
+ akm index --full # Full reindex
274
+ akm list # List all sources
275
+ akm upgrade # Upgrade akm using its install method
276
+ akm upgrade --check # Check for updates
277
+ akm help migrate 0.6.0 # Print migration notes for a release (or: latest)
278
+ akm hints # Print this reference
279
+ akm completions # Print bash completion script
280
+ akm completions --install # Install completions
281
+ \`\`\`
282
+
283
+ ## Output Control
284
+
285
+ All commands accept \`--format\` and \`--detail\` flags:
286
+
287
+ - \`--format json\` (default) — structured JSON
288
+ - \`--format jsonl\` — one JSON object per line (streaming-friendly)
289
+ - \`--format text\` — human-readable plain text
290
+ - \`--format yaml\` — YAML output
291
+ - \`--detail brief\` (default) — compact output
292
+ - \`--detail normal\` — adds tags, refs, origins
293
+ - \`--detail full\` — includes scores, paths, timing, debug info
294
+ - \`--detail summary\` — metadata only (no content/template/prompt), under 200 tokens
295
+ - \`--detail agent\` — agent-optimized output: strips non-actionable fields
296
+ - \`--for-agent\` — deprecated alias for \`--detail agent\`
297
+
298
+ Run \`akm -h\` or \`akm <command> -h\` for per-command help.
299
+ `;
300
+ export { EMBEDDED_HINTS, EMBEDDED_HINTS_FULL };