You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Commands use [Stricli](https://bloomberg.github.io/stricli/docs/getting-started/principles) wrapped by `src/lib/command.ts`.
200
+
Commands use `@stricli/core`.
225
201
226
-
**CRITICAL**: Import `buildCommand` from `../../lib/command.js`, **NEVER** from `@stricli/core` directly — the wrapper adds telemetry, `--json`/`--fields` injection, and output rendering.
return { hint: "Tip: use --json for machine-readable output" };
221
+
async func(this:SentryContext, flags) {
222
+
const { process } =this;
223
+
// Implementation - use process.stdout.write() for output
254
224
},
255
225
});
256
226
```
257
227
258
-
**Key rules:**
259
-
- Functions are `async *func()` generators — yield `new CommandOutput(data)`, return `{ hint }`.
260
-
-`output.human` receives the same data object that gets serialized to JSON — no divergent-data paths.
261
-
- The wrapper auto-injects `--json` and `--fields` flags. Do NOT add your own `json` flag.
262
-
- Do NOT use `stdout.write()` or `if (flags.json)` branching — the wrapper handles it.
263
-
264
-
### Positional Arguments
265
-
266
-
Use `parseSlashSeparatedArg` from `src/lib/arg-parsing.ts` for the standard `[<org>/<project>/]<id>` pattern. Required identifiers (trace IDs, span IDs) should be **positional args**, not flags.
All non-trivial human output must use the markdown rendering pipeline:
282
-
283
-
- Build markdown strings with helpers: `mdKvTable()`, `colorTag()`, `escapeMarkdownCell()`, `renderMarkdown()`
284
-
-**NEVER** use raw `muted()` / chalk in output strings — use `colorTag("muted", text)` inside markdown
285
-
- Tree-structured output (box-drawing characters) that can't go through `renderMarkdown()` should use the `plainSafeMuted` pattern: `isPlainOutput() ? text : muted(text)`
-`validateTraceId(value)` — thin wrapper around `validateHexId` in `src/lib/trace-id.ts`.
327
-
328
-
All normalize to lowercase. Throw `ValidationError` on invalid input.
329
-
330
-
### Sort Convention
331
-
332
-
Use `"date"` for timestamp-based sort (not `"time"`). Export sort types from the API layer (e.g., `SpanSortValue` from `api/traces.ts`), import in commands. This matches `issue list`, `trace list`, and `span list`.
333
-
334
-
### SKILL.md
335
-
336
-
- Run `bun run generate:skill` after changing any command parameters, flags, or docs.
337
-
- CI check `bun run check:skill` will fail if SKILL.md is stale.
338
-
- Positional `placeholder` values must be descriptive: `"org/project/trace-id"` not `"args"`.
@@ -451,8 +339,6 @@ Key rules when writing overrides:
451
339
- `resolveCursor()` must be called **inside** the `org-all` override closure, not before `dispatchOrgScopedList`, so that `--cursor` validation errors fire correctly for non-org-all modes.
452
340
- `handleProjectSearch` errors must use `"Project"` as the `ContextError` resource, not `config.entityName`.
453
341
454
-
3. **Standalone list commands** (e.g., `spanlist`, `tracelist`) that don't use org-scoped dispatch wire pagination directly in `func()`. See the "List Command Pagination" section above for the pattern.
0 commit comments