@oozou/velocity 0.1.2 → 0.1.4

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/AGENT.md ADDED
@@ -0,0 +1,210 @@
1
+ # Velocity CLI — Agent Reference
2
+
3
+ You are operating the `velocity` CLI. This file is the contract — every
4
+ flag, output shape, and failure mode you need is here. If a behavior
5
+ isn't documented below, run `velocity <subcommand> --help` first; don't
6
+ guess.
7
+
8
+ ## Output contract
9
+
10
+ - Mode is **autodetected from TTY**: a non-TTY stdout (i.e. anything
11
+ an agent captures — pipes, subprocess stdout, redirects) gets JSON
12
+ by default. You usually don't need `--json` explicitly.
13
+ - **Pass `--json` anyway** if you want to be defensive against agent
14
+ runtimes that allocate a pty for the subprocess. Cheap insurance.
15
+ - Under JSON mode stdout is exactly one JSON value per command, schema
16
+ stable. Errors print `{"error":"<message>"}` on stderr and exit
17
+ non-zero. Always check the exit code.
18
+ - Don't parse the human view — it's tables and prose, not stable.
19
+
20
+ ## Authentication
21
+
22
+ The CLI must be authenticated before any non-`auth` command. Three ways:
23
+
24
+ 1. `velocity auth login` — opens a browser. Interactive only.
25
+ 2. `VELOCITY_TOKEN=<vel_…>` env var — for headless/CI/agent-runner
26
+ environments. Token is a regular Velocity API token (Settings →
27
+ API Tokens in the web app).
28
+ 3. A previously written credentials file from a prior `auth login`
29
+ (lives at `~/.config/velocity/credentials.json`, mode `0600`).
30
+
31
+ To check: `velocity auth status` returns
32
+ `{"authenticated": true|false, ...}`. If `false`, ask the user to run
33
+ `velocity auth login` — never try to prompt for credentials yourself.
34
+
35
+ `velocity whoami` is the lighter probe: `{authenticated, user}`.
36
+
37
+ ## Project context
38
+
39
+ Most commands operate on a single project. Resolution order:
40
+
41
+ 1. `--project <slug-or-id>` flag on the command.
42
+ 2. `VELOCITY_PROJECT` env var.
43
+ 3. The persisted active project (set by `velocity projects use <slug>`).
44
+
45
+ Projects accept either a slug (`acme-website`) or a Convex `_id`. Slugs
46
+ are returned by `velocity projects list` and are the preferred form.
47
+
48
+ If no project is resolvable the command exits non-zero with
49
+ `{"error":"No project selected..."}`. List options with
50
+ `velocity projects list` and either pass `--project <slug>` or set
51
+ the active project once with `velocity projects use <slug>`.
52
+
53
+ ## Commands
54
+
55
+ All commands send/receive JSON. Examples below assume an authenticated
56
+ session and an active project where relevant.
57
+
58
+ ### Discovery
59
+
60
+ ```
61
+ velocity whoami # → { authenticated, user }
62
+ velocity projects list # → [{_id, slug, name, isActive, client}]
63
+ velocity projects get <slug-or-id> # → full project record
64
+ velocity projects current # → {env, projectId}
65
+ velocity members # → [{_id, name, email, role}]
66
+ velocity stats # → {totals, statusBreakdown, ...}
67
+ velocity activity --limit 20 # → [{type, actor, target, at}]
68
+ ```
69
+
70
+ ### Stories
71
+
72
+ Stories are identified by their globally-unique `number` (an integer like
73
+ `10634`). Use that, not the Convex `_id`.
74
+
75
+ ```
76
+ velocity stories list # → [{_id, number, title, status, priority, type}]
77
+ velocity stories get <number> # → full story (includes assignee, sprint, parent, children)
78
+ velocity stories create \
79
+ --title "Title" \
80
+ --type feature|bug|chore \
81
+ --status <stage> \
82
+ --priority urgent|high|medium|low \
83
+ [--description "..." | --description-file <path> | --description-stdin] \
84
+ [--assignee <userId>] [--sprint <sprintId>] [--release <releaseId>] \
85
+ [--parent <storyId>] [--points <num>] \
86
+ [--complexity none|low|medium|high]
87
+ # → { _id, number, projectId, ... }
88
+
89
+ velocity stories update <number> [same flags as create, all optional;
90
+ pass "null" to clear a relation]
91
+ velocity stories delete <number> # → { status: "ok" }
92
+ ```
93
+
94
+ Valid `--status` values come from the project's configured stages
95
+ (typically `backlog`, `in_progress`, `done`, etc.). On invalid status
96
+ the server returns 400 — read the `error` field for the allowed list.
97
+
98
+ ### Sprints
99
+
100
+ ```
101
+ velocity sprints list # → [{_id, name, startDate, endDate, status}]
102
+ velocity sprints active # → {sprint, stories, totalPoints, donePoints}
103
+ velocity sprints get <sprintId> # → full sprint record + stories
104
+ velocity sprints stories <sprintId> # → [stories assigned to this sprint]
105
+ ```
106
+
107
+ ### Releases
108
+
109
+ ```
110
+ velocity releases list [--include-archived] # → [{_id, name, version, status, targetDate}]
111
+ velocity releases get <releaseId> # → full release + grouped changelog
112
+ velocity releases create \
113
+ --name "v1.2 Launch" \
114
+ --target-date 2026-06-30 \
115
+ [--version 1.2.0] \
116
+ [--description "..." | --description-file <path> | --description-stdin]
117
+ # → { _id, ... }
118
+
119
+ velocity releases update <releaseId> [same flags, all optional]
120
+ velocity releases status <releaseId> planned|in_progress|released|archived
121
+ velocity releases assign <storyNumber> <releaseId>
122
+ velocity releases unassign <storyNumber>
123
+ ```
124
+
125
+ Setting status to `released` or `archived` locks the release — further
126
+ edits are rejected.
127
+
128
+ ### Comments
129
+
130
+ Comments attach to a story (by story number).
131
+
132
+ ```
133
+ velocity comments list <storyNumber> # → [{_id, body, user, _creationTime}]
134
+ velocity comments add <storyNumber> "body"
135
+ velocity comments add <storyNumber> --file ./comment.md
136
+ velocity comments add <storyNumber> --stdin < comment.md
137
+ ```
138
+
139
+ ### Notes
140
+
141
+ ```
142
+ velocity notes list # → [{_id, title, updatedAt}]
143
+ velocity notes get <noteId> # → full note + content (markdown)
144
+ velocity notes create \
145
+ --title "Title" \
146
+ [--content "..." | --file <path> | --stdin]
147
+ velocity notes update <noteId> [--title "..."] \
148
+ [--content "..." | --file <path> | --stdin]
149
+ velocity notes delete <noteId> # → { status: "ok" }
150
+ ```
151
+
152
+ ### Todos
153
+
154
+ ```
155
+ velocity todos list # → [{_id, title, priority, dueDate, done}]
156
+ velocity todos create \
157
+ --title "Title" \
158
+ [--priority urgent|high|medium|low] \
159
+ [--due-date 2026-06-15] [--assignee <userId>]
160
+ velocity todos update <todoId> [--title "..."] \
161
+ [--priority ...] [--due-date <yyyy-mm-dd> | --due-date null] \
162
+ [--assignee <userId> | --assignee null] \
163
+ [--done]
164
+ velocity todos delete <todoId> # → { status: "ok" }
165
+ ```
166
+
167
+ ## Failure modes
168
+
169
+ | Exit code / error fragment | Meaning | What to do |
170
+ | --- | --- | --- |
171
+ | stdout has JSON, exit 0 | Success | Continue. |
172
+ | `"Not authenticated"` | Token missing or revoked | Ask user to run `velocity auth login`. |
173
+ | `"No project selected"` | No active project resolvable | Tell user to run `velocity projects use <slug>` or pass `--project <slug>`. |
174
+ | `"Project not found"` | Bad slug or id | List options via `velocity projects list`. |
175
+ | `"Story not found"` / `"Note not found"` etc. | Bad numeric id / id | Confirm the value via the relevant `list` command. |
176
+ | `"Cannot assign story to a locked release"` | Release is `released`/`archived` | Either pick an unlocked release or unlock it (web UI only). |
177
+ | Any 500 / unexpected error | Server-side issue | Retry once; if persistent, surface to user verbatim. |
178
+
179
+ Always check the exit code before parsing stdout.
180
+
181
+ ## Conventions
182
+
183
+ - Pass long-text inputs (descriptions, note bodies, comment bodies) via
184
+ `--file <path>` or `--stdin` when the content is more than a line —
185
+ it avoids quoting headaches and surfaces shell injection less often.
186
+ - For mutations, prefer named flags over positional arguments. The
187
+ flag names match the field names in the JSON response, so reading
188
+ back what you just wrote is straightforward.
189
+ - To clear an optional relation (assignee, sprint, release, parent,
190
+ due-date), pass `null` as the value: `--assignee null`.
191
+ - Web URLs for stories, notes, and releases are not returned by these
192
+ commands; they're constructed as
193
+ `https://velocity.oozou.com/projects/<projectId>/stories/<number>`
194
+ etc. when you need to link from agent output to the web app.
195
+
196
+ ## Environment variables
197
+
198
+ | Variable | Purpose |
199
+ | --- | --- |
200
+ | `VELOCITY_TOKEN` | Bearer token; bypasses the credentials file. |
201
+ | `VELOCITY_API_BASE` | Override the API base URL. |
202
+ | `VELOCITY_PROJECT` | Override the active project slug or id. |
203
+ | `VELOCITY_OUTPUT` | `json` or `human`; forces output mode. |
204
+ | `VELOCITY_NO_UPDATE_NOTIFIER` | Set to `1` to silence the update prompt. |
205
+
206
+ ## When in doubt
207
+
208
+ Run `velocity <cmd> --help` for the live flag list — it always matches
209
+ the binary you're invoking, even if this file drifts. Then come back
210
+ to this contract for shape and failure-mode details.
package/README.md CHANGED
@@ -1,56 +1,240 @@
1
1
  # @oozou/velocity
