@feedramp/cli 0.0.0-stage → 0.5.0
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 +261 -2
- package/dist/feedramp.js +41839 -0
- package/package.json +38 -4
package/README.md
CHANGED
|
@@ -1,3 +1,262 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @feedramp/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The Feedramp command-line interface — a thin shell over the public REST API at `/api/v1`.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i -g @feedramp/cli
|
|
9
|
+
feedramp --version
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### Local development inside this repo
|
|
13
|
+
|
|
14
|
+
The repo's root `package.json` exposes a `cli` script that runs the TypeScript
|
|
15
|
+
sources directly via `tsx` — no build step required. **Run it from the repo
|
|
16
|
+
root**, not from `cli/` (the workspace package doesn't define `cli`).
|
|
17
|
+
|
|
18
|
+
**bash / zsh / sh (macOS, Linux, Git Bash, WSL):**
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm run cli -- features list --project 1 --jsonl
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**Windows CMD (`cmd.exe`):**
|
|
25
|
+
|
|
26
|
+
```bat
|
|
27
|
+
npm run cli -- features list --project 1 --jsonl
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Windows PowerShell / PowerShell 7+ (`pwsh`):** PowerShell parses bare
|
|
31
|
+
`--long` tokens as its own parameters and silently strips them *before* npm
|
|
32
|
+
sees them, so the bash form ends up running `tsx ... features list 1` with no
|
|
33
|
+
`--project` and no `--jsonl`. Pick one of these workarounds:
|
|
34
|
+
|
|
35
|
+
```powershell
|
|
36
|
+
# 1. Single-quote each `--flag` so PowerShell treats them as literal strings
|
|
37
|
+
npm run cli '--' features list '--project' 1 '--jsonl'
|
|
38
|
+
|
|
39
|
+
# 2. Use PowerShell's stop-parsing token `--%` — everything after is passed verbatim
|
|
40
|
+
npm run cli -- --% features list --project 1 --jsonl
|
|
41
|
+
|
|
42
|
+
# 3. Skip npm entirely and invoke tsx directly
|
|
43
|
+
npx tsx cli/src/index.ts features list --project 1 --jsonl
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Or run the workspace's `start` script from inside `cli/` (same PowerShell
|
|
47
|
+
quoting rules apply):
|
|
48
|
+
|
|
49
|
+
```powershell
|
|
50
|
+
cd cli
|
|
51
|
+
npm start '--' features list '--project' 1 '--jsonl'
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Quickstart
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# 1. Save an API key (uses OS keychain when available, 0600 file fallback otherwise)
|
|
58
|
+
feedramp auth login fdm_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
59
|
+
|
|
60
|
+
# 2. Verify
|
|
61
|
+
feedramp doctor
|
|
62
|
+
|
|
63
|
+
# 3. List your projects
|
|
64
|
+
feedramp projects list
|
|
65
|
+
|
|
66
|
+
# 4. Stream features as JSONL
|
|
67
|
+
feedramp features list --project 1 --jsonl
|
|
68
|
+
|
|
69
|
+
# 5. Pipe ids through a bulk op
|
|
70
|
+
feedramp features list --project 1 -q --status pending \
|
|
71
|
+
| feedramp features bulk-delete --concurrency 8
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Output formats
|
|
75
|
+
|
|
76
|
+
| Flag | Behavior |
|
|
77
|
+
| ----------- | ----------------------------------------------------- |
|
|
78
|
+
| (default) | compact text (table for arrays, key:value for objects)|
|
|
79
|
+
| `--json` | minified JSON |
|
|
80
|
+
| `--pretty` | indented JSON |
|
|
81
|
+
| `--jsonl` | one JSON object per line (streams during pagination) |
|
|
82
|
+
| `-q` | print only IDs (one per line) — pipe-friendly |
|
|
83
|
+
| `--fields` | client-side projection, e.g. `--fields displayId,votes`|
|
|
84
|
+
|
|
85
|
+
## Config layers
|
|
86
|
+
|
|
87
|
+
1. Built-in defaults (`api_url=https://feedramp.ai`)
|
|
88
|
+
2. `~/.config/feedramp/config.toml`
|
|
89
|
+
3. `./.feedramp.toml` (walks up from cwd)
|
|
90
|
+
4. `FEEDRAMP_*` env vars (`FEEDRAMP_API_URL`, `FEEDRAMP_API_KEY`, `FEEDRAMP_RUN_ID`, `FEEDRAMP_PROFILE`, `FEEDRAMP_NO_COLOR`)
|
|
91
|
+
5. CLI flags (highest precedence)
|
|
92
|
+
|
|
93
|
+
Anyone who can commit to a repository can write its `.feedramp.toml`, so that
|
|
94
|
+
file may only set `api_url`, `profile`, `run_id` and `no_color`. Its
|
|
95
|
+
`api_url` is used only when it's the server you already use, or one you've
|
|
96
|
+
trusted; otherwise the CLI ignores it, says so, and keeps sending your key to
|
|
97
|
+
your own server:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
feedramp config set trusted_api_urls https://test.feedramp.ai,http://localhost:5000
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Other keys in a project file (`cache_dir`, `api_key`, `trusted_api_urls`) are
|
|
104
|
+
ignored with a warning. `feedramp cache clear` only deletes the files the
|
|
105
|
+
cache wrote, wherever `cache_dir` points.
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
feedramp config get api_url --explain
|
|
109
|
+
# api_url="https://feedramp.ai" [env: FEEDRAMP_API_URL]
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Autonomous worker (AO-4)
|
|
113
|
+
|
|
114
|
+
`feedramp worker` runs a coding agent that takes work from a project's claim
|
|
115
|
+
queue, builds it on a `feedramp/*` branch, opens a pull request and hands the
|
|
116
|
+
build to Feedramp's verifier. Design: `docs/design/ao-4-worker.md`.
|
|
117
|
+
|
|
118
|
+
Add the worker on Feedramp's Workers page. It shows one line to paste on the
|
|
119
|
+
machine, as the user the worker should run as (PowerShell on Windows):
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
npx -y @feedramp/cli@latest worker setup --enroll 7K3M-Q9TD --name box-2-claude --api-url https://feedramp.ai
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
`worker setup` needs no admin rights. It:
|
|
126
|
+
|
|
127
|
+
1. checks git (2.31+) and the agent: Claude Code installed and signed in
|
|
128
|
+
(`claude auth status`). If something's missing it says how to fix it and
|
|
129
|
+
stops **before** using the code, so the same line works again afterwards;
|
|
130
|
+
2. trades the one-time code for the worker's key;
|
|
131
|
+
3. copies the CLI to `~/.feedramp/cli/<version>/`, so the service doesn't
|
|
132
|
+
depend on npx's cache;
|
|
133
|
+
4. runs the worker in the background as you: a systemd user service on Linux
|
|
134
|
+
(with `loginctl enable-linger`, so it keeps running after you sign out and
|
|
135
|
+
starts at boot), a LaunchAgent on macOS and a sign-in scheduled task with
|
|
136
|
+
no window on Windows (both start when you sign in, so turn on automatic
|
|
137
|
+
sign-in on a VM that restarts unattended). It restarts after a crash; a
|
|
138
|
+
clean stop stays stopped until the next boot or sign-in.
|
|
139
|
+
|
|
140
|
+
On Linux and macOS the service reads the key from the 0600 credentials file
|
|
141
|
+
(`~/.config/feedramp/credentials`): a background service can't answer a
|
|
142
|
+
keychain prompt or open a locked keyring. Windows keeps it in the Credential
|
|
143
|
+
Manager.
|
|
144
|
+
|
|
145
|
+
```sh
|
|
146
|
+
feedramp worker doctor # what's missing, in plain words, with the fix
|
|
147
|
+
feedramp worker status
|
|
148
|
+
feedramp worker stop --name box-2-claude # commit, push, release with a hand-off
|
|
149
|
+
feedramp worker setup --name box-2-claude # set the service up again (e.g. after an update)
|
|
150
|
+
feedramp worker uninstall --name box-2-claude # stop cleanly and remove the service (--forget: folder and key too)
|
|
151
|
+
feedramp worker start --name box-2-claude # or run it in the foreground; Ctrl-C stops cleanly
|
|
152
|
+
feedramp worker start --name box-2-claude --once # at most one feature
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
`worker setup --no-service` only sets the worker up, for machines without a
|
|
156
|
+
service manager (containers): run `feedramp worker start` yourself.
|
|
157
|
+
|
|
158
|
+
**Running as a separate OS user instead.** `worker install` creates a
|
|
159
|
+
dedicated user (`feedramp-<name>`) with a private home and work folder,
|
|
160
|
+
copies the config and key into that user's own 0600 credentials file, and
|
|
161
|
+
registers a system service: systemd on Linux, a LaunchDaemon on macOS, a
|
|
162
|
+
startup scheduled task on Windows. It needs root/administrator, prints the
|
|
163
|
+
plan unless you pass `--apply`, and afterwards you sign the agent in once as
|
|
164
|
+
that user. It's the safer choice on a machine that's also used for anything
|
|
165
|
+
else (see the permission mode below).
|
|
166
|
+
|
|
167
|
+
```sh
|
|
168
|
+
feedramp worker install --name box-2-claude # show the plan
|
|
169
|
+
sudo feedramp worker install --name box-2-claude --apply
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
- **Feedramp decides what the worker runs.** Its agent and models are set on
|
|
173
|
+
the Workers page and can be changed there at any time; the worker picks up
|
|
174
|
+
a change before its next feature. Pausing, rotating the key and revoking
|
|
175
|
+
happen there too; the page shows "Pausing…" / "Resuming…" until the worker
|
|
176
|
+
has checked in and seen the change (within about a minute when it's idle). If the chosen agent isn't installed or signed in, the
|
|
177
|
+
worker shows `needs_setup` (here and on the page) and takes no work.
|
|
178
|
+
- **Each worker has its own folder**, `~/.feedramp/workers/<name>/`: its
|
|
179
|
+
config, status, a lock (so it can't run twice), `work/` for checkouts and
|
|
180
|
+
`tmp/` for temporary files. Several workers can run on one machine (say a
|
|
181
|
+
Claude one and a Codex one) without touching each other's files.
|
|
182
|
+
`--own-agent-login` also gives the worker its own agent sign-in there (sign
|
|
183
|
+
in with `feedramp worker agent-login --name <name>`), e.g. for two Claude
|
|
184
|
+
accounts on one machine. Workers set up before 0.3.0 move into this layout
|
|
185
|
+
on first use.
|
|
186
|
+
- The key is in the OS credential store (0600 file fallback), never in the
|
|
187
|
+
config. Worker keys only work on the worker endpoints.
|
|
188
|
+
- Pushes use a one-hour GitHub App token Feedramp issues for the live claim.
|
|
189
|
+
It is passed to git through environment config only. The worker cancels it
|
|
190
|
+
when it finishes the feature, and Feedramp cancels it too whenever the claim
|
|
191
|
+
ends (including when a person revokes the worker's key).
|
|
192
|
+
- **The project's worker rules** come with every feature: machine git logins,
|
|
193
|
+
web access, which agent settings load, allowed MCP servers and blocked
|
|
194
|
+
commands. The worker applies them to whichever agent it runs. Define MCP
|
|
195
|
+
servers (with their secrets) in `~/.feedramp/workers/<name>/mcp.json`,
|
|
196
|
+
`{"mcpServers": {...}}`; only the ones the project allows by name are used.
|
|
197
|
+
- **Claude Code** (`--agent claude-code`) runs as `claude -p --output-format
|
|
198
|
+
stream-json` with the claim's model. The prompt goes in on stdin, only the
|
|
199
|
+
allowed MCP servers load (`--strict-mcp-config --mcp-config`), the rules
|
|
200
|
+
become deny rules in a per-run `--settings` file plus `--setting-sources`,
|
|
201
|
+
and sessions aren't saved.
|
|
202
|
+
Permission mode defaults to `bypassPermissions`: nobody is there to answer
|
|
203
|
+
Claude Code's prompts, so it doesn't ask before running commands. The
|
|
204
|
+
worker rules still apply, but the agent can reach whatever the OS user
|
|
205
|
+
running the worker can. `worker setup` runs it as you, so use a machine
|
|
206
|
+
(or a user) kept for the worker, or `feedramp worker install --name <name>`
|
|
207
|
+
for a separate OS user and service; the worker logs a warning at start when
|
|
208
|
+
an ordinary user runs it this way. `--permission-mode` changes it.
|
|
209
|
+
- **The agent gets a short list of environment variables**, not the worker's
|
|
210
|
+
whole environment: what programs need to run and find their tools (`PATH`,
|
|
211
|
+
home and temp folders, Windows system folders), language, proxies and
|
|
212
|
+
certificates, toolchain folders (`JAVA_HOME`, `NVM_DIR`...), and the
|
|
213
|
+
agent's own sign-in (`ANTHROPIC_*`, `CLAUDE_CODE_*`). Everything else (cloud
|
|
214
|
+
keys, package tokens, database URLs) stays with the worker. Pass more by
|
|
215
|
+
name with `worker setup --pass-env DATABASE_URL,AWS_*`. `FEEDRAMP_*`
|
|
216
|
+
variables never reach the agent, and git/GitHub logins only do when the
|
|
217
|
+
project's rules allow machine logins.
|
|
218
|
+
Usage limits are read from Claude Code's rate-limit events. Extra usage only
|
|
219
|
+
counts as allowed when Feedramp has approved an overage budget.
|
|
220
|
+
- Needs git 2.31 or newer and Node 22.19 or newer (Node 22 or 24 LTS).
|
|
221
|
+
- **Feedramp deploys and outages need nothing on the worker's machine.** If
|
|
222
|
+
Feedramp can't be reached (a deploy, a restart, a network blip), the worker
|
|
223
|
+
keeps asking for work with growing waits (5 s, 10 s, 20 s … up to 5 min),
|
|
224
|
+
logs once that it lost contact and once when it's back, and shows
|
|
225
|
+
`reconnecting` in `worker status`. Submits, releases, push tokens and
|
|
226
|
+
context requests in the middle of a build are retried for up to 15 minutes,
|
|
227
|
+
so finished work isn't lost to a deploy. If Feedramp turns the worker away
|
|
228
|
+
(an outdated CLI, missing permissions) it shows `refused` with the reason and
|
|
229
|
+
asks again every 5 minutes, so fixing the cause is enough.
|
|
230
|
+
- **Revoking the worker's key in Feedramp stops it for good.** At its next
|
|
231
|
+
check-in the worker stops the agent, deletes that feature's checkout, removes
|
|
232
|
+
the stored key, shows `revoked` in `worker status` and exits cleanly (exit
|
|
233
|
+
code 0, so services don't restart it). Add it again on the Workers page and
|
|
234
|
+
run the new setup command to bring it back.
|
|
235
|
+
- Services restart a worker that crashes: systemd and launchd on failure, and
|
|
236
|
+
on Windows the launcher loops after a non-zero exit (30 s pause).
|
|
237
|
+
- The worker checks in every 5 minutes, committing and pushing as it goes,
|
|
238
|
+
follows the feature's usage-limit policy (wait, hand off or pay), and
|
|
239
|
+
stops cleanly or aborts when the project is paused.
|
|
240
|
+
|
|
241
|
+
## Exit codes
|
|
242
|
+
|
|
243
|
+
| Code | Meaning |
|
|
244
|
+
| ---- | ---------------------- |
|
|
245
|
+
| 0 | success |
|
|
246
|
+
| 1 | general error |
|
|
247
|
+
| 2 | usage error |
|
|
248
|
+
| 3 | validation |
|
|
249
|
+
| 4 | not found |
|
|
250
|
+
| 5 | authentication |
|
|
251
|
+
| 6 | rate-limited |
|
|
252
|
+
| 7 | conflict/unprocessable |
|
|
253
|
+
| 8 | insufficient permissions |
|
|
254
|
+
| 9 | network |
|
|
255
|
+
| 10 | server error |
|
|
256
|
+
|
|
257
|
+
## More
|
|
258
|
+
|
|
259
|
+
- `feedramp examples` — copy-pasteable recipes (auth, create, bulk, paginate)
|
|
260
|
+
- `feedramp completion bash|zsh|fish|powershell` — shell completion scripts
|
|
261
|
+
- `feedramp openapi` — dump the cached OpenAPI spec (refreshes via ETag)
|
|
262
|
+
- `feedramp doctor` — connectivity, auth, schema cache health-check
|