akm-cli 0.0.16 → 0.0.18
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 +61 -108
- package/dist/asset-spec.js +9 -9
- package/dist/cli.js +321 -118
- package/dist/common.js +0 -7
- package/dist/config-cli.js +43 -0
- package/dist/config.js +46 -26
- package/dist/file-context.js +3 -28
- package/dist/indexer.js +0 -30
- package/dist/llm.js +1 -1
- package/dist/matchers.js +4 -15
- package/dist/metadata.js +3 -3
- package/dist/provider-registry.js +8 -0
- package/dist/providers/skills-sh.js +165 -0
- package/dist/providers/static-index.js +340 -0
- package/dist/registry-install.js +5 -5
- package/dist/registry-provider.js +1 -0
- package/dist/registry-search.js +65 -226
- package/dist/renderers.js +1 -1
- package/dist/stash-add.js +2 -2
- package/dist/stash-ref.js +7 -9
- package/dist/stash-registry.js +6 -6
- package/dist/stash-resolve.js +7 -44
- package/dist/stash-search.js +8 -12
- package/dist/stash-show.js +1 -2
- package/dist/stash-source.js +6 -7
- package/dist/walker.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Agent Kit Manager
|
|
2
|
+
|
|
3
|
+
> Agent-i-Kit
|
|
2
4
|
|
|
3
5
|
[](https://www.npmjs.com/package/akm-cli)
|
|
4
6
|
[](https://github.com/itlackey/agentikit/actions/workflows/ci.yml)
|
|
5
7
|
[](LICENSE)
|
|
6
8
|
|
|
7
|
-
A package manager for AI agent capabilities
|
|
8
|
-
|
|
9
|
+
A package manager for AI agent capabilities -- scripts, skills, commands,
|
|
10
|
+
agents, and knowledge -- that works with any AI coding assistant that can run
|
|
9
11
|
shell commands.
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
`akm` organizes reusable scripts, prompts, and agent configs into a searchable
|
|
14
|
+
**stash**, shares them as installable **kits** via **registries**, and gives
|
|
15
|
+
any model a way to discover and use them. No plugins required -- just CLI
|
|
16
|
+
output any tool-calling model can read.
|
|
15
17
|
|
|
16
18
|
## Requirements
|
|
17
19
|
|
|
18
20
|
`akm` requires [Bun](https://bun.sh) v1.0+ as its runtime. It uses Bun-specific
|
|
19
21
|
APIs (`bun:sqlite`) that are **not available in Node.js**.
|
|
20
22
|
|
|
23
|
+
> **Don't want Bun?** Use the [standalone binary](#standalone-binary) instead -- it
|
|
24
|
+
> bundles everything and has no runtime dependencies.
|
|
25
|
+
|
|
21
26
|
## Quick Start
|
|
22
27
|
|
|
23
28
|
```sh
|
|
@@ -30,6 +35,9 @@ akm init
|
|
|
30
35
|
# Add a kit from GitHub
|
|
31
36
|
akm add github:owner/repo
|
|
32
37
|
|
|
38
|
+
# Clone an asset to a specific directory
|
|
39
|
+
akm clone script:deploy.sh --dest ./project/.claude
|
|
40
|
+
|
|
33
41
|
# Search for assets
|
|
34
42
|
akm search "deploy"
|
|
35
43
|
|
|
@@ -37,17 +45,14 @@ akm search "deploy"
|
|
|
37
45
|
akm show script:deploy.sh
|
|
38
46
|
```
|
|
39
47
|
|
|
40
|
-
|
|
41
|
-
> bundles everything and has no runtime dependencies.
|
|
42
|
-
|
|
43
|
-
## Using With Any AI Agent
|
|
48
|
+
## Works Any AI Agent
|
|
44
49
|
|
|
45
50
|
`akm` is platform agnostic. Any model that can execute shell commands can search
|
|
46
51
|
your stash and use what it finds. The workflow is three commands:
|
|
47
52
|
|
|
48
|
-
1. `akm search "what you need"`
|
|
49
|
-
2. `akm show <ref>`
|
|
50
|
-
3. Use the asset
|
|
53
|
+
1. `akm search "what you need"` -- find relevant assets (returns JSON by default)
|
|
54
|
+
2. `akm show <ref>` -- get the details (run command, instructions, prompt, etc.)
|
|
55
|
+
3. Use the asset -- execute the `run` command, follow the skill instructions, fill in the template
|
|
51
56
|
|
|
52
57
|
### Drop-in prompt snippet
|
|
53
58
|
|
|
@@ -55,50 +60,23 @@ Add this to your `AGENTS.md`, `CLAUDE.md`, `.github/copilot-instructions.md`, sy
|
|
|
55
60
|
file to give your agent access to your stash without any additional setup:
|
|
56
61
|
|
|
57
62
|
~~~markdown
|
|
63
|
+
## Resources & Capabilities
|
|
58
64
|
|
|
59
|
-
You have access to a searchable library of
|
|
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.
|
|
65
|
+
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
66
|
|
|
67
|
+
Use `akm -h` for more information about searching and using assets.
|
|
90
68
|
~~~
|
|
91
69
|
|
|
92
70
|
That's it. No plugin, no SDK, no integration code. The model reads the JSON
|
|
93
|
-
output from `akm` and acts on it.
|
|
71
|
+
output from `akm` and acts on it. If you would like more detailed instructions, check out the example [AGENTS.md](docs/AGENTS.md)
|
|
94
72
|
|
|
95
73
|
### Platform plugins (optional)
|
|
96
74
|
|
|
97
75
|
For tighter integration, plugins are available for some platforms. These add
|
|
98
76
|
native tool bindings so the agent doesn't need to shell out, but they're
|
|
99
|
-
purely optional
|
|
77
|
+
purely optional -- the CLI works everywhere.
|
|
100
78
|
|
|
101
|
-
**OpenCode**
|
|
79
|
+
**OpenCode** -- Add the [OpenCode plugin](https://github.com/itlackey/akm-plugins?tab=readme-ov-file#opencode) to your `opencode.json`:
|
|
102
80
|
|
|
103
81
|
```json
|
|
104
82
|
{
|
|
@@ -106,58 +84,42 @@ purely optional — the CLI works everywhere.
|
|
|
106
84
|
}
|
|
107
85
|
```
|
|
108
86
|
|
|
109
|
-
**Claude Code**
|
|
87
|
+
**Claude Code** -- Add the prompt snippet above to your `CLAUDE.md` or
|
|
110
88
|
project instructions. Claude Code can run `akm` commands directly.
|
|
111
89
|
|
|
112
|
-
**Everything else**
|
|
113
|
-
Add the prompt snippet to whatever instruction mechanism your platform uses.
|
|
114
|
-
|
|
115
|
-
## What's In a Kit?
|
|
90
|
+
**Everything else** -- If your agent can run shell commands, it can use `akm`.
|
|
91
|
+
Add the prompt snippet above or in [AGENTS.md](docs/AGENTS.md) to whatever instruction/rules mechanism your platform uses.
|
|
116
92
|
|
|
117
|
-
|
|
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
|
+
## The Stash
|
|
122
94
|
|
|
123
|
-
|
|
124
|
-
|
|
95
|
+
Your stash is the local library where assets live. It combines three sources
|
|
96
|
+
in priority order:
|
|
125
97
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
-
```
|
|
98
|
+
1. **Primary stash** -- Your personal assets (`AKM_STASH_DIR`), created by `akm init`
|
|
99
|
+
2. **Search paths** -- Additional directories (team shares, project dirs, etc.)
|
|
100
|
+
3. **Installed kits** -- Kits from npm, GitHub, or git via `akm add` (cache-managed)
|
|
134
101
|
|
|
135
|
-
|
|
102
|
+
The first match wins, so local assets always override installed ones. Use
|
|
103
|
+
`akm clone` to fork an installed asset into your stash for editing.
|
|
136
104
|
|
|
137
|
-
|
|
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
|
|
144
106
|
|
|
145
|
-
|
|
146
|
-
|
|
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).
|
|
107
|
+
Registries are indexes of available kits. akm ships with the official
|
|
108
|
+
[akm-registry](https://github.com/itlackey/akm-registry) pre-configured.
|
|
149
109
|
|
|
150
|
-
|
|
110
|
+
```sh
|
|
111
|
+
# Search the official registry
|
|
112
|
+
akm registry search "code review"
|
|
151
113
|
|
|
152
|
-
|
|
153
|
-
|
|
114
|
+
# Add a third-party registry
|
|
115
|
+
akm registry add https://example.com/registry/index.json --name team
|
|
154
116
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
117
|
+
# List configured registries
|
|
118
|
+
akm registry list
|
|
119
|
+
```
|
|
158
120
|
|
|
159
|
-
|
|
160
|
-
|
|
121
|
+
See the [Registry docs](docs/registry.md) for hosting your own registry,
|
|
122
|
+
the v2 index format with asset-level metadata, and more.
|
|
161
123
|
|
|
162
124
|
## Searching and Showing Assets
|
|
163
125
|
|
|
@@ -165,7 +127,7 @@ Search returns brief JSON by default. Use `--detail normal` or `--detail full`
|
|
|
165
127
|
when you want origin, tags, or explainability metadata:
|
|
166
128
|
|
|
167
129
|
```sh
|
|
168
|
-
akm search "docker" --type
|
|
130
|
+
akm search "docker" --type script
|
|
169
131
|
```
|
|
170
132
|
|
|
171
133
|
```json
|
|
@@ -184,7 +146,7 @@ akm search "docker" --type tool
|
|
|
184
146
|
Show returns everything the agent needs to act:
|
|
185
147
|
|
|
186
148
|
```sh
|
|
187
|
-
akm show
|
|
149
|
+
akm show script:docker-build.sh
|
|
188
150
|
```
|
|
189
151
|
|
|
190
152
|
```json
|
|
@@ -193,9 +155,9 @@ akm show tool:docker-build.sh
|
|
|
193
155
|
"name": "docker-build.sh",
|
|
194
156
|
"origin": null,
|
|
195
157
|
"action": "Execute the run command below",
|
|
196
|
-
"run": "bash /path/to/
|
|
158
|
+
"run": "bash /path/to/scripts/docker-build.sh",
|
|
197
159
|
"setup": "bun install",
|
|
198
|
-
"cwd": "/path/to/
|
|
160
|
+
"cwd": "/path/to/scripts"
|
|
199
161
|
}
|
|
200
162
|
```
|
|
201
163
|
|
|
@@ -217,19 +179,13 @@ akm add git+https://gitlab.com/org/kit # Any git repo
|
|
|
217
179
|
akm add ./path/to/local/kit # Local directory
|
|
218
180
|
```
|
|
219
181
|
|
|
220
|
-
Search the registry for community kits:
|
|
221
|
-
|
|
222
|
-
```sh
|
|
223
|
-
akm search "code review" --source registry
|
|
224
|
-
```
|
|
225
|
-
|
|
226
182
|
Manage installed kits:
|
|
227
183
|
|
|
228
184
|
```sh
|
|
229
185
|
akm list # Show installed kits with status
|
|
230
186
|
akm update --all # Update all (reports version changes)
|
|
231
187
|
akm remove owner/repo # Remove and reindex
|
|
232
|
-
akm clone
|
|
188
|
+
akm clone script:deploy.sh # Fork an asset into your stash for editing
|
|
233
189
|
```
|
|
234
190
|
|
|
235
191
|
### Publishing your own kit
|
|
@@ -256,7 +212,7 @@ bun install -g akm-cli
|
|
|
256
212
|
|
|
257
213
|
### Standalone binary
|
|
258
214
|
|
|
259
|
-
The standalone binary bundles everything and has **no runtime dependencies**
|
|
215
|
+
The standalone binary bundles everything and has **no runtime dependencies** --
|
|
260
216
|
no Bun, no Node.js.
|
|
261
217
|
|
|
262
218
|
```sh
|
|
@@ -280,20 +236,17 @@ akm upgrade --check # Check for updates without installing
|
|
|
280
236
|
|
|
281
237
|
| Doc | Description |
|
|
282
238
|
| --- | --- |
|
|
283
|
-
| [
|
|
239
|
+
| [Getting Started](docs/getting-started.md) | Quick setup guide |
|
|
284
240
|
| [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
241
|
| [Configuration](docs/configuration.md) | Providers, settings, and Ollama setup |
|
|
291
|
-
| [
|
|
242
|
+
| [Concepts](docs/concepts.md) | Asset types, classification, stash sources, metadata |
|
|
243
|
+
| [Kit Maker's Guide](docs/kit-makers.md) | Build and share a kit on GitHub, npm, or a network share |
|
|
244
|
+
| [Registry](docs/registry.md) | Registries, search, and managing kits |
|
|
292
245
|
|
|
293
246
|
## Status
|
|
294
247
|
|
|
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
|
|
248
|
+
`akm` is approaching v1.0. The core CLI, stash model, and registry are generally stable
|
|
249
|
+
and in daily use. Feedback, issues, and PRs welcome -- especially around
|
|
297
250
|
real-world usage patterns and integrations with different AI coding assistants.
|
|
298
251
|
|
|
299
252
|
## License
|
package/dist/asset-spec.js
CHANGED
|
@@ -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
|
-
/**
|
|
18
|
-
export const
|
|
19
|
-
|
|
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) =>
|
|
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",
|