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
Copy file name to clipboardExpand all lines: .agents/skills/add-command/SKILL.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: add-command
3
-
description: Guide for adding new CLI commands or subcommands to twist-cli. Use when implementing new SDK endpoints, adding subcommands to existing command groups, or extending CLI functionality.
3
+
description: Guide for adding new CLI commands or subcommands to comms-cli. Use when implementing new SDK endpoints, adding subcommands to existing command groups, or extending CLI functionality.
If the new command uses a **read-only** SDK method (e.g., `getXxx`, `listXxx`), add it to the `KNOWN_SAFE_API_METHODS` set. This set uses a default-deny approach: any method **not** listed is treated as mutating and will be blocked when the CLI is authenticated with a read-only OAuth token (`tw auth login --read-only`).
22
+
If the new command uses a **read-only** SDK method (e.g., `getXxx`, `listXxx`), add it to the `KNOWN_SAFE_API_METHODS` set. This set uses a default-deny approach: any method **not** listed is treated as mutating and will be blocked when the CLI is authenticated with a read-only OAuth token (`tdc auth login --read-only`).
23
23
24
24
-**Read-only methods** (fetch/list/view): add to `KNOWN_SAFE_API_METHODS`
25
25
-**Mutating methods** (create/update/delete/archive/mute): do NOT add — they are blocked by default, which is the correct behavior
The CLI supports accessible mode via `isAccessible()` (checks `TW_ACCESSIBLE=1` or `--accessible` flag). When adding output that uses color or visual elements, consider whether information is conveyed **only** by color or decoration.
131
+
The CLI supports accessible mode via `isAccessible()` (checks `TDC_ACCESSIBLE=1` or `--accessible` flag). When adding output that uses color or visual elements, consider whether information is conveyed **only** by color or decoration.
132
132
133
133
### When to add accessible alternatives
134
134
@@ -160,12 +160,12 @@ Tests mock the API layer directly using `vi.mock` and `vi.hoisted`. Follow the e
@@ -218,7 +218,7 @@ After all code changes are complete:
218
218
npm run build && npm run sync:skill
219
219
```
220
220
221
-
This builds the project and regenerates `skills/twist-cli/SKILL.md` from the compiled skill content. The regenerated file must be committed. CI will fail (`npm run check:skill-sync`) if it is out of sync.
221
+
This builds the project and regenerates `skills/comms-cli/SKILL.md` from the compiled skill content. The regenerated file must be committed. CI will fail (`npm run check:skill-sync`) if it is out of sync.
description: Guide for adding new CLI commands or subcommands to twist-cli. Use when implementing new SDK endpoints, adding subcommands to existing command groups, or extending CLI functionality.
3
+
description: Guide for adding new CLI commands or subcommands to comms-cli. Use when implementing new SDK endpoints, adding subcommands to existing command groups, or extending CLI functionality.
4
4
---
5
5
6
6
See [/.agents/skills/add-command/SKILL.md](../../../.agents/skills/add-command/SKILL.md) for the full guide.
Copy file name to clipboardExpand all lines: AGENTS.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,27 +36,27 @@ node dist/index.js <command>
36
36
37
37
## Architecture
38
38
39
-
This is a TypeScript CLI (`tw`) for Twist messaging, built with Commander.js.
39
+
This is a TypeScript CLI (`tdc`) for Comms messaging, built with Commander.js.
40
40
41
41
**Entry point**: `src/index.ts` registers all commands with Commander.
42
42
43
43
**Commands** (`src/commands/`): Commands with multiple subcommands use a folder-based structure (`src/commands/<entity>/index.ts`) where the index file exports a `register*Command(program)` function and wires Commander subcommands to handler functions in sibling files. Single-command files remain as flat files (`src/commands/<entity>.ts`). Each subcommand handler file exports one async action function and imports from `../../lib/`. An optional `helpers.ts` holds shared constants/utilities used by multiple subcommands. Commands support `--json`, `--ndjson`, and `--full` flags for machine-readable output.
44
44
45
45
**Lib** (`src/lib/`):
46
46
47
-
-`api.ts` - Singleton TwistApi client from `@doist/twist-sdk`, workspace/user caching
48
-
-`refs.ts` - Reference parsing: accepts IDs (`id:123` or bare `123`), Twist URLs, or fuzzy names for workspaces/users
47
+
-`api.ts` - Singleton CommsApi client from `@doist/comms-sdk`, workspace/user caching
48
+
-`refs.ts` - Reference parsing: accepts IDs (`id:123` or bare `123`), Comms URLs, or fuzzy names for workspaces/users
49
49
-`output.ts` - JSON/NDJSON formatting with essential field filtering per entity type
50
-
-`config.ts` - Persists config to `~/.config/twist-cli/config.json`
50
+
-`config.ts` - Persists config to `~/.config/comms-cli/config.json`
51
51
-`auth.ts` - Token loading/saving/clearing (env var or config file)
52
52
-`markdown.ts` - Terminal markdown rendering via `marked` + `marked-terminal`
**Reference system**: The CLI accepts flexible references throughout - numeric IDs, `id:` prefixed IDs, full Twist URLs (parsed via `parseTwistUrl`), or fuzzy name matching for workspaces/users.
55
+
**Reference system**: The CLI accepts flexible references throughout - numeric IDs, `id:` prefixed IDs, full Comms URLs (parsed via `parseCommsUrl`), or fuzzy name matching for workspaces/users.
56
56
57
57
## Key Patterns
58
58
59
-
-**Implicit view subcommand**: `tw thread <ref>` defaults to `tw thread view <ref>` via Commander's `{ isDefault: true }`. Same for `conversation` and `msg`. Edge case: if a ref matches a subcommand name (e.g., "reply"), the subcommand wins — user must use `tw thread view reply`
59
+
-**Implicit view subcommand**: `tdc thread <ref>` defaults to `tdc thread view <ref>` via Commander's `{ isDefault: true }`. Same for `conversation` and `msg`. Edge case: if a ref matches a subcommand name (e.g., "reply"), the subcommand wins — user must use `tdc thread view reply`
60
60
-**Named flag aliases**: Where commands accept positional `[workspace-ref]`, the `--workspace` flag is also accepted. Error if both positional and flag are provided
61
61
-**JSON output on mutating commands**: Mutating commands (create, update, delete, archive) should support `--json` output where it provides scripting value. Commands that return an object from the API (create/update) should also support `--full`. Commands where the API returns void should output a minimal status object (e.g. `{ id, deleted: true }` or `{ id, isArchived: true }`). Extend `MutationOptions` in `src/lib/options.ts` (which already includes `json` and `full`) rather than adding these fields ad hoc. Use `formatJson()` from `src/lib/output.ts` for the output. See `src/commands/away.ts` as the reference implementation.
62
62
-**Spinner messages**: When adding new SDK method calls, add a corresponding entry in the `API_SPINNER_MESSAGES` map in `src/lib/api.ts`. Every user-facing API call should have a spinner message so the CLI shows progress feedback.
@@ -87,7 +87,7 @@ Lefthook runs type-check, oxlint, and oxfmt on pre-commit, tests on pre-push.
87
87
88
88
## Skill Content (Agent Command Reference)
89
89
90
-
The file `src/lib/skills/content.ts` exports `SKILL_CONTENT` — a comprehensive command reference that gets installed into AI agent skill directories via `tw skill install`. This is the source of truth that agents use to understand available CLI commands.
90
+
The file `src/lib/skills/content.ts` exports `SKILL_CONTENT` — a comprehensive command reference that gets installed into AI agent skill directories via `tdc skill install`. This is the source of truth that agents use to understand available CLI commands.
91
91
92
92
**Whenever commands, subcommands, flags, or options are added, updated, or removed in `src/commands/`, the `SKILL_CONTENT` in `src/lib/skills/content.ts` must be updated to match.** This includes:
93
93
@@ -98,7 +98,7 @@ The file `src/lib/skills/content.ts` exports `SKILL_CONTENT` — a comprehensive
98
98
99
99
After updating `SKILL_CONTENT`:
100
100
101
-
1. Run `npm run build && npm run sync:skill` to regenerate `skills/twist-cli/SKILL.md` (the standalone skill file used by `npx skills add`)
102
-
2. Run `tw skill update claude-code` (and any other installed agents) to propagate changes to installed skill files
101
+
1. Run `npm run build && npm run sync:skill` to regenerate `skills/comms-cli/SKILL.md` (the standalone skill file used by `npx skills add`)
102
+
2. Run `tdc skill update claude-code` (and any other installed agents) to propagate changes to installed skill files
103
103
104
-
A CI check (`npm run check:skill-sync`) runs on pull requests and will fail if `skills/twist-cli/SKILL.md` is out of sync with `content.ts`.
104
+
A CI check (`npm run check:skill-sync`) runs on pull requests and will fail if `skills/comms-cli/SKILL.md` is out of sync with `content.ts`.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,20 @@
1
-
# Contributing to Twist CLI
1
+
# Contributing to Comms CLI
2
2
3
-
The following is a set of guidelines for contributing to Twist CLI. Please read these guidelines before creating an issue or pull request.
3
+
The following is a set of guidelines for contributing to Comms CLI. Please read these guidelines before creating an issue or pull request.
4
4
5
5
## Open Development
6
6
7
-
All work on Twist CLI happens directly on [GitHub](https://github.com/Doist/twist-cli). Both core team members and external contributors send pull requests that go through the same review process.
7
+
All work on Comms CLI happens directly on [GitHub](https://github.com/Doist/comms-cli). Both core team members and external contributors send pull requests that go through the same review process.
8
8
9
9
## Semantic Versioning
10
10
11
-
Twist CLI follows [semantic versioning](https://semver.org/). We release patch versions for bugfixes, minor versions for new features or non-essential changes, and major versions for any breaking changes.
11
+
Comms CLI follows [semantic versioning](https://semver.org/). We release patch versions for bugfixes, minor versions for new features or non-essential changes, and major versions for any breaking changes.
12
12
13
13
Every significant change is documented in the [CHANGELOG.md](CHANGELOG.md) file.
14
14
15
15
## Branch Organization
16
16
17
-
Submit all changes to the [main](https://github.com/Doist/twist-cli/tree/main) branch (via PR) by default. For pre-release work, target the `next` branch instead — see [Release Process](#release-process-core-team-only) for details.
17
+
Submit all changes to the [main](https://github.com/Doist/comms-cli/tree/main) branch (via PR) by default. For pre-release work, target the `next` branch instead — see [Release Process](#release-process-core-team-only) for details.
18
18
19
19
We do our best to keep `main` in good shape, with all tests passing.
20
20
@@ -91,9 +91,9 @@ To test features before publishing a stable release:
91
91
### Installing a pre-release
92
92
93
93
```sh
94
-
npm install @doist/twist-cli@next
94
+
npm install @doist/comms-cli@next
95
95
```
96
96
97
97
## License
98
98
99
-
By contributing to Twist CLI, you agree that your contributions will be licensed under its [MIT license](LICENSE).
99
+
By contributing to Comms CLI, you agree that your contributions will be licensed under its [MIT license](LICENSE).
0 commit comments