2
2
 
3
- Command-line interface for [Velocity](https://velocity.oozou.com). Usable by humans and AI agents.
3
+ Command-line client for [Velocity](https://velocity.oozou.com). Built for humans
4
+ at a terminal and for AI agents driving it programmatically. Output is plain
5
+ tabular text on a TTY, JSON when piped.
4
6
 
5
7
  ## Install
6
8
 
7
9
  ```sh
8
10
  npm i -g @oozou/velocity
9
- # or
10
- pnpm add -g @oozou/velocity
11
11
  # or run without installing
12
12
  npx -y @oozou/velocity auth login
13
13
  ```
14
14
 
15
+ Update later with `velocity update` (it shells out to `npm i -g @latest`).
16
+
15
17
  ## Quick start
16
18
 
17
19
  ```sh
18
- velocity env use production # or `local` for a dev stack
19
- velocity auth login # opens a browser to authorize
20
+ velocity auth login # browser-based sign-in
20
21
  velocity whoami
21
- velocity project use <projectId>
22
+ velocity projects list
23
+ velocity projects use <slug>
22
24
  velocity stories list
23
- velocity stories create --title "..." --type feature --status backlog --priority medium
25
+ velocity stories create --title "Fix nav crash" --type bug --status backlog --priority high
24
26
  ```
25
27
 
26
28
  ## Output modes
27
29
 
28
- - TTY human (tables, plain text)
29
- - Pipe / non-TTY → JSON, one well-formed value per command
30
- - Force with `--json` / `--human` flags or `VELOCITY_OUTPUT=json|human`
30
+ | Mode | When |
31
+ | --- | --- |
32
+ | Human | stdout is a TTY |
33
+ | JSON | stdout is piped / non-TTY |
34
+
35
+ Override per-invocation with `--json` / `--human`, or set
36
+ `VELOCITY_OUTPUT=json|human`.
37
+
38
+ Errors land on stderr. Under `--json`, errors are a single
39
+ `{"error":"..."}` line. Exit code is non-zero on any failure.
31
40
 
32
41
  ## Headless / CI
33
42
 
34
- Skip the browser flow with an existing API token from Settings → API Tokens:
43
+ Skip the browser flow with an existing API token (Settings → API Tokens):
35
44
 
36
45
  ```sh
37
46
  export VELOCITY_TOKEN=vel_…
38
- export VELOCITY_ENV=production
39
- velocity stories list --project <id>
47
+ velocity stories list --project <slug>
40
48
  ```
41
49
 
42
- ## Environments
50
+ `VELOCITY_API_BASE` overrides the default endpoint if you're pointing at a
51
+ non-production stack.
43
52
 
44
- | Name | API base |
45
- | --- | --- |
46
- | `production` | `https://velocity.oozou.com` |
47
- | `local` | `http://localhost:3000` |
53
+ ## Project context
48
54
 
49
- `velocity env list / current / use <name> / reset`. `--env <name>` flag and `VELOCITY_ENV` env var override per-invocation.
55
+ Most commands operate on a single project. Resolution precedence:
56
+
57
+ 1. `--project <slug-or-id>` flag on the command
58
+ 2. `VELOCITY_PROJECT` env var
59
+ 3. The persisted active project (set by `velocity projects use <slug>`)
60
+
61
+ Projects are addressable by slug (`acme-website`) or by Convex id. Slugs are
62
+ the friendly identifier shown by `velocity projects list`.
50
63
 
51
64
  ## Commands
52
65
 
53
- `velocity agent-help` prints the full command tree as markdown — useful as model context for AI agents.
66
+ ### `velocity auth`
67
+
68
+ Browser-based auth via OAuth 2.0 device-code flow.
69
+
70
+ ```
71
+ velocity auth login # opens browser, polls for approval
72
+ velocity auth logout # delete locally stored credentials
73
+ velocity auth status # show session details
74
+ ```
75
+
76
+ Credentials live at `~/.config/velocity/credentials.json` (mode `0600`). The
77
+ token issued is a regular Velocity API token — revokable from
78
+ Settings → API Tokens in the web app.
79
+
80
+ ### `velocity whoami`
81
+
82
+ Print the currently authenticated user. Unix `whoami` analogue.
83
+
84
+ ```
85
+ velocity whoami
86
+ ```
87
+
88
+ ### `velocity update`
89
+
90
+ Upgrade the CLI to the latest version on npm. Shells out to
91
+ `npm i -g @oozou/velocity@latest`.
92
+
93
+ ```
94
+ velocity update
95
+ ```
96
+
97
+ Pass `VELOCITY_NO_UPDATE_NOTIFIER=1` to silence the passive
98
+ "update available" prompt the CLI prints on its next run.
99
+
100
+ ### `velocity projects`
101
+
102
+ Project listing and the active-project switcher.
103
+
104
+ ```
105
+ velocity projects list # all projects you can access
106
+ velocity projects get [slug-or-id] # detail (defaults to active project)
107
+ velocity projects use <slug-or-id> # set the active project
108
+ velocity projects current # show the active project
109
+ velocity projects reset # clear the active project
110
+ ```
111
+
112
+ ### `velocity stories`
113
+
114
+ Stories are addressed by their globally-unique number (`#10634`).
115
+
116
+ ```
117
+ velocity stories list
118
+ velocity stories get <number>
119
+ velocity stories create \
120
+ --title "Title" \
121
+ --type feature|bug|chore \
122
+ --status <stage> \
123
+ --priority urgent|high|medium|low \
124
+ [--description "..." | --description-file <path> | --description-stdin] \
125
+ [--assignee <userId>] \
126
+ [--sprint <sprintId>] \
127
+ [--release <releaseId>] \
128
+ [--parent <storyId>] \
129
+ [--points <number>] \
130
+ [--complexity none|low|medium|high]
131
+ velocity stories update <number> [same options as create, all optional;
132
+ pass "null" to clear a relation]
133
+ velocity stories delete <number>
134
+ ```
135
+
136
+ ### `velocity sprints`
137
+
138
+ ```
139
+ velocity sprints list # all sprints in active project
140
+ velocity sprints active # current sprint + stories + day totals
141
+ velocity sprints get <sprintId>
142
+ velocity sprints stories <sprintId> # all stories in a sprint
143
+ ```
144
+
145
+ ### `velocity releases`
146
+
147
+ ```
148
+ velocity releases list [--include-archived]
149
+ velocity releases get <releaseId>
150
+ velocity releases create \
151
+ --name "v1.2 Launch" \
152
+ --target-date 2026-06-30 \
153
+ [--version 1.2.0] \
154
+ [--description "..." | --description-file <path> | --description-stdin]
155
+ velocity releases update <releaseId> [same options as create, all optional;
156
+ pass "null" to clear]
157
+ velocity releases status <releaseId> planned|in_progress|released|archived
158
+ velocity releases assign <storyNumber> <releaseId>
159
+ velocity releases unassign <storyNumber>
160
+ ```
161
+
162
+ ### `velocity comments`
163
+
164
+ Comments attach to a story (by story number).
165
+
166
+ ```
167
+ velocity comments list <storyNumber>
168
+ velocity comments add <storyNumber> "body text"
169
+ velocity comments add <storyNumber> --file ./comment.md
170
+ velocity comments add <storyNumber> --stdin < comment.md
171
+ ```
172
+
173
+ ### `velocity notes`
174
+
175
+ ```
176
+ velocity notes list
177
+ velocity notes get <noteId>
178
+ velocity notes create \
179
+ --title "Architecture decisions" \
180
+ [--content "..." | --file <path> | --stdin]
181
+ velocity notes update <noteId> [--title "..."] \
182
+ [--content "..." | --file <path> | --stdin]
183
+ velocity notes delete <noteId>
184
+ ```
185
+
186
+ ### `velocity todos`
187
+
188
+ ```
189
+ velocity todos list
190
+ velocity todos create \
191
+ --title "Email Alice" \
192
+ [--priority urgent|high|medium|low] \
193
+ [--due-date 2026-06-15] \
194
+ [--assignee <userId>]
195
+ velocity todos update <todoId> [--title "..."] \
196
+ [--priority ...] [--due-date 2026-06-15 | --due-date null] \
197
+ [--assignee <userId> | --assignee null] \
198
+ [--done]
199
+ velocity todos delete <todoId>
200
+ ```
201
+
202
+ ### Project meta
203
+
204
+ Top-level commands that operate on the active project.
205
+
206
+ ```
207
+ velocity stats # totals, status breakdown
208
+ velocity activity [--limit N] # recent activity feed
209
+ velocity members # team members
210
+ ```
211
+
212
+ ### `velocity agent-help`
213
+
214
+ Prints a markdown guide intended as model context for AI agents driving the
215
+ CLI. Useful at the top of an agent session:
216
+
217
+ ```sh
218
+ velocity agent-help --json
219
+ ```
220
+
221
+ ## Global flags
222
+
223
+ | Flag | Purpose |
224
+ | --- | --- |
225
+ | `--json` / `--human` | Force output mode regardless of TTY |
226
+ | `--api-base <url>` | Override the API base URL for one invocation |
227
+ | `--project <slug-or-id>` | Override the active project for one invocation |
228
+
229
+ ## Environment variables
230
+
231
+ | Variable | Purpose |
232
+ | --- | --- |
233
+ | `VELOCITY_TOKEN` | Bearer token; bypasses the credentials file |
234
+ | `VELOCITY_API_BASE` | Override the API base URL |
235
+ | `VELOCITY_PROJECT` | Override the active project slug or id |
236
+ | `VELOCITY_OUTPUT` | `json` or `human`; forces output mode |
237
+ | `VELOCITY_NO_UPDATE_NOTIFIER` | Set to `1` to silence the update prompt |
54
238
 
55
239
  ## License
56
240
 
package/SKILL.md ADDED
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: velocity
3
+ description: Operate the Velocity CLI to read and manage projects, stories, sprints, releases, notes, todos, and comments. Use whenever the user asks to look at Velocity data or to create/update/delete anything in their Velocity workspace.
4
+ ---
5
+
6
+ # velocity
7
+
8
+ You have access to the `velocity` CLI. It is the sanctioned way to read
9
+ or write Velocity content from a terminal or agent runtime.
10
+
11
+ **Always read [AGENT.md](./AGENT.md) before issuing your first command in
12
+ a session.** It contains the full command surface, the JSON output
13
+ contract, project resolution rules, and the failure modes you will
14
+ hit. Do not guess command names or flag shapes.
15
+
16
+ If `AGENT.md` is not on disk (sandboxed environments), run
17
+ `velocity agent-help` to print the same content to stdout.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/index.ts
4
- import { Command } from "commander";
4
+ import { Command, Option } from "commander";
5
5
  import updateNotifier from "update-notifier";
6
6
 
7
7
  // src/commands/auth.ts
@@ -497,7 +497,7 @@ var runReset = async (cmd) => {
497
497
  );
498
498
  };
499
499
  var registerEnvCommands = (program2) => {
500
- const env = program2.command("env").description("Switch between Velocity deployments (production/local)");
500
+ const env = program2.command("env", { hidden: true }).description("Switch between Velocity deployments (production/local)");
501
501
  env.command("list").description("List known environments and which one is active").action(async function() {
502
502
  try {
503
503
  await runList(this);
@@ -1316,98 +1316,33 @@ var registerUpdateCommand = (program2) => {
1316
1316
  };
1317
1317
 
1318
1318
  // src/commands/agent-help.ts
1319
- var HELP_TEXT = `# Velocity CLI agent guide
1320
-
1321
- The Velocity CLI is a REST client over /api/v1/* with two output modes:
1322
- - Human (default on a TTY): tabular plain text.
1323
- - JSON (default when stdout is piped, or pass --json): a single JSON value per command.
1324
-
1325
- ## Environments
1326
- - \`velocity env list\` \u2014 show known envs (production, local) and which is active.
1327
- - \`velocity env use <name>\` \u2014 set the active env for future invocations.
1328
- - \`velocity env current\` \u2014 show active env + api base + signed-in state.
1329
- - \`velocity env reset\` \u2014 clear the active-env file (falls back to production).
1330
- - \`--env <name>\` flag overrides per-command. \`VELOCITY_ENV\` env var overrides next.
1331
-
1332
- ## Auth
1333
- - \`velocity auth login\` \u2014 opens a browser, polls for approval. Stores creds at
1334
- ~/.config/velocity/credentials.<env>.json (mode 0600).
1335
- - \`velocity auth logout\` \u2014 deletes the local credentials file.
1336
- - \`velocity auth status\` \u2014 show session details. \`velocity whoami\` \u2014 short form.
1337
- - Headless escape hatch: set \`VELOCITY_TOKEN=vel_\u2026\`. With \`VELOCITY_ENV\` it's
1338
- enough; \`VELOCITY_API_BASE\` overrides the URL.
1339
-
1340
- ## Active project
1341
- Most commands need a projectId. Resolution:
1342
- 1. \`--project <id>\` flag
1343
- 2. \`VELOCITY_PROJECT\` env var
1344
- 3. The active-project file (\`velocity projects use <slug>\`)
1345
-
1346
- ## Command tree
1347
-
1348
- \`\`\`
1349
- auth login | logout | status
1350
- env list | current | use <name> | reset
1351
- whoami
1352
-
1353
- projects list
1354
- projects get [slug-or-id]
1355
- projects use <slug-or-id> | current | reset
1356
-
1357
- update # upgrade the CLI to the latest version on npm
1358
-
1359
- stories list
1360
- stories get <number>
1361
- stories create --title --type --status --priority [--description --assignee --sprint --release --parent --points --complexity]
1362
- stories update <number> [--title --description --type --status --priority --assignee --sprint --release --parent --points --complexity]
1363
- stories delete <number>
1364
-
1365
- sprints list
1366
- sprints active
1367
- sprints get <sprintId>
1368
- sprints stories <sprintId>
1369
-
1370
- releases list [--include-archived]
1371
- releases get <releaseId>
1372
- releases create --name --target-date [--version --description]
1373
- releases update <releaseId> [--name --target-date --version --description]
1374
- releases status <releaseId> <planned|in_progress|released|archived>
1375
- releases assign <storyNumber> <releaseId>
1376
- releases unassign <storyNumber>
1377
-
1378
- comments list <storyNumber>
1379
- comments add <storyNumber> <body> | --body | --file | --stdin
1380
-
1381
- notes list
1382
- notes get <noteId>
1383
- notes create --title [--content | --file | --stdin]
1384
- notes update <noteId> [--title --content | --file | --stdin]
1385
- notes delete <noteId>
1386
-
1387
- todos list
1388
- todos create --title [--priority --due-date --assignee]
1389
- todos update <todoId> [--title --priority --due-date --assignee --done]
1390
- todos delete <todoId>
1391
-
1392
- stats
1393
- activity [--limit N]
1394
- members
1395
- \`\`\`
1396
-
1397
- ## Output rules for scripts
1398
- - Stdout: success result (human or JSON depending on TTY / flags / VELOCITY_OUTPUT).
1399
- - Stderr: prompts, errors, browser hints. Never JSON success data.
1400
- - Exit code: 0 on success, non-zero on failure.
1401
- - 401 from any command \u2192 token rotted or revoked. Re-run \`velocity auth login\`.
1402
-
1403
- ## Errors
1404
- JSON mode errors come back as \`{"error":"..."}\` on stderr with a non-zero exit
1405
- code. Human mode prints \`Error: ...\` on stderr.
1406
- `;
1319
+ import { readFile as readFile4 } from "fs/promises";
1320
+ import { fileURLToPath } from "url";
1321
+ import { dirname as dirname3, join as join2 } from "path";
1322
+ var findAgentDoc = async () => {
1323
+ const here = dirname3(fileURLToPath(import.meta.url));
1324
+ const candidates = [
1325
+ join2(here, "..", "AGENT.md"),
1326
+ // dist/index.js ../AGENT.md
1327
+ join2(here, "..", "..", "AGENT.md")
1328
+ // dev: src/commands ../../AGENT.md
1329
+ ];
1330
+ for (const path of candidates) {
1331
+ try {
1332
+ return await readFile4(path, "utf8");
1333
+ } catch {
1334
+ }
1335
+ }
1336
+ throw new Error(
1337
+ "AGENT.md not found. Reinstall the CLI with `npm i -g @oozou/velocity@latest`."
1338
+ );
1339
+ };
1407
1340
  var registerAgentHelpCommand = (program2) => {
1408
- program2.command("agent-help").description("Print a markdown guide for AI agents using the CLI").action(async function() {
1341
+ program2.command("agent-help").description("Print the agent contract (AGENT.md) to stdout").action(async function() {
1409
1342
  try {
1410
- writeResult(this, { markdown: HELP_TEXT }, () => HELP_TEXT);
1343
+ const doc = await findAgentDoc();
1344
+ process.stdout.write(doc);
1345
+ if (!doc.endsWith("\n")) process.stdout.write("\n");
1411
1346
  } catch (err) {
1412
1347
  exitWithError(err, this);
1413
1348
  }
@@ -1415,7 +1350,7 @@ var registerAgentHelpCommand = (program2) => {
1415
1350
  };
1416
1351
 
1417
1352
  // src/index.ts
1418
- var VERSION = "0.1.2";
1353
+ var VERSION = "0.1.4";
1419
1354
  if (process.stdout.isTTY && process.env.VELOCITY_NO_UPDATE_NOTIFIER !== "1") {
1420
1355
  try {
1421
1356
  updateNotifier({
@@ -1429,7 +1364,10 @@ if (process.stdout.isTTY && process.env.VELOCITY_NO_UPDATE_NOTIFIER !== "1") {
1429
1364
  }
1430
1365
  }
1431
1366
  var program = new Command();
1432
- program.name("velocity").description("CLI for Velocity").version(VERSION).option("--json", "force JSON output regardless of TTY", false).option("--human", "force human output regardless of TTY", false).option("--env <name>", "Target a named env (production, local)").option("--api-base <url>", "Override the Velocity API base URL").option("--project <id>", "Target a specific project for this invocation");
1367
+ program.name("velocity").description("CLI for Velocity").version(VERSION).option("--json", "force JSON output regardless of TTY", false).option("--human", "force human output regardless of TTY", false).addOption(
1368
+ // Functional but intentionally not surfaced in --help output.
1369
+ new Option("--env <name>", "Target a named env").hideHelp()
1370
+ ).option("--api-base <url>", "Override the Velocity API base URL").option("--project <id>", "Target a specific project for this invocation");
1433
1371
  registerAuthCommands(program);
1434
1372
  registerEnvCommands(program);
1435
1373
  registerWhoamiCommand(program);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oozou/velocity",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Velocity CLI — browser-based auth + REST client for the Velocity project management API.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://velocity.oozou.com",
@@ -25,6 +25,8 @@
25
25
  },
26
26
  "files": [
27
27
  "dist",
28
+ "AGENT.md",
29
+ "SKILL.md",
28
30
  "README.md",
29
31
  "LICENSE"
30
32
  ],