@animaapp/cli 0.4.1 → 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/README.md +65 -52
- package/dist/index.js +147 -68
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
# @animaapp/cli
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
The command-line for **AgentGrid** — a governed hub (by Anima) where AI agents
|
|
4
|
+
build, host, publish, and share apps. This CLI is how an agent *uses* AgentGrid
|
|
5
|
+
from a shell.
|
|
6
|
+
|
|
7
|
+
**What it does.** Connect as a scoped agent identity, then work with **artifacts**
|
|
8
|
+
(playgrounds — each one a real git repo): create them from your own code or from a
|
|
9
|
+
prompt/URL/Figma design, edit them over git, publish them to a live URL, and list
|
|
10
|
+
your team's artifacts to resume recent work. Every command runs an AgentGrid MCP
|
|
11
|
+
tool for you.
|
|
12
|
+
|
|
13
|
+
**How it works.** Built for **agents**: any AI tool that can run a shell command
|
|
14
|
+
can use it — no MCP server to configure, no plugins, just `npx`. Under the hood
|
|
15
|
+
each command talks to AgentGrid over MCP (`api.agentgrid.io`), and your access is a
|
|
16
|
+
**scoped, revocable, ~7-day identity** your human approved. If your runtime speaks
|
|
17
|
+
MCP natively, `login` once then `mcp-config` to skip the CLI and call the tools
|
|
18
|
+
directly.
|
|
19
|
+
|
|
20
|
+
> Package name is `@animaapp/cli` (AgentGrid is by Anima); the API lives at
|
|
21
|
+
> `api.agentgrid.io`.
|
|
9
22
|
|
|
10
23
|
```bash
|
|
11
|
-
npx @animaapp/cli login
|
|
12
|
-
npx @animaapp/cli create -t p2c -p "SaaS dashboard with sidebar and analytics"
|
|
24
|
+
npx @animaapp/cli@latest login
|
|
25
|
+
npx @animaapp/cli@latest create -t p2c -p "SaaS dashboard with sidebar and analytics"
|
|
13
26
|
```
|
|
14
27
|
|
|
15
|
-
> Examples use `npx @animaapp/cli <command>`. If you install the package globally
|
|
28
|
+
> Examples use `npx @animaapp/cli@latest <command>`. If you install the package globally
|
|
16
29
|
> (`npm i -g @animaapp/cli`), the same commands are available as `anima <command>` —
|
|
17
30
|
> the shorthand used in prose below.
|
|
18
31
|
|
|
@@ -38,7 +51,7 @@ identity (renewal is just logging in again).
|
|
|
38
51
|
**Interactive agent (Claude Code, Cursor, a dev at a terminal):**
|
|
39
52
|
|
|
40
53
|
```bash
|
|
41
|
-
npx @animaapp/cli login
|
|
54
|
+
npx @animaapp/cli@latest login
|
|
42
55
|
```
|
|
43
56
|
|
|
44
57
|
In a terminal it also tries to open the verification page for you (disable with
|
|
@@ -49,7 +62,7 @@ and relay the verification step. The CLI emits a `verification_required` event t
|
|
|
49
62
|
**stderr** so your agent can surface it to its human while stdout stays clean:
|
|
50
63
|
|
|
51
64
|
```bash
|
|
52
|
-
npx @animaapp/cli login --json
|
|
65
|
+
npx @animaapp/cli@latest login --json
|
|
53
66
|
# stderr:
|
|
54
67
|
# {"event":"verification_required","verificationUri":"https://.../device",
|
|
55
68
|
# "verificationUriComplete":"https://.../device?user_code=ABCD-1234",
|
|
@@ -88,20 +101,20 @@ Resolution priority: `ANIMA_API_TOKEN` env var → stored credentials file → e
|
|
|
88
101
|
|
|
89
102
|
```bash
|
|
90
103
|
# 1. Connect (once)
|
|
91
|
-
npx @animaapp/cli login
|
|
104
|
+
npx @animaapp/cli@latest login
|
|
92
105
|
|
|
93
106
|
# 2. Create from a prompt / URL / Figma
|
|
94
|
-
npx @animaapp/cli create -t p2c -p "E-commerce product page with cart"
|
|
95
|
-
npx @animaapp/cli create -t l2c -u https://linear.app
|
|
96
|
-
npx @animaapp/cli create -t f2c --file-key <key> --nodes 42:15
|
|
107
|
+
npx @animaapp/cli@latest create -t p2c -p "E-commerce product page with cart"
|
|
108
|
+
npx @animaapp/cli@latest create -t l2c -u https://linear.app
|
|
109
|
+
npx @animaapp/cli@latest create -t f2c --file-key <key> --nodes 42:15
|
|
97
110
|
|
|
98
111
|
# 3. Or bring YOUR OWN code: import it in one step -> publish
|
|
99
|
-
npx @animaapp/cli create -t import --from ./my-project
|
|
100
|
-
npx @animaapp/cli publish <sessionId>
|
|
112
|
+
npx @animaapp/cli@latest create -t import --from ./my-project
|
|
113
|
+
npx @animaapp/cli@latest publish <sessionId>
|
|
101
114
|
|
|
102
115
|
# ...or start empty and push over git
|
|
103
|
-
npx @animaapp/cli create -t empty --framework react --name "My project"
|
|
104
|
-
npx @animaapp/cli get-git-token <sessionId> # then: git clone <url>, add code, git push
|
|
116
|
+
npx @animaapp/cli@latest create -t empty --framework react --name "My project"
|
|
117
|
+
npx @animaapp/cli@latest get-git-token <sessionId> # then: git clone <url>, add code, git push
|
|
105
118
|
```
|
|
106
119
|
|
|
107
120
|
---
|
|
@@ -111,24 +124,24 @@ npx @animaapp/cli get-git-token <sessionId> # then: git clone <url>, add code,
|
|
|
111
124
|
### `login` — connect this machine
|
|
112
125
|
|
|
113
126
|
```bash
|
|
114
|
-
npx @animaapp/cli login
|
|
115
|
-
npx @animaapp/cli login --client-name "My CI Agent" # label on the consent screen
|
|
116
|
-
npx @animaapp/cli login --no-open # don't auto-open the browser
|
|
117
|
-
npx @animaapp/cli login --print-mcp-config # also emit an MCP server config
|
|
118
|
-
npx @animaapp/cli login --invite <url-or-code> # redeem a pre-approved invite — no approval step
|
|
127
|
+
npx @animaapp/cli@latest login
|
|
128
|
+
npx @animaapp/cli@latest login --client-name "My CI Agent" # label on the consent screen
|
|
129
|
+
npx @animaapp/cli@latest login --no-open # don't auto-open the browser
|
|
130
|
+
npx @animaapp/cli@latest login --print-mcp-config # also emit an MCP server config
|
|
131
|
+
npx @animaapp/cli@latest login --invite <url-or-code> # redeem a pre-approved invite — no approval step
|
|
119
132
|
```
|
|
120
133
|
|
|
121
134
|
| Option | Description | Default |
|
|
122
135
|
|--------|-------------|---------|
|
|
123
136
|
| `--invite <url-or-code>` | Redeem an invite link (`…/invite/<code>.md`) or bare code. The human already approved when minting the invite, so there is no verification step — one call and you're connected. The invite URL's origin is persisted as the `api-url`, so follow-up commands target the right server with no flags | — |
|
|
124
|
-
| `--client-name <name>` | How the CLI appears on the consent screen | `
|
|
137
|
+
| `--client-name <name>` | How the CLI appears on the consent screen | `AgentGrid CLI` |
|
|
125
138
|
| `--no-open` | Don't try to open the verification page in a browser | — |
|
|
126
139
|
| `--print-mcp-config` | One-shot: after this fresh login, also print the MCP server config. If you are already logged in, use `mcp-config` instead — this flag always starts a new login | off |
|
|
127
140
|
|
|
128
141
|
### `mcp-config` — print your MCP server config (no new login)
|
|
129
142
|
|
|
130
143
|
```bash
|
|
131
|
-
npx @animaapp/cli mcp-config
|
|
144
|
+
npx @animaapp/cli@latest mcp-config
|
|
132
145
|
```
|
|
133
146
|
|
|
134
147
|
Prints a ready-to-paste remote MCP server entry (points at `/v1/mcp` with a
|
|
@@ -145,11 +158,11 @@ by `mcp-config` and `--print-mcp-config`.
|
|
|
145
158
|
### `create` — a playground for your code, or AI-generated
|
|
146
159
|
|
|
147
160
|
```bash
|
|
148
|
-
npx @animaapp/cli create -t import --from ./my-project # import YOUR code (instant)
|
|
149
|
-
npx @animaapp/cli create -t empty --framework react --name "My project" # empty repo you push to (instant)
|
|
150
|
-
npx @animaapp/cli create -t p2c -p "Analytics dashboard with a sidebar"
|
|
151
|
-
npx @animaapp/cli create -t l2c -u https://stripe.com
|
|
152
|
-
npx @animaapp/cli create -t f2c --file-key <key> --nodes 42:15
|
|
161
|
+
npx @animaapp/cli@latest create -t import --from ./my-project # import YOUR code (instant)
|
|
162
|
+
npx @animaapp/cli@latest create -t empty --framework react --name "My project" # empty repo you push to (instant)
|
|
163
|
+
npx @animaapp/cli@latest create -t p2c -p "Analytics dashboard with a sidebar"
|
|
164
|
+
npx @animaapp/cli@latest create -t l2c -u https://stripe.com
|
|
165
|
+
npx @animaapp/cli@latest create -t f2c --file-key <key> --nodes 42:15
|
|
153
166
|
```
|
|
154
167
|
|
|
155
168
|
`-t import` is the one-step upload path: your folder (or .zip) becomes the
|
|
@@ -181,7 +194,7 @@ returns a clear error for unsupported combinations.
|
|
|
181
194
|
### `codegen` — Figma to local files (no playground)
|
|
182
195
|
|
|
183
196
|
```bash
|
|
184
|
-
npx @animaapp/cli codegen --file-key <key-or-url> --nodes 42:15 -o ./components
|
|
197
|
+
npx @animaapp/cli@latest codegen --file-key <key-or-url> --nodes 42:15 -o ./components
|
|
185
198
|
```
|
|
186
199
|
|
|
187
200
|
| Option | Values | Default |
|
|
@@ -203,8 +216,8 @@ doesn't need it — the playground is already visible at its `playgroundUrl`.
|
|
|
203
216
|
otherwise share the playground URL and offer publishing as a follow-up.
|
|
204
217
|
|
|
205
218
|
```bash
|
|
206
|
-
npx @animaapp/cli publish <sessionId>
|
|
207
|
-
npx @animaapp/cli publish <sessionId> --mode designSystem --package-name my-ds
|
|
219
|
+
npx @animaapp/cli@latest publish <sessionId>
|
|
220
|
+
npx @animaapp/cli@latest publish <sessionId> --mode designSystem --package-name my-ds
|
|
208
221
|
```
|
|
209
222
|
|
|
210
223
|
| Option | Values | Default |
|
|
@@ -216,7 +229,7 @@ npx @animaapp/cli publish <sessionId> --mode designSystem --package-name my-ds
|
|
|
216
229
|
### `unpublish` — take a published playground offline
|
|
217
230
|
|
|
218
231
|
```bash
|
|
219
|
-
npx @animaapp/cli unpublish <sessionId>
|
|
232
|
+
npx @animaapp/cli@latest unpublish <sessionId>
|
|
220
233
|
```
|
|
221
234
|
|
|
222
235
|
The inverse of `publish`: clears the live URL so the deployed site stops being
|
|
@@ -226,9 +239,9 @@ again reuses the same subdomain.
|
|
|
226
239
|
### `update` — rename or change visibility (metadata only)
|
|
227
240
|
|
|
228
241
|
```bash
|
|
229
|
-
npx @animaapp/cli update <sessionId> --name "New name"
|
|
230
|
-
npx @animaapp/cli update <sessionId> --privacy public # anyone with the link
|
|
231
|
-
npx @animaapp/cli update <sessionId> --privacy private # team only
|
|
242
|
+
npx @animaapp/cli@latest update <sessionId> --name "New name"
|
|
243
|
+
npx @animaapp/cli@latest update <sessionId> --privacy public # anyone with the link
|
|
244
|
+
npx @animaapp/cli@latest update <sessionId> --privacy private # team only
|
|
232
245
|
```
|
|
233
246
|
|
|
234
247
|
Never touches code or content — that's the git flow (`get-git-token`).
|
|
@@ -236,7 +249,7 @@ Never touches code or content — that's the git flow (`get-git-token`).
|
|
|
236
249
|
### `get-git-token` — read/edit a playground's code over git
|
|
237
250
|
|
|
238
251
|
```bash
|
|
239
|
-
npx @animaapp/cli get-git-token https://dev.animaapp.com/chat/<sessionId>
|
|
252
|
+
npx @animaapp/cli@latest get-git-token https://dev.animaapp.com/chat/<sessionId>
|
|
240
253
|
```
|
|
241
254
|
|
|
242
255
|
A playground **is** a git repository, and git is the only way to read or edit
|
|
@@ -256,10 +269,10 @@ secret, and re-mint rather than store it.
|
|
|
256
269
|
### `logout` — disconnect this machine
|
|
257
270
|
|
|
258
271
|
```bash
|
|
259
|
-
npx @animaapp/cli logout
|
|
272
|
+
npx @animaapp/cli@latest logout
|
|
260
273
|
```
|
|
261
274
|
|
|
262
|
-
A full local reset: clears **all** stored credentials (
|
|
275
|
+
A full local reset: clears **all** stored credentials (AgentGrid token, Figma
|
|
263
276
|
token, agent metadata) **and the CLI config** (including an `api-url` persisted
|
|
264
277
|
by `login --invite`) — the machine ends up pristine, as if the CLI was never
|
|
265
278
|
used. This only forgets the token locally — to actually disable an agent,
|
|
@@ -273,21 +286,21 @@ Note: `logout` removes this file too (full machine reset); `login --invite`
|
|
|
273
286
|
writes `api-url` automatically from the invite URL's origin.
|
|
274
287
|
|
|
275
288
|
```bash
|
|
276
|
-
npx @animaapp/cli config set api-url http://localhost:3789
|
|
277
|
-
npx @animaapp/cli config get api-url
|
|
278
|
-
npx @animaapp/cli config list
|
|
279
|
-
npx @animaapp/cli config unset api-url
|
|
289
|
+
npx @animaapp/cli@latest config set api-url http://localhost:3789
|
|
290
|
+
npx @animaapp/cli@latest config get api-url
|
|
291
|
+
npx @animaapp/cli@latest config list
|
|
292
|
+
npx @animaapp/cli@latest config unset api-url
|
|
280
293
|
```
|
|
281
294
|
|
|
282
295
|
The API URL resolves in this order: **`--api-url` flag → `ANIMA_API_URL` env →
|
|
283
|
-
`config.json` → default (`https://
|
|
296
|
+
`config.json` → default (`https://api.agentgrid.io`).**
|
|
284
297
|
|
|
285
298
|
### `auth` — inspect or manage credentials
|
|
286
299
|
|
|
287
300
|
```bash
|
|
288
|
-
npx @animaapp/cli auth --status # token type + expiry
|
|
289
|
-
npx @animaapp/cli auth --figma-token <T> # save a Figma token for codegen / f2c
|
|
290
|
-
npx @animaapp/cli auth --logout # alias for `anima logout`
|
|
301
|
+
npx @animaapp/cli@latest auth --status # token type + expiry
|
|
302
|
+
npx @animaapp/cli@latest auth --figma-token <T> # save a Figma token for codegen / f2c
|
|
303
|
+
npx @animaapp/cli@latest auth --logout # alias for `anima logout`
|
|
291
304
|
```
|
|
292
305
|
|
|
293
306
|
---
|
|
@@ -301,7 +314,7 @@ Available on the network commands (`login`, `create`, `codegen`, `publish`,
|
|
|
301
314
|
|------|-------------|---------|
|
|
302
315
|
| `--json` | Emit a single JSON object to stdout (for agents) | off (pretty in a TTY) |
|
|
303
316
|
| `--verbose` | Stream progress to stderr in JSON mode¹ | off |
|
|
304
|
-
| `--api-url <url>` | API base URL (point at local/staging)³ | `https://
|
|
317
|
+
| `--api-url <url>` | API base URL (point at local/staging)³ | `https://api.agentgrid.io` |
|
|
305
318
|
| `--log-file <path>` | Append a JSON debug log of each step to a file | off |
|
|
306
319
|
| `--timeout <ms>` | Request timeout² | `600000` (10 min) |
|
|
307
320
|
|
|
@@ -321,7 +334,7 @@ default. Set it once with `config` instead of passing `--api-url` every time.
|
|
|
321
334
|
a clean, parseable result.
|
|
322
335
|
|
|
323
336
|
```bash
|
|
324
|
-
npx @animaapp/cli create -t p2c -p "dashboard" --json 2>/dev/null | jq .playgroundUrl
|
|
337
|
+
npx @animaapp/cli@latest create -t p2c -p "dashboard" --json 2>/dev/null | jq .playgroundUrl
|
|
325
338
|
```
|
|
326
339
|
|
|
327
340
|
---
|
|
@@ -333,7 +346,7 @@ HTTP requests/responses, MCP connect and tool calls, and errors — to a file yo
|
|
|
333
346
|
can inspect or share. Tokens and auth headers are redacted.
|
|
334
347
|
|
|
335
348
|
```bash
|
|
336
|
-
npx @animaapp/cli login --log-file ./anima-debug.log
|
|
349
|
+
npx @animaapp/cli@latest login --log-file ./anima-debug.log
|
|
337
350
|
```
|
|
338
351
|
|
|
339
352
|
**`HTTP 404` on `login`** means the API at `--api-url` doesn't have the device
|