@ted-galago/wave-cli 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 +135 -0
- package/dist/index.cjs +1079 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1078 -0
- package/package.json +30 -0
package/README.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# @wave/cli
|
|
2
|
+
|
|
3
|
+
Machine-first CLI used by a Node LangGraph agent to execute semantic Wave operations against the Rails API.
|
|
4
|
+
|
|
5
|
+
See also:
|
|
6
|
+
|
|
7
|
+
- `./.env.example`
|
|
8
|
+
- `./docs/ENVIRONMENT_CONTRACT_CHECKLIST.md`
|
|
9
|
+
|
|
10
|
+
## Principles
|
|
11
|
+
|
|
12
|
+
- `stdout` emits exactly one JSON envelope.
|
|
13
|
+
- `stderr` is for debug/diagnostic logs only.
|
|
14
|
+
- No prompts, colors, or interactive UX.
|
|
15
|
+
- JWT forwarding is centralized.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install @wave/cli
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Or run locally:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm run dev -- tasks list --project-id 123 --organization-id 42 --base-url https://api.example.com --token token
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Runtime Contract
|
|
30
|
+
|
|
31
|
+
Required env:
|
|
32
|
+
|
|
33
|
+
- `WAVE_API_TOKEN`
|
|
34
|
+
- `WAVE_API_BASE_URL`
|
|
35
|
+
- `WAVE_ORGANIZATION_ID`
|
|
36
|
+
|
|
37
|
+
Optional env:
|
|
38
|
+
|
|
39
|
+
- `WAVE_AGENT_NAME`
|
|
40
|
+
- `WAVE_AGENT_RUN_ID`
|
|
41
|
+
- `WAVE_REQUEST_ID`
|
|
42
|
+
- `WAVE_TIMEOUT_MS`
|
|
43
|
+
- `WAVE_DEBUG`
|
|
44
|
+
- `WAVE_OPENAPI_PATH` (local contract file, e.g. `openapi/wave-cli.yaml`)
|
|
45
|
+
- `WAVE_OPENAPI_URL` (hosted contract file)
|
|
46
|
+
- `WAVE_OPENAPI_VERSION` (pinned spec version/hash)
|
|
47
|
+
|
|
48
|
+
Flag precedence:
|
|
49
|
+
|
|
50
|
+
- auth: `WAVE_API_TOKEN`, then `WAVE_JWT` (legacy), then `--token`, then `--jwt` (legacy)
|
|
51
|
+
- base URL: `--base-url`, then `WAVE_API_BASE_URL`, then `WAVE_API_URL` (legacy)
|
|
52
|
+
- organization: `WAVE_ORGANIZATION_ID`, then `WAVE_ORG_ID` (legacy), then `--organization-id`
|
|
53
|
+
|
|
54
|
+
## Commands
|
|
55
|
+
|
|
56
|
+
Examples:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
wave tasks list --project-id 123
|
|
60
|
+
wave tasks create --project-id 123 --title "Fix auth bug"
|
|
61
|
+
wave tasks update --id 99 --status in_progress
|
|
62
|
+
wave projects list
|
|
63
|
+
wave projects show --id 123
|
|
64
|
+
wave rocks update-status --id 55 --status on_track
|
|
65
|
+
wave meetings show --id 77
|
|
66
|
+
wave members show --id 44
|
|
67
|
+
wave meetings notes --id 77 --content "Decisions captured"
|
|
68
|
+
wave issues create --issue-group-id 321 --name "Auth issue" --issue-type short_term
|
|
69
|
+
wave lists create --data-json '{"name":"Weekly List"}'
|
|
70
|
+
wave list-items create --data-json '{"list_id":"123","summary":"Follow up"}'
|
|
71
|
+
wave todos create --data-json '{"todo_group_id":"55","name":"Send update"}'
|
|
72
|
+
wave knowledge create --data-json '{"title":"Runbook","content":"..."}'
|
|
73
|
+
wave pulse update --id 12 --data-json '{"status":"on_track"}'
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
All commands require organization context via `--organization-id` or `WAVE_ORGANIZATION_ID`.
|
|
77
|
+
|
|
78
|
+
## Parent-Child Create Rules
|
|
79
|
+
|
|
80
|
+
These child resources enforce parent IDs at CLI validation time:
|
|
81
|
+
|
|
82
|
+
- `list-items.create` requires `list_id`
|
|
83
|
+
- `issues.create` requires `issue_group_id`
|
|
84
|
+
- `todos.create` requires `todo_group_id`
|
|
85
|
+
- `rocks.create` requires `rock_collection_id`
|
|
86
|
+
- `scorecards.create` requires `measurable_group_id`
|
|
87
|
+
|
|
88
|
+
If a required parent field is missing, CLI returns JSON error with exit code `2`.
|
|
89
|
+
|
|
90
|
+
## JSON Envelope
|
|
91
|
+
|
|
92
|
+
Success:
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"ok": true,
|
|
97
|
+
"command": "tasks.list",
|
|
98
|
+
"status": 200,
|
|
99
|
+
"data": {},
|
|
100
|
+
"error": null,
|
|
101
|
+
"meta": {
|
|
102
|
+
"requestId": "req_123"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Failure:
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"ok": false,
|
|
112
|
+
"command": "tasks.create",
|
|
113
|
+
"status": 403,
|
|
114
|
+
"data": null,
|
|
115
|
+
"error": {
|
|
116
|
+
"code": "forbidden",
|
|
117
|
+
"message": "Forbidden",
|
|
118
|
+
"details": {}
|
|
119
|
+
},
|
|
120
|
+
"meta": {
|
|
121
|
+
"requestId": "req_124"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Exit Codes
|
|
127
|
+
|
|
128
|
+
- `0`: success
|
|
129
|
+
- `1`: generic uncaught error
|
|
130
|
+
- `2`: invalid args/config
|
|
131
|
+
- `3`: missing or invalid auth
|
|
132
|
+
- `4`: forbidden
|
|
133
|
+
- `5`: not found
|
|
134
|
+
- `6`: validation failure
|
|
135
|
+
- `7`: network or upstream error
|