@anythingai/cli 0.0.2 → 0.0.3
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 +2308 -887
- package/package.json +6 -1
- package/skills/anything-cli/SKILL.md +27 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anythingai/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
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
|