@swarmcraftai/cli 0.4.2 → 0.5.1
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/CHANGELOG.md +16 -0
- package/README.md +99 -70
- package/dist/main.cjs +4023 -369
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the SwarmCraft CLI are documented in this file.
|
|
4
4
|
|
|
5
|
+
## 0.5.1
|
|
6
|
+
|
|
7
|
+
- Refreshes the npm README around customer installation and common workflows, with native PowerShell commands, Node/npm verification, managed-machine recovery and VS Code restart guidance.
|
|
8
|
+
- Clarifies that WSL is not required for the SwarmCraft CLI and that AI-provider prerequisites are separate.
|
|
9
|
+
- Command behavior and the editor/Setup capability contract remain unchanged from 0.5.0.
|
|
10
|
+
|
|
11
|
+
## 0.5.0
|
|
12
|
+
|
|
13
|
+
- Adds deterministic `operate init`, `operate validate`, and `operate status` commands for local operational work, with Codex and Copilot guidance for Work, Automate, and Formalise.
|
|
14
|
+
- Seeds and reconciles operational models, records, knowledge, and bounded automation guidance while preserving owner edits; initialization validates the result and creates a scoped local Git checkpoint without pushing.
|
|
15
|
+
- Supports a private stdin session handoff from VS Code for Operate initialization, with session verification before workspace mutation and content-free, retryable activity reporting.
|
|
16
|
+
- Validates approved operational formalisation and source digests when preparing Deep Discovery evidence, blocking stale or cancelled approvals.
|
|
17
|
+
- Adds SwarmCraft-managed AI to one-shot workflows, including credit balance and stage estimates, measured per-call consumption, and resumable insufficient-credit outcomes. Customer-supplied Codex, Copilot, and custom providers remain supported.
|
|
18
|
+
- Seeds versioned project environment requirements from structured build profiles and documents local-model execution through custom agent commands.
|
|
19
|
+
- Requires the matching API credit, Managed AI, and Operate telemetry contracts; deploy the coordinated API and web release before publishing this client.
|
|
20
|
+
|
|
5
21
|
## 0.4.2
|
|
6
22
|
|
|
7
23
|
- Reconciles generated repository skills through a monotonic, owner-preserving template-set contract before new one-shot runs, while retaining the recorded guidance for resumed runs.
|
package/README.md
CHANGED
|
@@ -1,121 +1,150 @@
|
|
|
1
1
|
# SwarmCraft CLI
|
|
2
2
|
|
|
3
|
-
SwarmCraft
|
|
3
|
+
[SwarmCraft](https://swarmcraft.ai) helps you use AI to get operational work done, automate repeatable tasks, and build applications. It gives your AI assistant shared skills and structured workflows while you keep control of your knowledge, records, and code.
|
|
4
4
|
|
|
5
|
-
Use it to
|
|
5
|
+
The CLI brings SwarmCraft workflows to your terminal. Use it to prepare a local repository for operational work or run implementation tasks from your SwarmCraft project board with an AI coding agent. You can inspect progress, resume interrupted runs, and collect support diagnostics.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Prerequisites
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- Node.js 20.19 or newer, npm, and Git.
|
|
10
|
+
- A SwarmCraft account and a project with tasks ready to implement.
|
|
11
|
+
- A local Git repository with unrelated changes committed or stashed.
|
|
12
|
+
- Codex CLI or GitHub Copilot CLI installed and configured, or SwarmCraft Managed AI credits.
|
|
10
13
|
|
|
11
|
-
-
|
|
12
|
-
- Installed command: `swarmcraft`
|
|
13
|
-
- Supported runtime target: Node.js 20.19 or newer
|
|
14
|
-
- Local run artifact location: `.swarmcraft/runs/<run-id>` inside the selected customer workspace
|
|
15
|
-
- Public package contents: bundled CLI runtime, README, package metadata, and license
|
|
16
|
-
- Shared workspace packages are bundled into the CLI artifact; customers do not install `@swarmcraft/packet-workflow` or `@swarmcraft/repo-seed` directly.
|
|
14
|
+
On macOS and Windows, start with [SwarmCraft Setup](https://swarmcraft.ai/docs/set-up-and-connect/use-swarmcraft-setup) to prepare your environment.
|
|
17
15
|
|
|
18
|
-
##
|
|
16
|
+
## Install
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- `src/runtime/process.ts` provides shell-free argument-array execution. Only `runTrustedShellAgentCommand` may invoke a shell for a deliberately supplied custom-agent template; API content and credentials must never be interpolated into it.
|
|
25
|
-
- `src/bootstrap.ts`, `src/discovery.ts`, and `src/oneShot.ts` compose the seed, immutable discovery-package, and packet execution workflows.
|
|
26
|
-
- `src/workflows/agent-execution.ts` owns approved credential injection, trusted template quoting, and optional cost capture. `src/artifacts/run-manifest.ts` owns contained paths and atomic resume-manifest persistence.
|
|
27
|
-
- `src/supportBundle.ts` exposes only allow-listed delegation facts and recursively redacts secret-bearing keys.
|
|
18
|
+
```bash
|
|
19
|
+
npm install -g @swarmcraftai/cli
|
|
20
|
+
swarmcraft --help
|
|
21
|
+
```
|
|
28
22
|
|
|
29
|
-
|
|
23
|
+
For one-off use, run `npx @swarmcraftai/cli --help`.
|
|
30
24
|
|
|
31
|
-
##
|
|
25
|
+
## Native Windows installation
|
|
32
26
|
|
|
33
|
-
|
|
27
|
+
WSL is not required for the SwarmCraft CLI. In PowerShell:
|
|
34
28
|
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
```powershell
|
|
30
|
+
node --version
|
|
31
|
+
npm.cmd --version
|
|
32
|
+
npm.cmd install -g @swarmcraftai/cli
|
|
33
|
+
swarmcraft.cmd --version
|
|
34
|
+
swarmcraft.cmd operate init --help
|
|
35
|
+
Get-Command node, npm.cmd, swarmcraft.cmd
|
|
36
|
+
npm.cmd prefix -g
|
|
38
37
|
```
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
Use a supported Node.js LTS release meeting the minimum above. Confirm the npm global prefix is on your user PATH, then fully quit and reopen VS Code. A window reload may retain the old PATH. Use `.cmd` commands instead of changing PowerShell execution policy. If software installation or the prefix is restricted, use your organisation's approved installation or user-writable prefix; preserve managed runtimes and npm registry/authentication settings.
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
The extension needs an installed CLI; one-off `npx` execution does not satisfy that requirement. See the [manual setup checklist](https://swarmcraft.ai/docs/set-up-and-connect/manual-setup-checklist). AI providers have separate platform and authentication requirements.
|
|
42
|
+
|
|
43
|
+
PowerShell uses different line continuation from Bash. Run the multiline examples below on one line, using `swarmcraft.cmd`, for example:
|
|
44
|
+
|
|
45
|
+
```powershell
|
|
46
|
+
swarmcraft.cmd one-shot --project YOUR_PROJECT_ID --workspace . --agent-provider codex --task-limit 1 --max-agent-requests 100 --commit-policy done
|
|
44
47
|
```
|
|
45
48
|
|
|
46
|
-
|
|
49
|
+
## Run your first task
|
|
50
|
+
|
|
51
|
+
Sign in and find your project ID:
|
|
47
52
|
|
|
48
53
|
```bash
|
|
49
|
-
|
|
54
|
+
swarmcraft auth login --email you@example.com
|
|
55
|
+
swarmcraft projects list
|
|
50
56
|
```
|
|
51
57
|
|
|
52
|
-
|
|
58
|
+
Login prompts for your password and any required verification code. Your CLI session is saved in `~/.swarmcraft/cli-session.json`; keep this file private.
|
|
53
59
|
|
|
54
|
-
From
|
|
60
|
+
From your project's local Git repository, check your setup:
|
|
55
61
|
|
|
56
62
|
```bash
|
|
57
|
-
|
|
58
|
-
pnpm cli:check
|
|
63
|
+
swarmcraft doctor --workspace . --agent-provider codex
|
|
59
64
|
```
|
|
60
65
|
|
|
61
|
-
|
|
66
|
+
Replace `<project-id>` with an ID from the project list, then run one task:
|
|
62
67
|
|
|
63
68
|
```bash
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
swarmcraft one-shot \
|
|
70
|
+
--project <project-id> \
|
|
71
|
+
--workspace . \
|
|
72
|
+
--agent-provider codex \
|
|
73
|
+
--task-limit 1 \
|
|
74
|
+
--max-agent-requests 100 \
|
|
75
|
+
--commit-policy done
|
|
67
76
|
```
|
|
68
77
|
|
|
69
|
-
|
|
78
|
+
This prepares repository guidance and task files, runs the agent, and syncs task updates to SwarmCraft. Accepted tasks move to `done`; `--commit-policy done` creates a local commit for each completed task. Omit that option to leave changes uncommitted. Review the resulting changes before sharing them.
|
|
70
79
|
|
|
71
|
-
|
|
80
|
+
The CLI refuses a dirty workspace by default. Use `--allow-dirty` only when you intend to include existing local changes in the run. The request limit bounds agent calls, not monetary cost.
|
|
72
81
|
|
|
73
|
-
|
|
82
|
+
For preparation without running an agent:
|
|
74
83
|
|
|
75
84
|
```bash
|
|
76
|
-
swarmcraft
|
|
77
|
-
swarmcraft delegation start --user <customer-email-or-id> --reason <text> --expires-in-minutes 600
|
|
78
|
-
swarmcraft projects list --delegation <delegation-id>
|
|
79
|
-
swarmcraft discovery prepare --workspace <path>
|
|
80
|
-
swarmcraft discovery validate --workspace <path>
|
|
81
|
-
swarmcraft discovery support-bundle --workspace <path> --run <run-id>
|
|
82
|
-
swarmcraft init --project <project-id> --workspace <path> --agent-provider codex --delegation <delegation-id>
|
|
83
|
-
swarmcraft one-shot --project <project-id> --workspace <path> --agent-provider codex --delegation <delegation-id>
|
|
84
|
-
swarmcraft one-shot --project <project-id> --workspace <path> --agent-provider codex --run-id <known-run-id>
|
|
85
|
-
swarmcraft resume --run <run-id> --workspace <path> --delegation <delegation-id>
|
|
86
|
-
swarmcraft status --run <run-id> --workspace <path> --delegation <delegation-id>
|
|
87
|
-
swarmcraft delegation end --delegation <delegation-id>
|
|
85
|
+
swarmcraft init --project <project-id> --workspace . --agent-provider codex
|
|
88
86
|
```
|
|
89
87
|
|
|
90
|
-
|
|
88
|
+
`init` writes guidance and task files for review and leaves those changes uncommitted. Commit or otherwise resolve them before starting a run that requires a clean workspace. Updates preserve your edits to generated guidance and report conflicts that need attention.
|
|
89
|
+
|
|
90
|
+
## Choose an agent
|
|
91
|
+
|
|
92
|
+
- **Codex:** use `--agent-provider codex`.
|
|
93
|
+
- **GitHub Copilot:** use `--agent-provider copilot`.
|
|
94
|
+
- **SwarmCraft Managed AI:** use `--agent-provider managed` with `one-shot`. The CLI shows your credit balance and an estimated stage range before starting. If credits run out, add credits and resume the blocked run.
|
|
95
|
+
- **Custom commands and local models:** `--agent-command` overrides the provider command and supports models available through your agent, including local models. The template is executed through a shell, so use only commands you trust. Keep secrets out of command text; use `--agent-env-file` with `--agent-api-key-env-name` for provider credentials.
|
|
96
|
+
|
|
97
|
+
Codex, Copilot, and custom providers use your own provider setup and are outside the Managed AI fee.
|
|
91
98
|
|
|
92
|
-
|
|
99
|
+
## Inspect and resume work
|
|
93
100
|
|
|
94
|
-
|
|
101
|
+
Use the run ID printed by the CLI:
|
|
95
102
|
|
|
96
|
-
|
|
103
|
+
```bash
|
|
104
|
+
swarmcraft status --run <run-id> --workspace .
|
|
105
|
+
swarmcraft resume --run <run-id> --workspace .
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Run records and agent logs are stored in `.swarmcraft/runs/<run-id>/`, including `manifest.json` and the `logs/` directory. Treat these files as potentially sensitive.
|
|
109
|
+
|
|
110
|
+
If a run reached its request limit, raise the total ceiling when resuming:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
swarmcraft resume --run <run-id> --workspace . --max-agent-requests 200
|
|
114
|
+
```
|
|
97
115
|
|
|
98
|
-
|
|
116
|
+
## Other workflows
|
|
99
117
|
|
|
100
|
-
|
|
118
|
+
For local operational work, initialize Work, Automate, and Formalise skills:
|
|
101
119
|
|
|
102
|
-
|
|
120
|
+
```bash
|
|
121
|
+
swarmcraft operate init --workspace /path/to/repository --agent-provider codex
|
|
122
|
+
swarmcraft operate validate --workspace /path/to/repository
|
|
123
|
+
swarmcraft operate status --workspace /path/to/repository
|
|
124
|
+
```
|
|
103
125
|
|
|
104
|
-
|
|
126
|
+
Use `--adopt` to initialize an existing nonempty repository. Initialization previews the files and creates a local commit containing the seed changes. It preserves owner edits and does not push or run an agent. Validation and status work offline; both accept `--json`.
|
|
105
127
|
|
|
106
|
-
|
|
128
|
+
For a workspace that has completed [Deep Discovery review](https://swarmcraft.ai/docs/discover-and-plan/complete-deep-discovery), prepare and validate its package:
|
|
107
129
|
|
|
108
|
-
|
|
130
|
+
```bash
|
|
131
|
+
swarmcraft discovery prepare --workspace .
|
|
132
|
+
swarmcraft discovery validate --workspace .
|
|
133
|
+
```
|
|
109
134
|
|
|
110
|
-
|
|
135
|
+
Preparation requires reviewed discovery documents and confirmed source selections. It creates a local package and a preview of the selected content; upload requires separate consent. If review or source checks fail, correct the reported issue and prepare again.
|
|
111
136
|
|
|
112
|
-
|
|
137
|
+
## Help and troubleshooting
|
|
113
138
|
|
|
114
139
|
```bash
|
|
115
|
-
swarmcraft
|
|
116
|
-
swarmcraft one-shot --
|
|
117
|
-
swarmcraft doctor --workspace
|
|
118
|
-
swarmcraft support-bundle --run <run-id> --workspace
|
|
140
|
+
swarmcraft --help
|
|
141
|
+
swarmcraft one-shot --help
|
|
142
|
+
swarmcraft doctor --workspace . --agent-provider codex
|
|
143
|
+
swarmcraft support-bundle --run <run-id> --workspace .
|
|
119
144
|
```
|
|
120
145
|
|
|
121
|
-
|
|
146
|
+
Run `swarmcraft auth login` again if your session has expired. For Discovery diagnostics, use `swarmcraft discovery support-bundle --workspace . --run <run-id>`.
|
|
147
|
+
|
|
148
|
+
Support bundles redact credentials; Discovery bundles exclude source and package content. Review any diagnostic files before sharing them.
|
|
149
|
+
|
|
150
|
+
See the [one-shot walkthrough](https://swarmcraft.ai/docs/build-and-ship/deliver-with-the-one-shot-cli), [troubleshooting guide](https://swarmcraft.ai/docs/help-and-reference/troubleshoot-swarmcraft), or [contact support](https://swarmcraft.ai/login?next=%2Fapp%2Fsupport).
|