@anythingai/cli 0.0.2 → 0.1.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 +13 -0
- package/dist/js/bin.mjs +3287 -1435
- package/package.json +6 -1
- package/skills/anything-cli/SKILL.md +32 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anythingai/cli",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"homepage": "https://anything.com/",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
"registry": "https://registry.npmjs.org"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
+
"gen": "npx @hey-api/openapi-ts",
|
|
22
|
+
"gen:spec": "tsx scripts/generate-spec.mts",
|
|
23
|
+
"check:spec": "tsx scripts/check-spec.mts",
|
|
21
24
|
"build": "tsdown --no-dts --out-dir dist/js",
|
|
22
25
|
"prepublishOnly": "yarn build",
|
|
23
26
|
"test:unit": "jest --config=jest.unit.config.ts --passWithNoTests",
|
|
@@ -38,6 +41,7 @@
|
|
|
38
41
|
"@createinc/env": "^0.0.0",
|
|
39
42
|
"@createinc/flux-api": "0.0.0",
|
|
40
43
|
"@createinc/tsconfig": "0.0.0",
|
|
44
|
+
"@hey-api/openapi-ts": "^0.88.0",
|
|
41
45
|
"@jest/environment": "^30.2.0",
|
|
42
46
|
"@swc/core": "^1.9.3",
|
|
43
47
|
"@swc/jest": "^0.2.37",
|
|
@@ -51,6 +55,7 @@
|
|
|
51
55
|
"reflect-metadata": "^0.2.2",
|
|
52
56
|
"testcontainers": "^10.18.0",
|
|
53
57
|
"tsdown": "^0.20.3",
|
|
58
|
+
"tsx": "^4.21.0",
|
|
54
59
|
"typescript": "^5.9.3"
|
|
55
60
|
},
|
|
56
61
|
"engines": {
|
|
@@ -56,13 +56,36 @@ anything projects get <project-id> --json
|
|
|
56
56
|
anything projects publish <project-id> --json # waits for deploy
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
+
## Async Generation (recommended for agents)
|
|
60
|
+
|
|
61
|
+
The default `--wait` mode uses WebSocket subscriptions which can be unreliable. Use `--no-wait` and poll `projects status` for a robust HTTP-only alternative:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Start generation (returns immediately)
|
|
65
|
+
REVISION=$(anything projects generate <id> --prompt "..." --no-wait --quiet)
|
|
66
|
+
|
|
67
|
+
# Poll until terminal state (VALID or INVALID)
|
|
68
|
+
while true; do
|
|
69
|
+
STATUS=$(anything projects status <id> --json | jq -r '.data.status')
|
|
70
|
+
case "$STATUS" in
|
|
71
|
+
VALID) echo "Done"; break ;;
|
|
72
|
+
INVALID) echo "Failed"; break ;;
|
|
73
|
+
INVALID_PROMPT) echo "Bad prompt"; break ;;
|
|
74
|
+
*) sleep 5 ;;
|
|
75
|
+
esac
|
|
76
|
+
done
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Terminal statuses: `VALID` (success), `INVALID` (generation failed), `INVALID_PROMPT` (bad prompt).
|
|
80
|
+
Non-terminal: `CREATED`, `BUILDING`.
|
|
81
|
+
|
|
59
82
|
## One-Shot Workflow
|
|
60
83
|
|
|
61
84
|
```bash
|
|
62
85
|
anything ship --prompt "Build a todo app with auth" --json
|
|
63
86
|
```
|
|
64
87
|
|
|
65
|
-
The `ship` command creates (or generates on existing), then publishes and waits for the deployment to finish. It streams progress as NDJSON in `--json` mode, or `[init]`/`[progress]`/`[done]` markers in text mode.
|
|
88
|
+
The `ship` command creates (or generates on existing), then publishes and waits for the deployment to finish. It streams progress as NDJSON in `--json` mode, or `[init]`/`[progress]`/`[done]` markers in text mode. `--no-wait` only skips waiting for the deployment to finish — generation still blocks via WebSocket. If you want fully HTTP-only async behavior, use the two-step `projects generate --no-wait` + `projects publish` pattern above instead.
|
|
66
89
|
|
|
67
90
|
```bash
|
|
68
91
|
anything ship --project pg_123 --prompt "Add a settings page" --json
|
|
@@ -93,6 +116,8 @@ anything switch # interactive org/project pic
|
|
|
93
116
|
anything llm-context --json # combined agent context
|
|
94
117
|
anything introspect # full command tree as JSON
|
|
95
118
|
anything skill # print SKILL.md
|
|
119
|
+
anything update --check --json # is a newer CLI version available?
|
|
120
|
+
anything update --json # self-update to the latest version
|
|
96
121
|
```
|
|
97
122
|
|
|
98
123
|
### Project creation and iteration
|
|
@@ -101,7 +126,7 @@ anything skill # print SKILL.md
|
|
|
101
126
|
anything projects create --org <org-id> --prompt "<prompt>" --json
|
|
102
127
|
anything projects generate <project-id> --prompt "<prompt>" --json
|
|
103
128
|
anything projects messages <project-id> --limit 20 --json
|
|
104
|
-
anything projects get <project-id> --json
|
|
129
|
+
anything projects get <project-id> --json # `data.files[]` lists modules with `path`/`pathSegment`
|
|
105
130
|
anything projects files list <project-id> --json
|
|
106
131
|
anything projects files get <project-id> app/page.tsx --json
|
|
107
132
|
anything projects rename <project-id> --name "New Name" --json
|
|
@@ -133,9 +158,10 @@ anything domains verify dom_123 --json
|
|
|
133
158
|
```bash
|
|
134
159
|
anything databases list --org <org-id> --json
|
|
135
160
|
anything databases get <database-id> --json
|
|
136
|
-
anything databases create --project pg_123 --json
|
|
161
|
+
anything databases create --project pg_123 --name "My Database" --json
|
|
137
162
|
anything databases query <database-id> "SELECT * FROM users LIMIT 5" --json
|
|
138
163
|
anything databases connect <database-id>
|
|
164
|
+
anything databases connect <database-id> --mask # redact the password
|
|
139
165
|
anything databases reset <database-id> --yes --json
|
|
140
166
|
```
|
|
141
167
|
|
|
@@ -214,9 +240,11 @@ anything projects create --dry-run --org org_1 --prompt "test" --json
|
|
|
214
240
|
|
|
215
241
|
anything projects generate pg_123 --dry-run --prompt "Add auth" --json
|
|
216
242
|
anything projects rename pg_123 --dry-run --name "New Name" --json
|
|
217
|
-
anything databases create --dry-run --project pg_123 --json
|
|
243
|
+
anything databases create --dry-run --project pg_123 --name "My Database" --json
|
|
218
244
|
anything domains add app.example.com --dry-run --project pg_123 --json
|
|
219
245
|
anything deployments rollback pg_123 --dry-run --json
|
|
246
|
+
anything projects submit pg_123 --store app-store --dry-run --json
|
|
247
|
+
anything projects settings auth set pg_123 --provider google --enabled --dry-run --json
|
|
220
248
|
```
|
|
221
249
|
|
|
222
250
|
## Failure Handling
|