mirror of
https://gitee.com/pnoker/iot-dc3.git
synced 2026-11-02 03:01:52 +08:00
AGENTS.md stays lean with always-relevant rules and a task routing
table; the deep per-area conventions move to
dc3/agents/{backend,frontend,cli,testing}.md to be read on demand.
CONTRIBUTING.md documents the changelog-only commit rule and the
generated-CHANGE.md editing policy.
Co-Authored-By: Claude Code <noreply@anthropic.com>
22 lines
1.1 KiB
Markdown
22 lines
1.1 KiB
Markdown
# CLI conventions (`dc3-cli/`)
|
|
|
|
Read this when changing `dc3-cli/` or adding gateway subcommands. Entry point and cross-cutting rules:
|
|
[`AGENTS.md`](../../AGENTS.md).
|
|
|
|
Standalone TypeScript package (pnpm + tsup + vitest, binary name `dc3`). It has no Java/build coupling to the Maven
|
|
build; it talks to the running backend through the HTTP gateway only. It owns an independent package and lockfile;
|
|
the repository does not use a root pnpm workspace.
|
|
|
|
```bash
|
|
(cd dc3-cli && corepack pnpm install) # install the CLI's independent dependencies
|
|
(cd dc3-cli && corepack pnpm build) # tsup → dist/ (bin: dc3)
|
|
(cd dc3-cli && corepack pnpm test) # vitest run
|
|
(cd dc3-cli && corepack pnpm lint) # eslint src --fix
|
|
```
|
|
|
|
- The CLI mirrors backend CRUD verb conventions: command surfaces use `get/list/add/update/delete`; list endpoints that
|
|
call manager APIs use POST with a paging body.
|
|
- Output contract: `--format json|table|yaml`, TTY defaults to table, pipes default to json; exit codes 0 ok / 1
|
|
business error / 2 network error / 3 auth error.
|
|
- When adding or changing a gateway HTTP API, check whether `dc3-cli/src/commands/*` needs the matching subcommand.
|