akm-cli 0.0.16 → 0.0.17

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.
package/README.md CHANGED
@@ -1,23 +1,26 @@
1
- # akm the Agent-i-Kit Manager
1
+ # akm -- the Agent-i-Kit Manager
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/akm-cli)](https://www.npmjs.com/package/akm-cli)
4
4
  [![CI](https://github.com/itlackey/agentikit/actions/workflows/ci.yml/badge.svg)](https://github.com/itlackey/agentikit/actions/workflows/ci.yml)
5
5
  [![license](https://img.shields.io/npm/l/akm-cli)](LICENSE)
6
6
 
7
- A package manager for AI agent capabilities tools, skills, commands, agents,
8
- knowledge, and scripts that works with any AI coding assistant that can run
7
+ A package manager for AI agent capabilities -- scripts, skills, commands,
8
+ agents, and knowledge -- that works with any AI coding assistant that can run
9
9
  shell commands.
10
10
 
11
- You build up useful scripts, prompts, and agent configs. `akm` (the Agent-i-Kit
12
- Manager) lets you organize them into a searchable **stash**, share them as
13
- installable **kits**, and give any model a way to discover and use them. No
14
- plugins required — just CLI output any tool-calling model can read.
11
+ `akm` organizes reusable scripts, prompts, and agent configs into a searchable
12
+ **stash**, shares them as installable **kits** via **registries**, and gives
13
+ any model a way to discover and use them. No plugins required -- just CLI
14
+ output any tool-calling model can read.
15
15
 
16
16
  ## Requirements
17
17
 
18
18
  `akm` requires [Bun](https://bun.sh) v1.0+ as its runtime. It uses Bun-specific
19
19
  APIs (`bun:sqlite`) that are **not available in Node.js**.
20
20
 
21
+ > **Don't want Bun?** Use the [standalone binary](#standalone-binary) instead -- it
22
+ > bundles everything and has no runtime dependencies.
23
+
21
24
  ## Quick Start
22
25
 
23
26
  ```sh
@@ -30,6 +33,9 @@ akm init
30
33
  # Add a kit from GitHub
31
34
  akm add github:owner/repo
32
35
 
36
+ # Clone an asset to a specific directory
37
+ akm clone script:deploy.sh --dest ./project/.claude
38
+
33
39
  # Search for assets
34
40
  akm search "deploy"
35
41
 
@@ -37,17 +43,14 @@ akm search "deploy"
37
43
  akm show script:deploy.sh
38
44
  ```
39
45
 
40
- > **Don't want Bun?** Use the [standalone binary](#standalone-binary) instead — it
41
- > bundles everything and has no runtime dependencies.
42
-
43
46
  ## Using With Any AI Agent
44
47
 
45
48
  `akm` is platform agnostic. Any model that can execute shell commands can search
46
49
  your stash and use what it finds. The workflow is three commands:
47
50
 
48
- 1. `akm search "what you need"` find relevant assets (returns JSON by default)
49
- 2. `akm show <ref>` get the details (run command, instructions, prompt, etc.)
50
- 3. Use the asset execute the `run` command, follow the skill instructions, fill in the template
51
+ 1. `akm search "what you need"` -- find relevant assets (returns JSON by default)
52
+ 2. `akm show <ref>` -- get the details (run command, instructions, prompt, etc.)
53
+ 3. Use the asset -- execute the `run` command, follow the skill instructions, fill in the template
51
54
 
52
55
  ### Drop-in prompt snippet
53
56
 
@@ -55,50 +58,23 @@ Add this to your `AGENTS.md`, `CLAUDE.md`, `.github/copilot-instructions.md`, sy
55
58
  file to give your agent access to your stash without any additional setup:
56
59
 
57
60
  ~~~markdown
61
+ ## Resources & Capabilities
58
62
 
59
- You have access to a searchable library of tools, skills, commands, agents,
60
- and knowledge documents via `akm`. Use it to find and
61
- use capabilities before writing something from scratch.
62
-
63
- **Finding assets:**
64
- ```sh
65
- akm search "<query>" # Search by keyword
66
- akm search "<query>" --type tool # Filter by type (tool, skill, command, agent, knowledge, script)
67
- akm search "<query>" --source <source> # Filter by source (e.g., "local", "registry", "both")
68
- ```
69
-
70
- Search returns brief JSON by default. Local hits include a `ref` handle you
71
- pass directly to `akm show`.
72
-
73
- **Using assets:**
74
- ```sh
75
- akm show <ref> # Get full asset details
76
- ```
77
-
78
- What you get back depends on the asset type:
79
- - **script** — A `run` command you can execute directly
80
- - **skill** — Instructions to follow (read the full content)
81
- - **command** — A prompt template with placeholders to fill in
82
- - **agent** — A system prompt with model and tool hints
83
- - **knowledge** — A reference doc (use `toc` or `section "..."` to navigate)
84
-
85
- Always search the stash first when you need a capability. Prefer existing
86
- assets over writing new code.
87
-
88
- Use `akm -h` for more options and details on searching and using assets.
63
+ You have access to a searchable library of scripts, skills, commands, agents, and knowledge documents via the `akm` CLI. Use it to find and use capabilities before writing something from scratch. Always search the stash first when you need a capability.
89
64
 
65
+ Use `akm -h` for more information about searching and using assets.
90
66
  ~~~
91
67
 
92
68
  That's it. No plugin, no SDK, no integration code. The model reads the JSON
93
- output from `akm` and acts on it.
69
+ output from `akm` and acts on it. If you would like more detailed instructions, check out the example [AGENTS.md](docs/AGENTS.md)
94
70
 
95
71
  ### Platform plugins (optional)
96
72
 
97
73
  For tighter integration, plugins are available for some platforms. These add
98
74
  native tool bindings so the agent doesn't need to shell out, but they're
99
- purely optional the CLI works everywhere.
75
+ purely optional -- the CLI works everywhere.
100
76
 
101
- **OpenCode** Add the [OpenCode plugin](https://github.com/itlackey/agentikit-plugins?tab=readme-ov-file#akm-opencode) to your `opencode.json`:
77
+ **OpenCode** -- Add the [OpenCode plugin](https://github.com/itlackey/akm-plugins?tab=readme-ov-file#opencode) to your `opencode.json`:
102
78
 
103
79
  ```json
104
80
  {
@@ -106,58 +82,42 @@ purely optional — the CLI works everywhere.
106
82
  }
107
83
  ```
108
84
 
109
- **Claude Code** Add the prompt snippet above to your `CLAUDE.md` or
85
+ **Claude Code** -- Add the prompt snippet above to your `CLAUDE.md` or
110
86
  project instructions. Claude Code can run `akm` commands directly.
111
87
 
112
- **Everything else** If your agent can run shell commands, it can use `akm`.
113
- Add the prompt snippet to whatever instruction mechanism your platform uses.
88
+ **Everything else** -- If your agent can run shell commands, it can use `akm`.
89
+ Add the prompt snippet above or in [AGENTS.md](docs/AGENTS.md) to whatever instruction/rules mechanism your platform uses.
114
90
 
115
- ## What's In a Kit?
91
+ ## The Stash
116
92
 
117
- A kit is a directory of assets you can share and install. There's no required
118
- structure `akm` classifies assets by **file extension and content**, not by
119
- directory name. A `.sh` file is a script whether it lives in `scripts/`,
120
- `deploy/`, or at the root. A `.md` file with `tools` in its frontmatter is an
121
- agent definition wherever you put it.
93
+ Your stash is the local library where assets live. It combines three sources
94
+ in priority order:
122
95
 
123
- That said, using these directory names as an opt-in convention improves
124
- indexing confidence:
96
+ 1. **Primary stash** -- Your personal assets (`AKM_STASH_DIR`), created by `akm init`
97
+ 2. **Search paths** -- Additional directories (team shares, project dirs, etc.)
98
+ 3. **Installed kits** -- Kits from npm, GitHub, or git via `akm add` (cache-managed)
125
99
 
126
- ```text
127
- my-kit/
128
- scripts/ # Executable scripts (.sh, .ts, .js, .py, .rb, .go, etc.)
129
- skills/ # Skill definitions (directories with SKILL.md)
130
- commands/ # Slash commands (.md with $ARGUMENTS or agent frontmatter)
131
- agents/ # Agent definitions (.md with model/tools frontmatter)
132
- knowledge/ # Reference documents (.md)
133
- ```
100
+ The first match wins, so local assets always override installed ones. Use
101
+ `akm clone` to fork an installed asset into your stash for editing.
134
102
 
135
- ### Asset types
103
+ ## Registries
136
104
 
137
- | Type | What it is | What the agent gets |
138
- | --- | --- | --- |
139
- | **script** | An executable script | A `run` command with auto-detected interpreter, plus optional `setup` and `cwd` |
140
- | **skill** | A set of instructions | Step-by-step guidance the agent follows |
141
- | **command** | A prompt template | A template with placeholders to fill in |
142
- | **agent** | An agent definition | A system prompt, model hint, and tool policy |
143
- | **knowledge** | A reference document | Navigable content with TOC and section views |
105
+ Registries are indexes of available kits. akm ships with the official
106
+ [akm-registry](https://github.com/itlackey/akm-registry) pre-configured.
144
107
 
145
- Assets are referenced by type and name (e.g. `script:deploy.sh`,
146
- `knowledge:api-guide`). In practice, agents should treat the `ref` returned
147
- by search as an opaque handle and pass it back to `akm show`. See
148
- [Concepts](docs/concepts.md) and [Ref Format](docs/ref.md).
108
+ ```sh
109
+ # Search the official registry
110
+ akm registry search "code review"
149
111
 
150
- ## The Stash
112
+ # Add a third-party registry
113
+ akm registry add https://example.com/registry/index.json --name team
151
114
 
152
- Your stash is the local library where assets live. It combines three sources
153
- in priority order:
154
-
155
- 1. **Primary stash** — Your personal assets (`AKM_STASH_DIR`), created by `akm init`
156
- 2. **Search paths** — Additional directories (team shares, project dirs, etc.)
157
- 3. **Installed kits** — Kits from npm, GitHub, or git via `akm add` (cache-managed)
115
+ # List configured registries
116
+ akm registry list
117
+ ```
158
118
 
159
- The first match wins, so local assets always override installed ones. Use
160
- `akm clone` to fork an installed asset into your stash for editing.
119
+ See the [Registry docs](docs/registry.md) for hosting your own registry,
120
+ the v2 index format with asset-level metadata, and more.
161
121
 
162
122
  ## Searching and Showing Assets
163
123
 
@@ -165,7 +125,7 @@ Search returns brief JSON by default. Use `--detail normal` or `--detail full`
165
125
  when you want origin, tags, or explainability metadata:
166
126
 
167
127
  ```sh
168
- akm search "docker" --type tool
128
+ akm search "docker" --type script
169
129
  ```
170
130
 
171
131
  ```json
@@ -184,7 +144,7 @@ akm search "docker" --type tool
184
144
  Show returns everything the agent needs to act:
185
145
 
186
146
  ```sh
187
- akm show tool:docker-build.sh
147
+ akm show script:docker-build.sh
188
148
  ```
189
149
 
190
150
  ```json
@@ -193,9 +153,9 @@ akm show tool:docker-build.sh
193
153
  "name": "docker-build.sh",
194
154
  "origin": null,
195
155
  "action": "Execute the run command below",
196
- "run": "bash /path/to/tools/docker-build.sh",
156
+ "run": "bash /path/to/scripts/docker-build.sh",
197
157
  "setup": "bun install",
198
- "cwd": "/path/to/tools"
158
+ "cwd": "/path/to/scripts"
199
159
  }
200
160
  ```
201
161
 
@@ -217,19 +177,13 @@ akm add git+https://gitlab.com/org/kit # Any git repo
217
177
  akm add ./path/to/local/kit # Local directory
218
178
  ```
219
179
 
220
- Search the registry for community kits:
221
-
222
- ```sh
223
- akm search "code review" --source registry
224
- ```
225
-
226
180
  Manage installed kits:
227
181
 
228
182
  ```sh
229
183
  akm list # Show installed kits with status
230
184
  akm update --all # Update all (reports version changes)
231
185
  akm remove owner/repo # Remove and reindex
232
- akm clone tool:deploy.sh # Fork an asset into your stash for editing
186
+ akm clone script:deploy.sh # Fork an asset into your stash for editing
233
187
  ```
234
188
 
235
189
  ### Publishing your own kit
@@ -256,7 +210,7 @@ bun install -g akm-cli
256
210
 
257
211
  ### Standalone binary
258
212
 
259
- The standalone binary bundles everything and has **no runtime dependencies**
213
+ The standalone binary bundles everything and has **no runtime dependencies** --
260
214
  no Bun, no Node.js.
261
215
 
262
216
  ```sh
@@ -280,20 +234,17 @@ akm upgrade --check # Check for updates without installing
280
234
 
281
235
  | Doc | Description |
282
236
  | --- | --- |
283
- | [Concepts](docs/concepts.md) | Asset types, classification, stash sources, metadata |
237
+ | [Getting Started](docs/getting-started.md) | Quick setup guide |
284
238
  | [CLI Reference](docs/cli.md) | All `akm` commands and flags |
285
- | [Kit Maker's Guide](docs/kit-makers.md) | Build and share a kit on GitHub, npm, or a network share |
286
- | [Registry](docs/registry.md) | Finding, installing, and publishing kits |
287
- | [Search](docs/search.md) | Hybrid search architecture and scoring |
288
- | [Indexing](docs/indexing.md) | How the search index is built |
289
- | [Filesystem](docs/filesystem.md) | Directory layout and `.stash.json` schema |
290
239
  | [Configuration](docs/configuration.md) | Providers, settings, and Ollama setup |
291
- | [Ref Format](docs/ref.md) | Opaque asset handles returned by `search` and consumed by `show` |
240
+ | [Concepts](docs/concepts.md) | Asset types, classification, stash sources, metadata |
241
+ | [Kit Maker's Guide](docs/kit-makers.md) | Build and share a kit on GitHub, npm, or a network share |
242
+ | [Registry](docs/registry.md) | Registries, search, and managing kits |
292
243
 
293
244
  ## Status
294
245
 
295
- `akm` is approaching v1.0. The core CLI, stash model, and registry are stable
296
- and in daily use. Feedback, issues, and PRs welcome especially around
246
+ `akm` is approaching v1.0. The core CLI, stash model, and registry are generally stable
247
+ and in daily use. Feedback, issues, and PRs welcome -- especially around
297
248
  real-world usage patterns and integrations with different AI coding assistants.
298
249
 
299
250
  ## License
@@ -1,6 +1,5 @@
1
1
  import path from "node:path";
2
2
  import { toPosix } from "./common";
3
- export const SCRIPT_EXTENSIONS = new Set([".sh", ".ts", ".js", ".ps1", ".cmd", ".bat"]);
4
3
  const markdownSpec = {
5
4
  isRelevantFile: (fileName) => path.extname(fileName).toLowerCase() === ".md",
6
5
  toCanonicalName: (typeRoot, filePath) => {
@@ -14,9 +13,14 @@ const markdownSpec = {
14
13
  return path.join(typeRoot, withExt);
15
14
  },
16
15
  };
17
- /** Extended set of script extensions for the script asset type */
18
- export const SCRIPT_EXTENSIONS_BROAD = new Set([
19
- ...SCRIPT_EXTENSIONS,
16
+ /** All recognized script extensions for the script asset type */
17
+ export const SCRIPT_EXTENSIONS = new Set([
18
+ ".sh",
19
+ ".ts",
20
+ ".js",
21
+ ".ps1",
22
+ ".cmd",
23
+ ".bat",
20
24
  ".py",
21
25
  ".rb",
22
26
  ".go",
@@ -29,15 +33,11 @@ export const SCRIPT_EXTENSIONS_BROAD = new Set([
29
33
  ".kts",
30
34
  ]);
31
35
  const scriptSpec = {
32
- isRelevantFile: (fileName) => SCRIPT_EXTENSIONS_BROAD.has(path.extname(fileName).toLowerCase()),
36
+ isRelevantFile: (fileName) => SCRIPT_EXTENSIONS.has(path.extname(fileName).toLowerCase()),
33
37
  toCanonicalName: (typeRoot, filePath) => toPosix(path.relative(typeRoot, filePath)),
34
38
  toAssetPath: (typeRoot, name) => path.join(typeRoot, name),
35
39
  };
36
40
  export const ASSET_SPECS = {
37
- // "tool" is a transparent alias for "script". It uses the same spec
38
- // (broad script extensions) but retains its own stashDir ("tools") so
39
- // files in tools/ are still discovered.
40
- tool: { stashDir: "tools", ...scriptSpec },
41
41
  skill: {
42
42
  stashDir: "skills",
43
43
  isRelevantFile: (fileName) => fileName === "SKILL.md",