@hashicorp/kits 0.1.4 → 0.1.5
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 +173 -32
- package/dist/adapters/base-adapter.d.ts +2 -2
- package/dist/adapters/base-adapter.js +2 -2
- package/dist/adapters/claude-code/index.d.ts +1 -1
- package/dist/adapters/claude-code/index.js +1 -1
- package/dist/adapters/codex/index.d.ts +1 -1
- package/dist/adapters/codex/index.js +1 -1
- package/dist/adapters/gemini-cli/index.d.ts +1 -1
- package/dist/adapters/gemini-cli/index.js +1 -1
- package/dist/adapters/github-copilot/index.d.ts +1 -1
- package/dist/adapters/github-copilot/index.js +1 -1
- package/dist/adapters/opencode/index.d.ts +1 -1
- package/dist/adapters/opencode/index.js +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +29 -9
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/install.d.ts.map +1 -1
- package/dist/cli/install.js +820 -161
- package/dist/cli/install.js.map +1 -1
- package/dist/cli/list.d.ts.map +1 -1
- package/dist/cli/list.js +8 -6
- package/dist/cli/list.js.map +1 -1
- package/dist/cli/types.d.ts +17 -0
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/cli/types.js +1 -0
- package/dist/cli/types.js.map +1 -1
- package/dist/cli/uninstall.d.ts.map +1 -1
- package/dist/cli/uninstall.js +300 -38
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/cli/upgrade.d.ts.map +1 -1
- package/dist/cli/upgrade.js +334 -105
- package/dist/cli/upgrade.js.map +1 -1
- package/dist/cli/validate.js +5 -5
- package/dist/cli/validate.js.map +1 -1
- package/dist/core/types.d.ts +5 -5
- package/dist/core/upgrade-executor.d.ts +7 -7
- package/dist/core/upgrade-executor.d.ts.map +1 -1
- package/dist/core/upgrade-executor.js +17 -17
- package/dist/core/upgrade-executor.js.map +1 -1
- package/dist/discovery/kit-scanner.d.ts +3 -3
- package/dist/discovery/kit-scanner.js +17 -17
- package/dist/discovery/kit-scanner.js.map +1 -1
- package/dist/discovery/types.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/lockfile/index.d.ts +79 -0
- package/dist/lockfile/index.d.ts.map +1 -0
- package/dist/lockfile/index.js +203 -0
- package/dist/lockfile/index.js.map +1 -0
- package/dist/lockfile/read.d.ts +32 -0
- package/dist/lockfile/read.d.ts.map +1 -0
- package/dist/lockfile/read.js +88 -0
- package/dist/lockfile/read.js.map +1 -0
- package/dist/lockfile/types.d.ts +126 -0
- package/dist/lockfile/types.d.ts.map +1 -0
- package/dist/lockfile/types.js +44 -0
- package/dist/lockfile/types.js.map +1 -0
- package/dist/{manifest → lockfile}/upgrade-check.d.ts +5 -5
- package/dist/lockfile/upgrade-check.d.ts.map +1 -0
- package/dist/{manifest → lockfile}/upgrade-check.js +11 -9
- package/dist/lockfile/upgrade-check.js.map +1 -0
- package/dist/lockfile/utils.d.ts +35 -0
- package/dist/lockfile/utils.d.ts.map +1 -0
- package/dist/lockfile/utils.js +57 -0
- package/dist/lockfile/utils.js.map +1 -0
- package/dist/lockfile/write.d.ts +44 -0
- package/dist/lockfile/write.d.ts.map +1 -0
- package/dist/lockfile/write.js +77 -0
- package/dist/lockfile/write.js.map +1 -0
- package/dist/manifest/hash.d.ts +7 -0
- package/dist/manifest/hash.d.ts.map +1 -0
- package/dist/manifest/hash.js +30 -0
- package/dist/manifest/hash.js.map +1 -0
- package/dist/manifest/index.d.ts +8 -77
- package/dist/manifest/index.d.ts.map +1 -1
- package/dist/manifest/index.js +6 -197
- package/dist/manifest/index.js.map +1 -1
- package/dist/manifest/read.d.ts +4 -24
- package/dist/manifest/read.d.ts.map +1 -1
- package/dist/manifest/read.js +22 -46
- package/dist/manifest/read.js.map +1 -1
- package/dist/manifest/types.d.ts +17 -109
- package/dist/manifest/types.d.ts.map +1 -1
- package/dist/manifest/types.js +8 -37
- package/dist/manifest/types.js.map +1 -1
- package/dist/manifest/utils.d.ts +1 -27
- package/dist/manifest/utils.d.ts.map +1 -1
- package/dist/manifest/utils.js +1 -28
- package/dist/manifest/utils.js.map +1 -1
- package/dist/manifest/write.d.ts +3 -34
- package/dist/manifest/write.d.ts.map +1 -1
- package/dist/manifest/write.js +5 -45
- package/dist/manifest/write.js.map +1 -1
- package/dist/resolution/index.d.ts +7 -7
- package/dist/resolution/index.d.ts.map +1 -1
- package/dist/resolution/index.js +29 -19
- package/dist/resolution/index.js.map +1 -1
- package/dist/resolution/multi-kit-resolver.d.ts +2 -2
- package/dist/resolution/multi-kit-resolver.js +2 -2
- package/dist/resolution/primitives-registry.d.ts +1 -1
- package/dist/resolution/primitives-registry.js +2 -2
- package/dist/resolution/primitives-registry.js.map +1 -1
- package/dist/resolution/types.d.ts +1 -1
- package/dist/resolution/types.js +1 -1
- package/dist/tui/types.d.ts +1 -0
- package/dist/tui/types.d.ts.map +1 -1
- package/dist/tui/upgrade-select.d.ts +1 -1
- package/dist/tui/upgrade-select.d.ts.map +1 -1
- package/dist/tui/upgrade-select.js +15 -4
- package/dist/tui/upgrade-select.js.map +1 -1
- package/dist/validation/validate-kits.d.ts +1 -1
- package/dist/validation/validate-kits.js +5 -5
- package/dist/validation/validate-kits.js.map +1 -1
- package/package.json +1 -1
- package/schemas/{manifest.schema.json → kits-lock.schema.json} +34 -8
- package/schemas/kits-manifest.schema.json +95 -0
- package/schemas/{kits.schema.json → kits-registry.schema.json} +3 -3
- package/schemas/{primitives.schema.json → primitives-registry.schema.json} +2 -2
- package/dist/manifest/upgrade-check.d.ts.map +0 -1
- package/dist/manifest/upgrade-check.js.map +0 -1
package/README.md
CHANGED
|
@@ -2,6 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
Install AI agent kits into your favorite coding assistants.
|
|
4
4
|
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Overview](#overview)
|
|
8
|
+
- [Installation](#installation)
|
|
9
|
+
- [Quick Start](#quick-start)
|
|
10
|
+
- [Commands](#commands)
|
|
11
|
+
- [Install](#install)
|
|
12
|
+
- [Manifest-driven installs (kits.json)](#manifest-driven-installs-kitsjson)
|
|
13
|
+
- [Uninstall](#uninstall)
|
|
14
|
+
- [Upgrade](#upgrade)
|
|
15
|
+
- [Validate](#validate)
|
|
16
|
+
- [List](#list)
|
|
17
|
+
- [Info](#info)
|
|
18
|
+
- [Supported Harnesses](#supported-harnesses)
|
|
19
|
+
- [Installation Scopes](#installation-scopes)
|
|
20
|
+
- [Global Scope (`--global`)](#global-scope---global)
|
|
21
|
+
- [Project Scope (`--project`)](#project-scope---project)
|
|
22
|
+
- [Scope Limitations](#scope-limitations)
|
|
23
|
+
- [Source Formats](#source-formats)
|
|
24
|
+
- [Primitive Resolution](#primitive-resolution)
|
|
25
|
+
- [File vs Configuration Primitives](#file-vs-configuration-primitives)
|
|
26
|
+
- [Kits Manifest + Lock](#kits-manifest--lock)
|
|
27
|
+
- [Exit Codes](#exit-codes)
|
|
28
|
+
- [Environment Variables](#environment-variables)
|
|
29
|
+
- [Configuration](#configuration)
|
|
30
|
+
- [Kit Repository Structure](#kit-repository-structure)
|
|
31
|
+
- [Kit Definition (kit.json)](#kit-definition-kitjson)
|
|
32
|
+
- [Primitive Formats](#primitive-formats)
|
|
33
|
+
- [Model Templates](#model-templates)
|
|
34
|
+
- [Development](#development)
|
|
35
|
+
- [Prerequisites](#prerequisites)
|
|
36
|
+
- [Setup](#setup)
|
|
37
|
+
- [Testing Local Changes](#testing-local-changes)
|
|
38
|
+
- [Integration Tests (Devcontainer)](#integration-tests-devcontainer)
|
|
39
|
+
- [Project Structure](#project-structure)
|
|
40
|
+
- [Troubleshooting](#troubleshooting)
|
|
41
|
+
- [Common Issues](#common-issues)
|
|
42
|
+
- [Debug Mode](#debug-mode)
|
|
43
|
+
- [License](#license)
|
|
44
|
+
|
|
5
45
|
## Overview
|
|
6
46
|
|
|
7
47
|
The Kit Installer is a CLI tool that discovers, validates, and installs AI agent kits from kit repositories into various AI coding assistant harnesses. It supports multiple harnesses including Claude Code, Codex, Gemini CLI, GitHub Copilot, and OpenCode.
|
|
@@ -53,7 +93,7 @@ npx @hashicorp/kits install example-org/kits --global --dry-run
|
|
|
53
93
|
|
|
54
94
|
### Install
|
|
55
95
|
|
|
56
|
-
Installs kits from a source repository.
|
|
96
|
+
Installs kits from a source repository or a manifest directory.
|
|
57
97
|
|
|
58
98
|
```bash
|
|
59
99
|
kits install <source> [options]
|
|
@@ -65,18 +105,22 @@ kits install <source> [options]
|
|
|
65
105
|
|------|-------------|
|
|
66
106
|
| `-a, --agent <name...>` | Target specific harness(es) |
|
|
67
107
|
| `-k, --kit <name...>` | Install specific kit(s) |
|
|
68
|
-
| `-g, --global` |
|
|
69
|
-
| `-p, --project` |
|
|
108
|
+
| `-g, --global` | Use global scope (user-level, available in all projects) |
|
|
109
|
+
| `-p, --project` | Use project scope (current directory only) |
|
|
110
|
+
| `--alias <name>` | Install a single kit using an alternate instance name |
|
|
70
111
|
| `-e, --env <KEY=VALUE>` | Set environment variable for MCP servers (repeatable; nonsensitive only) |
|
|
71
|
-
| `--mcp-instance <KIT:NAME=VALUE>` | Override MCP instance name
|
|
112
|
+
| `--mcp-instance <KIT:NAME=VALUE>` | Override MCP instance name (repeatable; KIT is the kit instance name) |
|
|
72
113
|
| `-l, --list` | List available kits without installing |
|
|
73
114
|
| `-y, --yes` | Non-interactive mode, accept defaults |
|
|
115
|
+
| `--ci` | Require a matching kits-lock.json when installing from kits.json |
|
|
116
|
+
| `--ignore-lock` | Ignore kits-lock.json and resolve directly from kits.json |
|
|
117
|
+
| `--overwrite` | Overwrite existing kit instances when names collide |
|
|
74
118
|
| `--dry-run` | Show what would be installed |
|
|
75
119
|
| `--json` | Output results as JSON |
|
|
76
120
|
| `-v, --verbose` | Enable verbose logging |
|
|
77
121
|
| `--debug` | Enable debug logging to `~/.config/agent-kit/debug.log` |
|
|
78
122
|
|
|
79
|
-
**Note:** In non-interactive mode (`-y`), one of `--global` or `--project` is required.
|
|
123
|
+
**Note:** In non-interactive mode (`-y`), one of `--global` or `--project` is required unless installing from `kits.json` (which defines scope).
|
|
80
124
|
|
|
81
125
|
**Examples:**
|
|
82
126
|
|
|
@@ -99,6 +143,12 @@ npx @hashicorp/kits install example-org/kits \
|
|
|
99
143
|
-k vault-operations \
|
|
100
144
|
--project
|
|
101
145
|
|
|
146
|
+
# Install a kit with an alias (instance name)
|
|
147
|
+
npx @hashicorp/kits install example-org/kits \
|
|
148
|
+
-k terraform-development \
|
|
149
|
+
--alias terraform-dev \
|
|
150
|
+
--project
|
|
151
|
+
|
|
102
152
|
# Override MCP instance name for a specific kit
|
|
103
153
|
npx @hashicorp/kits install example-org/kits \
|
|
104
154
|
-k terraform-development \
|
|
@@ -114,26 +164,46 @@ npx @hashicorp/kits install example-org/kits \
|
|
|
114
164
|
|
|
115
165
|
# Install from local directory (for development)
|
|
116
166
|
npx @hashicorp/kits install ./my-kits -a claude-code --project
|
|
167
|
+
|
|
168
|
+
# Install from a kits.json manifest in the current repo
|
|
169
|
+
npx @hashicorp/kits install .
|
|
117
170
|
```
|
|
118
171
|
|
|
119
|
-
|
|
172
|
+
#### Manifest-driven installs (kits.json)
|
|
120
173
|
|
|
121
|
-
|
|
174
|
+
If `<source>` points at a directory or a `kits.json` file, the installer will
|
|
175
|
+
look for a manifest and use it as the installation intent:
|
|
122
176
|
|
|
123
|
-
|
|
124
|
-
|
|
177
|
+
1. `<source>/.agents/kits.json`
|
|
178
|
+
2. `<source>/kits.json`
|
|
179
|
+
3. `<source>` itself if it is `kits.json`
|
|
180
|
+
|
|
181
|
+
The manifest determines scope, sources, and optional harness selection. When
|
|
182
|
+
`kits.json` is present, the installer writes a corresponding `kits-lock.json`
|
|
183
|
+
and records a hash of the manifest to keep the two in sync.
|
|
184
|
+
|
|
185
|
+
Example manifest (`.agents/kits.json`):
|
|
186
|
+
|
|
187
|
+
```json
|
|
188
|
+
{
|
|
189
|
+
"schemaVersion": "1.0.0",
|
|
190
|
+
"scope": "project",
|
|
191
|
+
"sources": [
|
|
192
|
+
{ "source": "example-org/kits", "kits": ["terraform-development"] }
|
|
193
|
+
],
|
|
194
|
+
"harnesses": ["claude-code"]
|
|
195
|
+
}
|
|
125
196
|
```
|
|
126
197
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
- `validators/` for validator binaries (using `test-kits/fixtures/invalid/`)
|
|
198
|
+
Install using that manifest:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
npx @hashicorp/kits install .
|
|
202
|
+
```
|
|
133
203
|
|
|
134
204
|
### Uninstall
|
|
135
205
|
|
|
136
|
-
Removes installed
|
|
206
|
+
Removes installed kit instances.
|
|
137
207
|
|
|
138
208
|
```bash
|
|
139
209
|
kits uninstall <kit-name> [options]
|
|
@@ -144,9 +214,13 @@ kits uninstall <kit-name> [options]
|
|
|
144
214
|
| Flag | Description |
|
|
145
215
|
|------|-------------|
|
|
146
216
|
| `-a, --agent <name...>` | Target specific harness(es) |
|
|
147
|
-
| `-g, --global` |
|
|
148
|
-
| `-p, --project` |
|
|
217
|
+
| `-g, --global` | Use global scope |
|
|
218
|
+
| `-p, --project` | Use project scope |
|
|
219
|
+
| `--alias <name>` | Target a specific kit instance name (installAs) |
|
|
220
|
+
| `--all` | Uninstall all instances that match the kit name |
|
|
149
221
|
| `-y, --yes` | Non-interactive mode |
|
|
222
|
+
| `--lock-only` | Uninstall using kits-lock.json only (do not modify kits.json) |
|
|
223
|
+
| `--dry-run` | Show what would be uninstalled |
|
|
150
224
|
| `--json` | Output results as JSON |
|
|
151
225
|
|
|
152
226
|
**Note:** In non-interactive mode (`-y`), one of `--global` or `--project` is required.
|
|
@@ -163,6 +237,9 @@ npx @hashicorp/kits uninstall terraform-development --global -y
|
|
|
163
237
|
# Uninstall from project scope
|
|
164
238
|
npx @hashicorp/kits uninstall terraform-development --project -y
|
|
165
239
|
|
|
240
|
+
# Uninstall a specific kit instance (alias)
|
|
241
|
+
npx @hashicorp/kits uninstall terraform-development --alias terraform-dev --project -y
|
|
242
|
+
|
|
166
243
|
# Uninstall from specific harness at global scope
|
|
167
244
|
npx @hashicorp/kits uninstall terraform-development -a claude-code --global -y
|
|
168
245
|
```
|
|
@@ -179,13 +256,17 @@ kits upgrade [options]
|
|
|
179
256
|
|
|
180
257
|
| Flag | Description |
|
|
181
258
|
|------|-------------|
|
|
182
|
-
| `-s, --source <source>` | Kit repository source |
|
|
259
|
+
| `-s, --source <source>` | Kit repository source (defaults to lockfile sources) |
|
|
183
260
|
| `-a, --agent <name...>` | Target specific harness(es) |
|
|
184
|
-
| `-k, --kit <name...>` | Upgrade specific kit(s)
|
|
185
|
-
|
|
|
186
|
-
|
|
|
261
|
+
| `-k, --kit <name...>` | Upgrade specific kit(s) by canonical name |
|
|
262
|
+
| `--alias <name>` | Upgrade a specific kit instance name |
|
|
263
|
+
| `--all` | Upgrade all kit instances for the selected kit(s) |
|
|
264
|
+
| `-g, --global` | Use global scope (required) |
|
|
265
|
+
| `-p, --project` | Use project scope (required) |
|
|
187
266
|
| `-c, --check` | Check for updates without installing |
|
|
188
267
|
| `-y, --yes` | Non-interactive mode |
|
|
268
|
+
| `--dry-run` | Alias for `--check` |
|
|
269
|
+
| `--save` | Update kits.json source refs to match upgraded lockfile |
|
|
189
270
|
| `--json` | Output results as JSON |
|
|
190
271
|
|
|
191
272
|
**Note:** Unlike install, upgrade always requires `--global` or `--project` (no TUI prompt).
|
|
@@ -210,6 +291,12 @@ npx @hashicorp/kits upgrade \
|
|
|
210
291
|
-s example-org/kits \
|
|
211
292
|
-k terraform-development \
|
|
212
293
|
--global
|
|
294
|
+
|
|
295
|
+
# Upgrade a specific kit instance
|
|
296
|
+
npx @hashicorp/kits upgrade \
|
|
297
|
+
--alias terraform-dev \
|
|
298
|
+
--global \
|
|
299
|
+
--check
|
|
213
300
|
```
|
|
214
301
|
|
|
215
302
|
### Validate
|
|
@@ -232,7 +319,7 @@ npx @hashicorp/kits validate --hooks ./agent-kits
|
|
|
232
319
|
# Validate MCP configs in a local path
|
|
233
320
|
npx @hashicorp/kits validate --mcp ./agent-kits
|
|
234
321
|
|
|
235
|
-
# Validate kit definitions and kits.json registry
|
|
322
|
+
# Validate kit definitions and kits-registry.json registry
|
|
236
323
|
npx @hashicorp/kits validate --kits ./agent-kits
|
|
237
324
|
```
|
|
238
325
|
|
|
@@ -363,14 +450,36 @@ The installer resolves these references at install time:
|
|
|
363
450
|
|
|
364
451
|
When multiple kits reference the same primitive, the installer deduplicates and selects the highest compatible version.
|
|
365
452
|
|
|
366
|
-
##
|
|
453
|
+
## File vs Configuration Primitives
|
|
454
|
+
|
|
455
|
+
Primitives install in two different ways, and the installer treats them differently:
|
|
456
|
+
|
|
457
|
+
**File-based primitives** are copied into harness-specific directories. These include
|
|
458
|
+
commands, skills, subagents, and hook programs. The harness discovers them by scanning
|
|
459
|
+
its filesystem paths, so installs/uninstalls are direct file operations.
|
|
460
|
+
|
|
461
|
+
**Configuration-based primitives** are merged into harness configuration files. These
|
|
462
|
+
include MCP server definitions and hook bindings. The installer updates config files
|
|
463
|
+
and tracks instance hashes in `kits-lock.json` so it can safely upgrade or remove
|
|
464
|
+
entries later without clobbering unrelated settings.
|
|
465
|
+
|
|
466
|
+
## Kits Manifest + Lock
|
|
367
467
|
|
|
368
|
-
The installer
|
|
468
|
+
The installer reads declarative kits manifests (`kits.json`) and records resolved installs in lockfiles (`kits-lock.json`).
|
|
469
|
+
|
|
470
|
+
Manifests are scope-specific:
|
|
369
471
|
|
|
370
472
|
| Scope | Manifest Location |
|
|
473
|
+
|-------|-------------------|
|
|
474
|
+
| Global | `~/.agents/kits.json` |
|
|
475
|
+
| Project | `.agents/kits.json` |
|
|
476
|
+
|
|
477
|
+
Lockfiles are scope-specific:
|
|
478
|
+
|
|
479
|
+
| Scope | Lockfile Location |
|
|
371
480
|
|-------|------------------|
|
|
372
|
-
| Global | `~/.agents/
|
|
373
|
-
| Project | `.agents/
|
|
481
|
+
| Global | `~/.agents/kits-lock.json` |
|
|
482
|
+
| Project | `.agents/kits-lock.json` |
|
|
374
483
|
|
|
375
484
|
This enables:
|
|
376
485
|
- Uninstallation of kits
|
|
@@ -378,6 +487,14 @@ This enables:
|
|
|
378
487
|
- Conflict detection
|
|
379
488
|
- Scope isolation (global and project installations are tracked separately)
|
|
380
489
|
|
|
490
|
+
Behavior notes:
|
|
491
|
+
- When `kits.json` exists and its hash matches the lockfile metadata, the
|
|
492
|
+
lockfile is the authoritative source of resolved versions.
|
|
493
|
+
- `--ci` requires a matching lockfile and fails fast if out of sync.
|
|
494
|
+
- `--ignore-lock` ignores `kits-lock.json` and resolves directly from `kits.json`.
|
|
495
|
+
- `uninstall`/`upgrade` will fail if `kits.json` exists but is out of sync with
|
|
496
|
+
the lockfile (use `install` to reconcile, or `uninstall --lock-only`).
|
|
497
|
+
|
|
381
498
|
## Exit Codes
|
|
382
499
|
|
|
383
500
|
| Code | Meaning |
|
|
@@ -394,6 +511,9 @@ This enables:
|
|
|
394
511
|
| 9 | No upgrades available |
|
|
395
512
|
| 10 | User cancelled |
|
|
396
513
|
| 11 | Scope required (non-interactive mode without `--global` or `--project`) |
|
|
514
|
+
| 12 | Required env var missing |
|
|
515
|
+
| 13 | Sensitive env var provided via `--env` |
|
|
516
|
+
| 14 | Lockfile out of sync with kits.json |
|
|
397
517
|
|
|
398
518
|
## Environment Variables
|
|
399
519
|
|
|
@@ -409,8 +529,8 @@ A kit repository should have:
|
|
|
409
529
|
|
|
410
530
|
```
|
|
411
531
|
my-kits/
|
|
412
|
-
├── kits.json
|
|
413
|
-
├── primitives.json
|
|
532
|
+
├── kits-registry.json # Kits registry (optional, enables multiple kits)
|
|
533
|
+
├── primitives-registry.json # Shared primitives registry (optional)
|
|
414
534
|
├── primitives/ # Shared primitive definitions
|
|
415
535
|
│ ├── commands/
|
|
416
536
|
│ ├── skills/
|
|
@@ -554,20 +674,36 @@ npm link
|
|
|
554
674
|
kits install ./path/to/local/kits
|
|
555
675
|
|
|
556
676
|
# Or use directly without linking
|
|
557
|
-
|
|
677
|
+
node bin/kits.js install ./path/to/local/kits
|
|
678
|
+
```
|
|
679
|
+
|
|
680
|
+
### Integration Tests (Devcontainer)
|
|
681
|
+
|
|
682
|
+
The integration suite runs the real CLI against the local `test-kits/` repository using non-interactive JSON output. It is intended to run inside the devcontainer so harness CLIs are available and filesystem isolation is preserved.
|
|
683
|
+
|
|
684
|
+
```bash
|
|
685
|
+
npm run test:integration
|
|
558
686
|
```
|
|
559
687
|
|
|
688
|
+
Integration tests are organized by intent under `tests/integration/`:
|
|
689
|
+
- `cli/` for CLI command behavior
|
|
690
|
+
- `primitives/` for primitive-specific scenarios
|
|
691
|
+
- `harnesses/` for harness-specific scenarios
|
|
692
|
+
- `scopes/` for scope-specific scenarios
|
|
693
|
+
- `validators/` for validator binaries (using `test-kits/fixtures/invalid/`)
|
|
694
|
+
|
|
560
695
|
### Project Structure
|
|
561
696
|
|
|
562
697
|
```
|
|
563
|
-
|
|
698
|
+
kits/
|
|
564
699
|
├── src/
|
|
565
700
|
│ ├── cli/ # CLI commands (install, uninstall, upgrade, etc.)
|
|
566
701
|
│ ├── tui/ # Terminal UI components
|
|
567
702
|
│ ├── adapters/ # Harness adapters (claude-code, codex, etc.)
|
|
568
703
|
│ ├── discovery/ # Kit discovery and source fetching
|
|
569
704
|
│ ├── resolution/ # Primitive reference resolution
|
|
570
|
-
│ ├── manifest/ #
|
|
705
|
+
│ ├── manifest/ # kits.json intent
|
|
706
|
+
│ ├── lockfile/ # kits-lock.json tracking
|
|
571
707
|
│ └── core/ # Core types and utilities
|
|
572
708
|
├── tests/ # Test files
|
|
573
709
|
├── schemas/ # JSON schemas
|
|
@@ -604,6 +740,11 @@ agent-kit-cli/
|
|
|
604
740
|
- Use `--global` to install kits requiring these primitives to Codex
|
|
605
741
|
- Or install to other harnesses that support project scope
|
|
606
742
|
|
|
743
|
+
**"Lockfile out of sync" (exit code 14)**
|
|
744
|
+
- A `kits.json` exists but the lockfile hash does not match
|
|
745
|
+
- Run `kits install <source>` to reconcile
|
|
746
|
+
- Or use `kits uninstall --lock-only` to bypass manifest updates
|
|
747
|
+
|
|
607
748
|
### Debug Mode
|
|
608
749
|
|
|
609
750
|
Enable debug logging for detailed output:
|
|
@@ -131,7 +131,7 @@ export declare abstract class BaseAdapter implements KitAdapter {
|
|
|
131
131
|
/**
|
|
132
132
|
* Check if a kit is compatible with this harness at the given scope.
|
|
133
133
|
*
|
|
134
|
-
* @param kit - Kit
|
|
134
|
+
* @param kit - Kit manifest to check
|
|
135
135
|
* @param scope - Installation scope (defaults to "global")
|
|
136
136
|
*/
|
|
137
137
|
checkCompatibility(kit: KitManifest, scope?: InstallationScope): CompatibilityResult;
|
|
@@ -184,7 +184,7 @@ export declare abstract class BaseAdapter implements KitAdapter {
|
|
|
184
184
|
*
|
|
185
185
|
* Subclasses should override for harness-specific config handling.
|
|
186
186
|
*
|
|
187
|
-
* @param kit - Kit
|
|
187
|
+
* @param kit - Kit manifest
|
|
188
188
|
* @param resolvedPrimitives - Resolved primitives to install
|
|
189
189
|
* @param dryRun - If true, don't actually write files
|
|
190
190
|
* @param completedOps - Array to track completed operations for rollback
|
|
@@ -55,7 +55,7 @@ export class BaseAdapter {
|
|
|
55
55
|
/**
|
|
56
56
|
* Check if a kit is compatible with this harness at the given scope.
|
|
57
57
|
*
|
|
58
|
-
* @param kit - Kit
|
|
58
|
+
* @param kit - Kit manifest to check
|
|
59
59
|
* @param scope - Installation scope (defaults to "global")
|
|
60
60
|
*/
|
|
61
61
|
checkCompatibility(kit, scope) {
|
|
@@ -481,7 +481,7 @@ export class BaseAdapter {
|
|
|
481
481
|
*
|
|
482
482
|
* Subclasses should override for harness-specific config handling.
|
|
483
483
|
*
|
|
484
|
-
* @param kit - Kit
|
|
484
|
+
* @param kit - Kit manifest
|
|
485
485
|
* @param resolvedPrimitives - Resolved primitives to install
|
|
486
486
|
* @param dryRun - If true, don't actually write files
|
|
487
487
|
* @param completedOps - Array to track completed operations for rollback
|
|
@@ -134,7 +134,7 @@ export declare class ClaudeCodeAdapter extends BaseAdapter {
|
|
|
134
134
|
/**
|
|
135
135
|
* Update harness configuration for MCP servers and hooks.
|
|
136
136
|
*
|
|
137
|
-
* @param kit - Kit
|
|
137
|
+
* @param kit - Kit manifest
|
|
138
138
|
* @param resolvedPrimitives - Resolved primitives to install
|
|
139
139
|
* @param dryRun - If true, don't actually write files
|
|
140
140
|
* @param completedOps - Array to track completed operations for rollback
|
|
@@ -292,7 +292,7 @@ export class ClaudeCodeAdapter extends BaseAdapter {
|
|
|
292
292
|
/**
|
|
293
293
|
* Update harness configuration for MCP servers and hooks.
|
|
294
294
|
*
|
|
295
|
-
* @param kit - Kit
|
|
295
|
+
* @param kit - Kit manifest
|
|
296
296
|
* @param resolvedPrimitives - Resolved primitives to install
|
|
297
297
|
* @param dryRun - If true, don't actually write files
|
|
298
298
|
* @param completedOps - Array to track completed operations for rollback
|
|
@@ -140,7 +140,7 @@ export declare class CodexAdapter extends BaseAdapter {
|
|
|
140
140
|
* Codex only needs MCP configuration updates (no hooks support).
|
|
141
141
|
* MCP is only supported at global scope.
|
|
142
142
|
*
|
|
143
|
-
* @param kit - Kit
|
|
143
|
+
* @param kit - Kit manifest
|
|
144
144
|
* @param resolvedPrimitives - Resolved primitives to install
|
|
145
145
|
* @param dryRun - If true, don't actually write files
|
|
146
146
|
* @param completedOps - Array to track completed operations for rollback
|
|
@@ -204,7 +204,7 @@ export class CodexAdapter extends BaseAdapter {
|
|
|
204
204
|
* Codex only needs MCP configuration updates (no hooks support).
|
|
205
205
|
* MCP is only supported at global scope.
|
|
206
206
|
*
|
|
207
|
-
* @param kit - Kit
|
|
207
|
+
* @param kit - Kit manifest
|
|
208
208
|
* @param resolvedPrimitives - Resolved primitives to install
|
|
209
209
|
* @param dryRun - If true, don't actually write files
|
|
210
210
|
* @param completedOps - Array to track completed operations for rollback
|
|
@@ -138,7 +138,7 @@ export declare class GeminiCliAdapter extends BaseAdapter {
|
|
|
138
138
|
/**
|
|
139
139
|
* Update harness configuration for MCP servers and hooks.
|
|
140
140
|
*
|
|
141
|
-
* @param kit - Kit
|
|
141
|
+
* @param kit - Kit manifest
|
|
142
142
|
* @param resolvedPrimitives - Resolved primitives to install
|
|
143
143
|
* @param dryRun - If true, don't actually write files
|
|
144
144
|
* @param completedOps - Array to track completed operations for rollback
|
|
@@ -267,7 +267,7 @@ export class GeminiCliAdapter extends BaseAdapter {
|
|
|
267
267
|
/**
|
|
268
268
|
* Update harness configuration for MCP servers and hooks.
|
|
269
269
|
*
|
|
270
|
-
* @param kit - Kit
|
|
270
|
+
* @param kit - Kit manifest
|
|
271
271
|
* @param resolvedPrimitives - Resolved primitives to install
|
|
272
272
|
* @param dryRun - If true, don't actually write files
|
|
273
273
|
* @param completedOps - Array to track completed operations for rollback
|
|
@@ -159,7 +159,7 @@ export declare class GithubCopilotAdapter extends BaseAdapter {
|
|
|
159
159
|
/**
|
|
160
160
|
* Update harness configuration for MCP servers and hooks.
|
|
161
161
|
*
|
|
162
|
-
* @param kit - Kit
|
|
162
|
+
* @param kit - Kit manifest
|
|
163
163
|
* @param resolvedPrimitives - Resolved primitives to install
|
|
164
164
|
* @param dryRun - If true, don't actually write files
|
|
165
165
|
* @param completedOps - Array to track completed operations for rollback
|
|
@@ -275,7 +275,7 @@ export class GithubCopilotAdapter extends BaseAdapter {
|
|
|
275
275
|
/**
|
|
276
276
|
* Update harness configuration for MCP servers and hooks.
|
|
277
277
|
*
|
|
278
|
-
* @param kit - Kit
|
|
278
|
+
* @param kit - Kit manifest
|
|
279
279
|
* @param resolvedPrimitives - Resolved primitives to install
|
|
280
280
|
* @param dryRun - If true, don't actually write files
|
|
281
281
|
* @param completedOps - Array to track completed operations for rollback
|
|
@@ -135,7 +135,7 @@ export declare class OpencodeAdapter extends BaseAdapter {
|
|
|
135
135
|
/**
|
|
136
136
|
* Update harness configuration for MCP servers and hooks.
|
|
137
137
|
*
|
|
138
|
-
* @param kit - Kit
|
|
138
|
+
* @param kit - Kit manifest
|
|
139
139
|
* @param resolvedPrimitives - Resolved primitives to install
|
|
140
140
|
* @param dryRun - If true, don't actually write files
|
|
141
141
|
* @param completedOps - Array to track completed operations for rollback
|
|
@@ -223,7 +223,7 @@ export class OpencodeAdapter extends BaseAdapter {
|
|
|
223
223
|
/**
|
|
224
224
|
* Update harness configuration for MCP servers and hooks.
|
|
225
225
|
*
|
|
226
|
-
* @param kit - Kit
|
|
226
|
+
* @param kit - Kit manifest
|
|
227
227
|
* @param resolvedPrimitives - Resolved primitives to install
|
|
228
228
|
* @param dryRun - If true, don't actually write files
|
|
229
229
|
* @param completedOps - Array to track completed operations for rollback
|
package/dist/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA6TH;;GAEG;AACH,wBAAsB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAKzC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -30,9 +30,9 @@ const cliVersion = getCliVersion();
|
|
|
30
30
|
* Returns [globalOption, projectOption] that conflict with each other.
|
|
31
31
|
*/
|
|
32
32
|
function createScopeOptions() {
|
|
33
|
-
const globalOption = new Option("-g, --global", "
|
|
33
|
+
const globalOption = new Option("-g, --global", "Use global scope (user-level, available in all projects)")
|
|
34
34
|
.conflicts("project");
|
|
35
|
-
const projectOption = new Option("-p, --project", "
|
|
35
|
+
const projectOption = new Option("-p, --project", "Use project scope (repository-level, version-controllable)")
|
|
36
36
|
.conflicts("global");
|
|
37
37
|
return [globalOption, projectOption];
|
|
38
38
|
}
|
|
@@ -63,7 +63,7 @@ function collectEnv(value, previous) {
|
|
|
63
63
|
/**
|
|
64
64
|
* Collect --mcp-instance flags into a nested object.
|
|
65
65
|
*
|
|
66
|
-
* Parses KIT:NAME=VALUE format strings into a record keyed by kit name.
|
|
66
|
+
* Parses KIT:NAME=VALUE format strings into a record keyed by kit instance name.
|
|
67
67
|
*/
|
|
68
68
|
function collectMcpInstance(value, previous) {
|
|
69
69
|
const equalsIndex = value.indexOf("=");
|
|
@@ -102,15 +102,19 @@ program
|
|
|
102
102
|
const [installGlobalOpt, installProjectOpt] = createScopeOptions();
|
|
103
103
|
program
|
|
104
104
|
.command("install <source>")
|
|
105
|
-
.description("Install kits from a repository")
|
|
105
|
+
.description("Install kits from a repository or kits.json manifest")
|
|
106
106
|
.addOption(installGlobalOpt)
|
|
107
107
|
.addOption(installProjectOpt)
|
|
108
108
|
.option("-a, --agent <name...>", "Target specific harness(es)")
|
|
109
109
|
.option("-k, --kit <name...>", "Install specific kit(s)")
|
|
110
|
+
.option("--alias <name>", "Install the kit using an alternate instance name (single kit only)")
|
|
110
111
|
.option("-e, --env <KEY=VALUE>", "Set environment variable for MCP servers (repeatable)", collectEnv, {})
|
|
111
|
-
.option("--mcp-instance <KIT:NAME=VALUE>", "Override MCP instance name (repeatable)", collectMcpInstance, {})
|
|
112
|
+
.option("--mcp-instance <KIT:NAME=VALUE>", "Override MCP instance name (repeatable, KIT is instance name)", collectMcpInstance, {})
|
|
112
113
|
.option("-l, --list", "List available kits without installing")
|
|
113
114
|
.option("-y, --yes", "Non-interactive mode, accept defaults")
|
|
115
|
+
.option("--ci", "Strict lockfile install (requires kits.json + kits-lock.json)")
|
|
116
|
+
.option("--ignore-lock", "Ignore kits-lock.json and resolve from kits.json intent")
|
|
117
|
+
.option("--overwrite", "Overwrite existing kit instances when names collide")
|
|
114
118
|
.option("--dry-run", "Show what would be installed without changes")
|
|
115
119
|
.option("--json", "Output results as JSON")
|
|
116
120
|
.option("-v, --verbose", "Enable verbose logging")
|
|
@@ -119,9 +123,13 @@ program
|
|
|
119
123
|
const options = {
|
|
120
124
|
agent: allOpts["agent"],
|
|
121
125
|
kit: allOpts["kit"],
|
|
126
|
+
alias: allOpts["alias"],
|
|
122
127
|
list: allOpts["list"],
|
|
123
128
|
yes: allOpts["yes"],
|
|
124
129
|
dryRun: allOpts["dryRun"],
|
|
130
|
+
ci: allOpts["ci"],
|
|
131
|
+
ignoreLock: allOpts["ignoreLock"],
|
|
132
|
+
overwrite: allOpts["overwrite"],
|
|
125
133
|
json: allOpts["json"],
|
|
126
134
|
debug: allOpts["debug"],
|
|
127
135
|
verbose: allOpts["verbose"],
|
|
@@ -137,11 +145,14 @@ program
|
|
|
137
145
|
const [uninstallGlobalOpt, uninstallProjectOpt] = createScopeOptions();
|
|
138
146
|
program
|
|
139
147
|
.command("uninstall <kit-name>")
|
|
140
|
-
.description("Uninstall a kit")
|
|
148
|
+
.description("Uninstall a kit instance")
|
|
141
149
|
.addOption(uninstallGlobalOpt)
|
|
142
150
|
.addOption(uninstallProjectOpt)
|
|
143
151
|
.option("-a, --agent <name...>", "Target specific harness(es)")
|
|
152
|
+
.option("--alias <name>", "Target a specific kit instance name (installAs)")
|
|
153
|
+
.option("--all", "Uninstall all instances that match the kit name")
|
|
144
154
|
.option("-y, --yes", "Non-interactive mode")
|
|
155
|
+
.option("--lock-only", "Remove from lockfile only (do not modify kits.json)")
|
|
145
156
|
.option("--dry-run", "Show what would be uninstalled without changes")
|
|
146
157
|
.option("--json", "Output results as JSON")
|
|
147
158
|
.option("-v, --verbose", "Enable verbose logging")
|
|
@@ -149,8 +160,11 @@ program
|
|
|
149
160
|
const allOpts = command.optsWithGlobals();
|
|
150
161
|
const options = {
|
|
151
162
|
agent: allOpts["agent"],
|
|
163
|
+
alias: allOpts["alias"],
|
|
164
|
+
all: allOpts["all"],
|
|
152
165
|
yes: allOpts["yes"],
|
|
153
166
|
dryRun: allOpts["dryRun"],
|
|
167
|
+
lockOnly: allOpts["lockOnly"],
|
|
154
168
|
json: allOpts["json"],
|
|
155
169
|
debug: allOpts["debug"],
|
|
156
170
|
verbose: allOpts["verbose"],
|
|
@@ -167,11 +181,14 @@ program
|
|
|
167
181
|
.description("Check for and apply primitive upgrades")
|
|
168
182
|
.addOption(upgradeGlobalOpt)
|
|
169
183
|
.addOption(upgradeProjectOpt)
|
|
170
|
-
.option("-s, --source <source>", "Kit repository source")
|
|
184
|
+
.option("-s, --source <source>", "Kit repository source (defaults to lockfile sources)")
|
|
171
185
|
.option("-a, --agent <name...>", "Target specific harness(es)")
|
|
172
|
-
.option("-k, --kit <name...>", "Upgrade specific kit(s)
|
|
186
|
+
.option("-k, --kit <name...>", "Upgrade specific kit(s) by canonical name")
|
|
187
|
+
.option("--alias <name>", "Upgrade a specific kit instance name")
|
|
188
|
+
.option("--all", "Upgrade all kit instances for the selected kit(s)")
|
|
173
189
|
.option("-c, --check", "Check for updates without installing")
|
|
174
190
|
.option("--dry-run", "Show what would be upgraded without changes (alias for --check)")
|
|
191
|
+
.option("--save", "Update kits.json source refs to match upgraded lockfile")
|
|
175
192
|
.option("-y, --yes", "Non-interactive mode, upgrade all available")
|
|
176
193
|
.option("--json", "Output results as JSON")
|
|
177
194
|
.option("-v, --verbose", "Enable verbose logging")
|
|
@@ -181,8 +198,11 @@ program
|
|
|
181
198
|
source: allOpts["source"],
|
|
182
199
|
agent: allOpts["agent"],
|
|
183
200
|
kit: allOpts["kit"],
|
|
201
|
+
alias: allOpts["alias"],
|
|
202
|
+
all: allOpts["all"],
|
|
184
203
|
check: allOpts["check"],
|
|
185
204
|
dryRun: allOpts["dryRun"],
|
|
205
|
+
save: allOpts["save"],
|
|
186
206
|
yes: allOpts["yes"],
|
|
187
207
|
json: allOpts["json"],
|
|
188
208
|
debug: allOpts["debug"],
|
|
@@ -241,7 +261,7 @@ program
|
|
|
241
261
|
.option("--commands", "Validate command primitives")
|
|
242
262
|
.option("--skills", "Validate skill primitives")
|
|
243
263
|
.option("--subagents", "Validate subagent primitives")
|
|
244
|
-
.option("--kits", "Validate kit definitions and kits.json registry")
|
|
264
|
+
.option("--kits", "Validate kit definitions and kits-registry.json registry")
|
|
245
265
|
.option("--hooks", "Validate hook programs and kit hook bindings")
|
|
246
266
|
.option("--mcp", "Validate MCP server configs")
|
|
247
267
|
.option("--json", "Output results as JSON")
|