@doist/comms-cli 1.8.0 → 1.9.1
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/CHANGELOG.md +12 -0
- package/dist/commands/migrate/index.d.ts +3 -0
- package/dist/commands/migrate/index.d.ts.map +1 -0
- package/dist/commands/migrate/index.js +21 -0
- package/dist/commands/migrate/index.js.map +1 -0
- package/dist/commands/migrate/urls.d.ts +8 -0
- package/dist/commands/migrate/urls.d.ts.map +1 -0
- package/dist/commands/migrate/urls.js +86 -0
- package/dist/commands/migrate/urls.js.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/skills/content.d.ts +1 -1
- package/dist/lib/skills/content.d.ts.map +1 -1
- package/dist/lib/skills/content.js +21 -0
- package/dist/lib/skills/content.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [1.9.1](https://github.com/Doist/comms-cli/compare/v1.9.0...v1.9.1) (2026-07-02)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- **deps:** release comms-sdk 0.7.1 for Node 26 terminated fix ([587b17b](https://github.com/Doist/comms-cli/commit/587b17b3a2df4e2060c6452f5a9d2d6dbda12a5b)), closes [#39](https://github.com/Doist/comms-cli/issues/39)
|
|
6
|
+
|
|
7
|
+
## [1.9.0](https://github.com/Doist/comms-cli/compare/v1.8.0...v1.9.0) (2026-06-26)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
- add migrate urls command ([#38](https://github.com/Doist/comms-cli/issues/38)) ([99697c0](https://github.com/Doist/comms-cli/commit/99697c007eb686d1370af4636c03a0325b26aba1))
|
|
12
|
+
|
|
1
13
|
## [1.8.0](https://github.com/Doist/comms-cli/compare/v1.7.0...v1.8.0) (2026-06-18)
|
|
2
14
|
|
|
3
15
|
### Features
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/migrate/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAGxC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsB7D"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { migrateUrls } from './urls.js';
|
|
2
|
+
export function registerMigrateCommand(program) {
|
|
3
|
+
const migrate = program.command('migrate').description('Twist→Comms migration helpers');
|
|
4
|
+
migrate
|
|
5
|
+
.command('urls [urls]')
|
|
6
|
+
.description('Translate twist.com URLs to their Comms equivalents')
|
|
7
|
+
.option('--twist-token <token>', 'Twist auth token (overrides $TWIST_AUTH_TOKEN)')
|
|
8
|
+
.option('--json', 'Output as JSON')
|
|
9
|
+
.option('--ndjson', 'Output as newline-delimited JSON')
|
|
10
|
+
.addHelpText('after', `
|
|
11
|
+
The migration endpoint needs a Twist (not Comms) token. Prefer the TWIST_AUTH_TOKEN
|
|
12
|
+
environment variable — a CLI flag exposes the token in process listings. If the
|
|
13
|
+
Twist CLI (tw) is installed, you can populate it inline:
|
|
14
|
+
|
|
15
|
+
Examples:
|
|
16
|
+
TWIST_AUTH_TOKEN="$(tw auth token view)" tdc migrate urls "https://twist.com/a/1/ch/2/t/3,https://twist.com/a/1/ch/2/t/4"
|
|
17
|
+
cat old-urls.txt | TWIST_AUTH_TOKEN="$(tw auth token view)" tdc migrate urls
|
|
18
|
+
tdc migrate urls "https://twist.com/a/1/ch/2/t/3" --json # token from $TWIST_AUTH_TOKEN`)
|
|
19
|
+
.action(migrateUrls);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/migrate/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC,MAAM,UAAU,sBAAsB,CAAC,OAAgB;IACnD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,+BAA+B,CAAC,CAAA;IAEvF,OAAO;SACF,OAAO,CAAC,aAAa,CAAC;SACtB,WAAW,CAAC,qDAAqD,CAAC;SAClE,MAAM,CAAC,uBAAuB,EAAE,gDAAgD,CAAC;SACjF,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;SAClC,MAAM,CAAC,UAAU,EAAE,kCAAkC,CAAC;SACtD,WAAW,CACR,OAAO,EACP;;;;;;;;4FAQgF,CACnF;SACA,MAAM,CAAC,WAAW,CAAC,CAAA;AAC5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urls.d.ts","sourceRoot":"","sources":["../../../src/commands/migrate/urls.ts"],"names":[],"mappings":"AAMA,KAAK,kBAAkB,GAAG;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,MAAM,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAqCD,wBAAsB,WAAW,CAC7B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,EAAE,kBAAkB,GAC5B,OAAO,CAAC,IAAI,CAAC,CA0Df"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { fetchNewCommsUrls } from '@doist/comms-sdk';
|
|
2
|
+
import { CliError } from '../../lib/errors.js';
|
|
3
|
+
import { readStdin } from '../../lib/input.js';
|
|
4
|
+
import { colors, formatJson, formatNdjson } from '../../lib/output.js';
|
|
5
|
+
import { withSpinner } from '../../lib/spinner.js';
|
|
6
|
+
/**
|
|
7
|
+
* Pulls the machine-readable error code out of a {@link CommsRequestError}.
|
|
8
|
+
*
|
|
9
|
+
* Not-migratable URLs come back as `{ error: { code: 'invalid_url' } }` (400) or
|
|
10
|
+
* `{ error: { code: 'not_imported' } }` (404) in `responseData`. Falls back to a
|
|
11
|
+
* stable `API_ERROR` code (the human-readable text stays in `message`) so callers
|
|
12
|
+
* never have to branch on free-form prose.
|
|
13
|
+
*/
|
|
14
|
+
function extractErrorCode(error) {
|
|
15
|
+
const data = error.responseData;
|
|
16
|
+
if (data && typeof data === 'object' && 'error' in data) {
|
|
17
|
+
const inner = data.error;
|
|
18
|
+
if (inner && typeof inner === 'object' && 'code' in inner) {
|
|
19
|
+
const code = inner.code;
|
|
20
|
+
if (typeof code === 'string')
|
|
21
|
+
return code;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return 'API_ERROR';
|
|
25
|
+
}
|
|
26
|
+
/** Splits a comma- or whitespace-separated blob into trimmed, non-empty URLs. */
|
|
27
|
+
function parseUrls(input) {
|
|
28
|
+
return input
|
|
29
|
+
.split(/[\s,]+/)
|
|
30
|
+
.map((url) => url.trim())
|
|
31
|
+
.filter(Boolean);
|
|
32
|
+
}
|
|
33
|
+
export async function migrateUrls(urlsArg, options) {
|
|
34
|
+
// Flag wins over the environment variable, but the env var is the recommended
|
|
35
|
+
// primary method (a CLI flag exposes the token in process listings).
|
|
36
|
+
const twistToken = options.twistToken ?? process.env.TWIST_AUTH_TOKEN;
|
|
37
|
+
if (!twistToken) {
|
|
38
|
+
throw new CliError('NO_TOKEN', 'No Twist token provided.', [
|
|
39
|
+
'Set TWIST_AUTH_TOKEN (e.g. TWIST_AUTH_TOKEN="$(tw auth token view)" — requires the Twist CLI), or',
|
|
40
|
+
'pass --twist-token <token>.',
|
|
41
|
+
]);
|
|
42
|
+
}
|
|
43
|
+
// readStdin() waits briefly for the first byte then reads to end, so an open
|
|
44
|
+
// but empty stdin (CI, spawned children) raises MISSING_CONTENT instead of hanging.
|
|
45
|
+
const rawInput = urlsArg ?? (await readStdin());
|
|
46
|
+
const oldUrls = rawInput ? parseUrls(rawInput) : [];
|
|
47
|
+
if (oldUrls.length === 0) {
|
|
48
|
+
throw new CliError('MISSING_CONTENT', 'No URLs provided.', [
|
|
49
|
+
'Pass a comma-separated list as an argument, or pipe URLs via stdin.',
|
|
50
|
+
]);
|
|
51
|
+
}
|
|
52
|
+
// The migration endpoint lives on Twist; honour TWIST_BASE_URL for staging/tests,
|
|
53
|
+
// mirroring the COMMS_BASE_URL convention used for the Comms API.
|
|
54
|
+
const baseUrl = process.env.TWIST_BASE_URL;
|
|
55
|
+
const results = await withSpinner({ text: 'Migrating URLs...' }, () => fetchNewCommsUrls({ oldUrls, twistToken }, baseUrl ? { baseUrl } : undefined));
|
|
56
|
+
if (options.json || options.ndjson) {
|
|
57
|
+
const output = results.map((result) => result.error
|
|
58
|
+
? {
|
|
59
|
+
oldUrl: result.oldUrl,
|
|
60
|
+
error: {
|
|
61
|
+
code: extractErrorCode(result.error),
|
|
62
|
+
message: result.error.message,
|
|
63
|
+
},
|
|
64
|
+
}
|
|
65
|
+
: { oldUrl: result.oldUrl, newUrl: result.newUrl });
|
|
66
|
+
console.log(options.json ? formatJson(output) : formatNdjson(output));
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
// Iterate results directly for text output — no need to materialise the
|
|
70
|
+
// simplified shape just to print and tally.
|
|
71
|
+
for (const result of results) {
|
|
72
|
+
if (result.error) {
|
|
73
|
+
const label = colors.error(`✗ ${extractErrorCode(result.error)}`);
|
|
74
|
+
console.log(`${result.oldUrl} ${label}`);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
console.log(`${result.oldUrl} -> ${result.newUrl}`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// Surface partial failure to scripts/CI: exit non-zero if any URL failed.
|
|
82
|
+
if (results.some((result) => result.error)) {
|
|
83
|
+
process.exitCode = 1;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=urls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urls.js","sourceRoot":"","sources":["../../../src/commands/migrate/urls.ts"],"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C,MAAM,EAAE,CACzD,CAAA;QACD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAA;IACzE,CAAC;SAAM,CAAC;QACJ,wEAAwE;QACxE,4CAA4C;QAC5C,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC3B,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;gBACf,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;gBACjE,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,KAAK,KAAK,EAAE,CAAC,CAAA;YAC7C,CAAC;iBAAM,CAAC;gBACJ,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,OAAO,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;YACvD,CAAC;QACL,CAAC;IACL,CAAC;IAED,0EAA0E;IAC1E,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;IACxB,CAAC;AACL,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -28,6 +28,7 @@ const loadGroupsCommand = async () => (await import('./commands/groups/index.js'
|
|
|
28
28
|
const loadDoctorCommand = async () => (await import('./commands/doctor.js')).registerDoctorCommand;
|
|
29
29
|
const loadConfigCommand = async () => (await import('./commands/config/index.js')).registerConfigCommand;
|
|
30
30
|
const loadAccountCommand = async () => (await import('./commands/account/index.js')).registerAccountCommand;
|
|
31
|
+
const loadMigrateCommand = async () => (await import('./commands/migrate/index.js')).registerMigrateCommand;
|
|
31
32
|
const commands = {
|
|
32
33
|
workspaces: ['List all workspaces', loadWorkspaceCommand],
|
|
33
34
|
workspace: ['Manage workspace', loadWorkspaceCommand],
|
|
@@ -56,6 +57,7 @@ const commands = {
|
|
|
56
57
|
loadGroupsCommand,
|
|
57
58
|
],
|
|
58
59
|
config: ['Manage CLI configuration', loadConfigCommand],
|
|
60
|
+
migrate: ['Twist→Comms migration helpers (urls)', loadMigrateCommand],
|
|
59
61
|
};
|
|
60
62
|
const commandAliases = {
|
|
61
63
|
channels: 'channel',
|
|
@@ -150,6 +152,7 @@ else {
|
|
|
150
152
|
'account',
|
|
151
153
|
'config',
|
|
152
154
|
'skill',
|
|
155
|
+
'migrate',
|
|
153
156
|
]);
|
|
154
157
|
const wantsRaw = process.argv.slice(2).includes('--raw');
|
|
155
158
|
const needsMarkdown = !noMarkdownCommands.has(commandName) && !isJsonMode() && !isNdjsonMode() && !wantsRaw;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAgB,OAAO,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,GAAG,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC9D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAEtE,MAAM,oBAAoB,GAAG,KAAK,IAAI,EAAE,CACpC,CAAC,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,wBAAwB,CAAA;AACt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,OAAO,CACjC,CAAA;IACL,CAAC;IACD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;AACxB,CAAC,CAAC;KACD,OAAO,CAAC,GAAG,EAAE;IACV,gBAAgB,EAAE,CAAA;AACtB,CAAC,CAAC,CAAA"}
|
|
@@ -3,6 +3,6 @@ export declare const SKILL_DESCRIPTION = "Comms messaging CLI. View and respond
|
|
|
3
3
|
export declare const SKILL_AUTHOR = "Doist";
|
|
4
4
|
export declare const SKILL_LICENSE = "MIT";
|
|
5
5
|
export declare const SKILL_VERSION: string;
|
|
6
|
-
export declare const SKILL_CONTENT = "# Comms CLI (tdc)\n\nAccess Comms messaging via the `tdc` CLI. Use when the user asks about their Comms workspaces, threads, messages, or wants to interact with Comms in any way.\n\n## Setup\n\n```bash\ntdc auth login # OAuth login (standard write scopes)\ntdc auth login --read-only # OAuth login with read-only scope\ntdc auth login --full-access # OAuth login with delete/admin scopes\ntdc auth login --callback-port <n># Override the local OAuth callback port (default 8766)\ntdc auth login --json # Emit a JSON envelope for scripted / agent use\ntdc auth login --ndjson # Emit an NDJSON envelope for scripted / agent use\ntdc auth token # Save API token manually (prompts securely; scope unknown, assumed write-capable)\ntdc auth status # Verify authentication + show mode\ntdc auth status --json # Full status payload as JSON (--ndjson also supported)\ntdc auth status --user <ref> # Target a specific stored account (id, id:<n>, or display name)\ntdc --user <ref> auth <status|logout|token view|refresh-token view> # Equivalent to passing --user after the subcommand; other commands accept the flag but ignore it\ntdc auth logout # Remove saved token and auth metadata\ntdc auth logout --json # Emits `{\"ok\": true}` (--ndjson is silent)\ntdc auth logout --user <ref> # Target a specific stored account; mismatched ref errors with ACCOUNT_NOT_FOUND\ntdc auth token view # Print the saved token to stdout (pipe-safe; refuses if COMMS_API_TOKEN is set)\ntdc auth token view --user <ref> # Print the saved token for a specific stored account\ntdc auth refresh-token view # Print the saved OAuth refresh token to stdout (pipe-safe; OAuth logins only)\ntdc auth refresh-token view --user <ref> # Print the saved OAuth refresh token for a specific stored account\ntdc account [list|current|use <ref>|remove <ref>] # Manage stored accounts; all support --json/--ndjson\n # current's payload is {id, label, authMode, authScope, source:\"config\"} | {source:\"env\"} | {source:\"token-only\"}\ntdc auth login # Re-running auth login with a different OAuth grant adds a NEW account; default stays pinned unless none was set\ntdc workspaces # List available workspaces\ntdc workspace use <ref> # Set current workspace\ntdc completion install # Install shell completions\ntdc config view # Show the current CLI configuration file (token masked)\ntdc config set <key> <value> # Set a user preference (e.g. unarchive-new-threads true)\ntdc doctor # Diagnose CLI setup and environment issues\ntdc update # Update CLI to latest version\ntdc changelog # Show recent changelog entries\n```\n\nOAuth login uses Todoist OAuth for Comms access. The default grant can read Comms data and create/update content or messages. It does not include delete, channel management, or user/workspace write scopes; use `tdc auth login --full-access` only when needed. Stored auth uses the system credential manager when available. If secure storage is unavailable, `tdc` warns and falls back to `~/.config/comms-cli/config.json`. `COMMS_API_TOKEN` always takes priority over the stored token.\n\nIn read-only mode (`tdc auth login --read-only`), commands that modify Comms data (reply, archive, react, delete, etc.) are blocked by the CLI. Externally provided tokens (`COMMS_API_TOKEN` or `tdc auth token`) are treated as unknown scope and assumed write-capable.\n\n## View by URL\n\n```bash\ntdc view <url> # View any Comms entity by URL\n```\n\nRoutes automatically based on URL structure:\n- Message URL \u2192 `tdc msg view`\n- Conversation URL \u2192 `tdc conversation view`\n- Thread+comment URL \u2192 `tdc thread view` (comment ID extracted from URL)\n- Thread URL \u2192 `tdc thread view`\n\nURLs may use either `https://comms.todoist.com/{workspaceId}/...` or `https://comms.todoist.com/a/{workspaceId}/...`.\n\nAll target command flags pass through (e.g. `--json`, `--raw`, `--full`).\n\n## Inbox\n\n```bash\ntdc inbox # Show inbox threads\ntdc inbox --unread # Only unread threads\ntdc inbox --archive-filter all # Show active + done threads\ntdc inbox --archive-filter archived # Show only done threads\ntdc inbox --channel <filter> # Filter by channel name (fuzzy)\ntdc inbox --since <date> # Filter by date (ISO format)\ntdc inbox --limit <n> # Max items (default: 50)\n```\n\n## Threads\n\n```bash\ntdc thread <thread-ref> # View thread (shorthand for view)\ntdc thread view <thread-ref> # View thread with comments\ntdc thread view <ref> --comment <id> # View a specific comment\ntdc thread view <url-with-/c/id> # Comment ID extracted from URL\ntdc thread view <ref> --unread # Show only unread comments\ntdc thread view <ref> --context 3 # Include 3 read comments before unread\ntdc thread view <ref> --limit 20 # Limit number of comments\ntdc thread view <ref> --since <date> # Comments newer than date\ntdc thread view <ref> --raw # Show raw markdown\ntdc thread create <channel-ref> \"Title\" \"content\" # Create a new thread\ntdc thread create <channel-ref> \"Title\" \"content\" --json # Create and return as JSON\ntdc thread create <channel-ref> \"Title\" \"content\" --json --full # Include all thread fields\ntdc thread create <channel-ref> \"Title\" \"content\" --notify 123,456 # Notify specific users and/or groups by ID\ntdc thread create <channel-ref> \"Title\" \"content\" --unarchive # Land thread in author's Inbox (overrides default Comms auto-archive)\ntdc thread create <channel-ref> \"Title\" \"content\" --no-unarchive # Force archive even when userSettings.unarchiveNewThreads=true\ntdc thread create <channel-ref> \"Title\" \"content\" --dry-run # Preview without posting\ntdc thread create <channel-ref> \"Title\" --file ./a.png # Attach a file (repeatable; content optional)\ntdc thread reply <ref> \"content\" # Post a comment (notifies EVERYONE_IN_THREAD by default)\ntdc thread reply <ref> \"content\" --notify EVERYONE # Notify all workspace members\ntdc thread reply <ref> \"content\" --notify 123,id:456 # Notify specific users by ID\ntdc thread reply <ref> \"content\" --notify 123,Cbzzm11ZeYZoJYD4a6rti # Notify a user and a group (group IDs are base58, not numeric)\ntdc thread reply <ref> \"content\" --json # Post and return comment as JSON\ntdc thread reply <ref> \"content\" --json --full # Include all comment fields\ntdc thread reply <ref> \"content\" --close # Reply and close the thread\ntdc thread reply <ref> \"content\" --reopen # Reply and reopen a closed thread\ntdc thread reply <ref> \"content\" --file ./a.png # Attach a file (repeatable; content optional)\ntdc thread done <ref> # Preview thread archive (requires --yes to execute)\ntdc thread done <ref> --yes # Archive thread (mark done)\ntdc thread done <ref> --yes --json # Archive and return status as JSON\ntdc thread mark-read <ref> # Mark a thread read\ntdc thread mark-read <ref> <ref> --yes # Mark multiple threads read\nprintf \"123\\n456\\n\" | tdc thread mark-read --dry-run # Preview bulk mark-read from stdin\ntdc thread mute <ref> # Mute thread for 60 minutes (default)\ntdc thread mute <ref> --minutes 480 # Mute for custom duration\ntdc thread mute <ref> --json # Mute and return { id, mutedUntil } as JSON\ntdc thread mute <ref> --json --full # Mute and return full thread as JSON\ntdc thread unmute <ref> # Unmute a muted thread\ntdc thread unmute <ref> --json # Unmute and return { id, mutedUntil } as JSON\ntdc thread delete <ref> # Preview thread deletion (requires --yes to execute)\ntdc thread delete <ref> --yes # Permanently delete a thread\ntdc thread delete <ref> --yes --json # Delete and return status as JSON\ntdc thread rename <ref> \"New title\" # Rename a thread (change its title)\ntdc thread rename <ref> \"New title\" --json # Rename and return { id, title } as JSON\ntdc thread rename <ref> \"New title\" --json --full # Rename and return full thread as JSON\ntdc thread update <ref> \"New body\" # Update a thread's body (the first post)\necho \"New body\" | tdc thread update <ref> # Update body from stdin\ntdc thread update <ref> \"New body\" --dry-run # Preview without updating\ntdc thread update <ref> \"New body\" --json # Update and return { id, content } as JSON\ntdc thread update <ref> \"New body\" --json --full # Update and return full thread as JSON\n```\n\nDefault `--notify` for reply is EVERYONE_IN_THREAD, which may notify more people than intended. Before posting, confirm with the user whether specific people should be notified instead (via `--notify <ids>`). Options: EVERYONE, EVERYONE_IN_THREAD, or comma-separated user and/or group IDs.\n\n`--notify` automatically resolves IDs: group IDs are routed to the `groups` API field, user IDs to `recipients`. No special syntax needed.\n\n## Thread Comments\n\n```bash\ntdc comment <comment-ref> # View a comment (shorthand for view)\ntdc comment view <comment-ref> # View a single thread comment\ntdc comment view <comment-ref> --raw # Show raw markdown\ntdc comment view <comment-ref> --json # Output as JSON\ntdc comment view <comment-ref> --ndjson # Output as newline-delimited JSON\ntdc comment view <comment-ref> --json --full # Include all fields in JSON output\ntdc comment update <comment-ref> \"new content\" # Update a thread comment\ntdc comment update <comment-ref> \"content\" --json # Update and return updated comment as JSON\ntdc comment update <comment-ref> \"content\" --json --full # Include all comment fields\ntdc comment delete <comment-ref> # Preview comment deletion (requires --yes to execute)\ntdc comment delete <comment-ref> --yes # Delete a thread comment\ntdc comment delete <comment-ref> --yes --json # Delete and return status as JSON\n```\n\n## Conversations (DMs/Groups)\n\n```bash\ntdc conversation unread # List unread conversations\ntdc conversation list # List active conversations (DMs and groups)\ntdc conversation list --kind group # Only group conversations (3+ people)\ntdc conversation list --kind direct # Only 1:1 conversations (and your self-DM)\ntdc conversation list --participant \"Jane\" # Only conversations including these users (comma-separated)\ntdc conversation list --name \"release\" # Filter by title substring (case-insensitive)\ntdc conversation list --state archived # Archived conversations only (active|all|archived; default active)\ntdc conversation list --snippet # Include the latest message snippet\ntdc conversation list --limit 20 --json # Cap rows and output as JSON\ntdc conversation <conversation-ref> # View conversation (shorthand for view)\ntdc conversation view <conversation-ref> # View conversation messages\ntdc conversation with <user-ref> # Find your 1:1 DM with a user\ntdc conversation with <user-ref> --snippet # Include the latest message preview\ntdc conversation with <user-ref> --include-groups # List any conversations with that user\ntdc conversation reply <ref> \"content\" # Send a message\ntdc conversation reply <ref> \"content\" --json # Send and return message as JSON\ntdc conversation reply <ref> \"content\" --json --full # Include all message fields\ntdc conversation reply <ref> \"content\" --file ./a.png # Attach a file (repeatable; content optional)\ntdc conversation done <ref> # Preview conversation archive (requires --yes to execute)\ntdc conversation done <ref> --yes # Archive conversation\ntdc conversation done <ref> --yes --json # Archive and return status as JSON\ntdc conversation mute <ref> # Mute conversation for 60 minutes (default)\ntdc conversation mute <ref> --minutes 480 # Mute for custom duration\ntdc conversation mute <ref> --json # Mute and return { id, mutedUntil } as JSON\ntdc conversation mute <ref> --json --full # Mute and return full conversation as JSON\ntdc conversation unmute <ref> # Unmute a muted conversation\ntdc conversation unmute <ref> --json # Unmute and return { id, mutedUntil } as JSON\n```\n\nAlias: `tdc convo` works the same as `tdc conversation`.\n\n## Conversation Messages\n\n```bash\ntdc msg <message-ref> # View a message (shorthand for view)\ntdc msg view <message-ref> # View a single conversation message\ntdc msg update <ref> \"content\" # Edit a conversation message\ntdc msg update <ref> \"content\" --json # Edit and return updated message as JSON\ntdc msg update <ref> \"content\" --json --full # Include all message fields\ntdc msg delete <ref> # Preview message deletion (requires --yes to execute)\ntdc msg delete <ref> --yes # Delete a conversation message\ntdc msg delete <ref> --yes --json # Delete and return status as JSON\n```\n\nAlias: `tdc message` works the same as `tdc msg`.\n\n## Search\n\n```bash\ntdc mentions # Show content mentioning current user\ntdc mentions --since 2026-04-01 --all # Fetch every mention since a date\ntdc mentions --type threads --json # Limit mentions to threads\ntdc search \"query\" # Search content\ntdc search \"query\" --type threads # Filter: threads, messages, or all\ntdc search \"query\" --author <ref> # Filter by author\ntdc search \"query\" --to <ref> # Messages sent to user\ntdc search \"query\" --title-only # Search thread titles only\ntdc search \"query\" --mention-me # Results mentioning current user\ntdc search \"query\" --conversation <refs> # Limit to conversations (comma-separated refs)\ntdc search \"query\" --since <date> # Content from date\ntdc search \"query\" --until <date> # Content until date\ntdc search \"query\" --channel <refs> # Filter by channel refs (comma-separated)\ntdc search \"query\" --limit <n> # Max results (default: 50)\ntdc search \"query\" --cursor <cur> # Pagination cursor\ntdc search \"query\" --all # Fetch all result pages\n```\n\n## Users, Channels & Groups\n\n```bash\ntdc user # Show current user info\ntdc user --json # JSON output\ntdc user --json --full # Include all fields in JSON output\ntdc users # List active workspace users\ntdc users --search <text> # Filter by name/email\ntdc users --include-removed # Include users removed from the workspace\ntdc channels # List active joined workspace channels (alias of: tdc channel list)\ntdc channels --state all # Include archived joined channels too\ntdc channels --scope discoverable # Active public channels you can see but have not joined\ntdc channels --scope public --state all --json # All visible public channels, with joined status\ntdc channel create \"Engineering\" # Create a channel in the current workspace\ntdc channel create \"Leadership Team\" --private --users id:10,id:20 # Create private channel with initial members\ntdc channel create \"Product\" --workspace \"Doist\" --description \"Product discussions\" --json # Create and return channel as JSON\ntdc channel update <channel-ref> \"New name\" # Rename a channel\ntdc channel update <ref> --name \"New name\" # Rename with an explicit flag\ntdc channel update <ref> --description \"Team discussions\" # Update channel description\ntdc channel update <ref> --clear-description # Clear channel description\ntdc channel update <ref> --public # Make a channel public (--private makes it private)\ntdc channel update <ref> --description \"Team discussions\" --json --full # Update and return all channel fields\ntdc channel delete <channel-ref> --yes # Permanently delete a channel (requires --yes; usually admin-only)\ntdc channel delete <ref> --dry-run # Preview deletion\ntdc channel archive <channel-ref> # Archive a channel (no-op if already archived)\ntdc channel unarchive id:<id> # Unarchive a channel (pass id:/numeric ref for archived channels)\ntdc channel threads <channel-ref> # List threads in a channel (fuzzy name, id:, numeric ID, or URL)\ntdc channel threads \"general\" --unread # Only unread threads\ntdc channel threads <ref> --archive-filter all # Include archived threads (active|archived|all)\ntdc channel threads <ref> --since 2026-01-01 # Filter by last-updated date (ISO)\ntdc channel threads <ref> --limit 20 # Max threads per page (default: 50)\ntdc channel threads <ref> --limit 20 --cursor <cursor-from-prev> # Paginate\ntdc channel threads <ref> --json # { results, nextCursor } with isUnread + url\ntdc channel members <channel-ref> # List a channel's members + groups fully in the channel\ntdc channel members <ref> --json # JSON with id, name, workspaceId, members\ntdc channel members add <ref> alice group:Design # Add users and/or expand group:<ref> members\ntdc channel members add <ref> a@d.com id:789 --json # Add refs, output result as JSON\ntdc channel members remove <ref> alice group:Frontend # Remove users and/or group members\ntdc channel members set <ref> group:Squad --apply # Replace membership with the resolved set\ntdc channel members set <ref> alice bob # Dry-run by default; refuses to remove you (--include-self to override)\ntdc groups # List workspace groups\ntdc groups --search \"frontend\" # Filter groups by name (case-insensitive)\ntdc groups --json # JSON output\ntdc groups --json --full # Include all fields in JSON output\ntdc groups view <group-ref> # Show group with member details\ntdc groups view <ref> --json # JSON output with id, name, workspaceId, members\ntdc groups view <ref> --json --full # Include all fields in JSON output\ntdc groups create \"Name\" # Create a new group\ntdc groups create \"Name\" --users alice@doist.com,bob@doist.com # Create with members\ntdc groups create \"Name\" --json # Output created group as JSON\ntdc groups rename <group-ref> \"New name\" # Rename a group\ntdc groups rename <ref> \"Name\" --json # Output renamed group as JSON\ntdc groups delete <group-ref> --yes # Delete a group (requires --yes)\ntdc groups delete <ref> --dry-run # Preview deletion\ntdc groups add-user <group-ref> user1 user2 # Add users to a group\ntdc groups add-user <ref> a@d.com,b@d.com # Comma-separated refs\ntdc groups add-user <ref> id:123 --json # Output result as JSON\ntdc groups remove-user <group-ref> user1 user2 # Remove users from a group\ntdc groups remove-user <ref> id:123,id:456 # Comma-separated ID refs\n```\n\nIf a channel is not found in `tdc channels`, widen with broader listings such as `tdc channels --scope public`, then `tdc channels --scope public --state all`. Check `tdc channels --help` for other available filters.\n\n`tdc channel threads` returns every thread in the channel; pagination filters (`--limit`, `--cursor`, `--since`, `--until`, `--unread`) are applied client-side after fetch. `--archive-filter` is applied server-side. Results are sorted newest-first by last activity. In `--json` / `--ndjson`, the response includes a `nextCursor` string (opaque) you can pass via `--cursor` to fetch the next page; NDJSON emits the cursor as a final `{ \"_meta\": true, \"nextCursor\": \"...\" }` line.\n\nFor `tdc channel members add/remove/set`, refs accept user identifiers (`id:N`, email, name) or `group:<ref>`, which expands to the group's current members. Group expansion is one-shot \u2014 it is not a persistent link, so users added to the group later will not auto-join the channel. `set` replaces membership with the resolved set and is dry-run by default (pass `--apply` to mutate); it refuses to remove the acting user unless `--include-self` is passed.\n\n## Reactions\n\n```bash\ntdc react thread <ref> \uD83D\uDC4D # Add reaction to thread\ntdc react comment <ref> +1 # Add reaction (shortcode)\ntdc react message <ref> heart # Add reaction to DM message\ntdc react thread <ref> \uD83D\uDC4D --json # Output result as JSON\ntdc unreact thread <ref> \uD83D\uDC4D # Remove reaction\ntdc unreact thread <ref> \uD83D\uDC4D --json # Output result as JSON\n```\n\nSupported shortcodes: +1, -1, heart, tada, smile, laughing, thinking, fire, check, x, eyes, pray, clap, rocket, wave\n\n## Shell Completions\n\n```bash\ntdc completion install # Install tab completions (prompts for shell)\ntdc completion install bash # Install for specific shell\ntdc completion install zsh\ntdc completion install fish\ntdc completion uninstall # Remove completions\n```\n\n### Diagnostics\n\n```bash\ntdc doctor # Run local + network diagnostics\ntdc doctor --offline # Skip Comms and npm network checks\ntdc doctor --json # JSON output with per-check results\n```\n\n### Configuration\n\n```bash\ntdc config view # Pretty-printed config, token masked, labels actual token source\ntdc config view --json # Raw JSON, token masked\ntdc config view --show-token # Include the full token\ntdc config set unarchive-new-threads true # Persist: always unarchive new threads so they land in your Inbox\ntdc config set unarchive-new-threads false # Persist: keep Comms's default (thread auto-archived for author)\n```\n\nUser preferences are stored under `userSettings` in the config file. Currently supported keys: `unarchive-new-threads`. The flag on `tdc thread create` (`--unarchive` / `--no-unarchive`) overrides this default per-invocation.\n\n### Update\n\n```bash\ntdc update # Update CLI to latest version\ntdc update --check # Check for updates without installing, show channel\ntdc update --check --json # Same, JSON envelope\ntdc update --check --ndjson # Same, newline-delimited JSON envelope\ntdc update --channel # Show current update channel\ntdc update switch --stable # Switch to stable release channel\ntdc update switch --pre-release # Switch to pre-release (next) channel\ntdc update switch --pre-release --json # Same, JSON envelope\ntdc update switch --pre-release --ndjson # Same, newline-delimited JSON envelope\n```\n\n### Changelog\n```bash\ntdc changelog # Show last 5 versions\ntdc changelog -n 3 # Show last 3 versions\ntdc changelog --count 10 # Show last 10 versions\n```\n\n## Global Options\n\n```bash\n--no-spinner # Disable loading animations\n--progress-jsonl # Machine-readable progress events (JSONL to stderr)\n--progress-jsonl=<path> # Same, but write events to <path> instead of stderr\n--progress-jsonl <path> # Same as above (space-separated form also accepted)\n--accessible # Add text labels to color-coded output (also: TDC_ACCESSIBLE=1)\n--non-interactive # Disable interactive prompts (auto-detected when stdin is not a TTY)\n--interactive # Force interactive mode even when stdin is not a TTY\n```\n\n## Output Formats\n\nAll list/view commands support:\n\n```bash\n--json # Output as JSON\n--ndjson # Output as newline-delimited JSON (for streaming)\n--full # Include all fields (default shows essential fields only)\n```\n\n## Dry Run\n\nMutating commands accept `--dry-run` to preview the operation without making the change. Where a command performs pre-flight validation (e.g. fetching the target thread to check channel access or ownership), those checks still run in dry-run \u2014 only the mutating write is skipped. Commands that have no pre-flight validation parse the reference and print the preview without hitting the API. The preview is structured:\n\n```\n[dry-run] Would <action>:\n <Key>: <resolved value>\n ...\nRun without --dry-run to execute.\n```\n\n## Reference System\n\nCommands accept flexible references:\n- **Numeric IDs**: `123` or `id:123`\n- **Comms URLs**: Full `https://comms.todoist.com/...` URLs (parsed automatically)\n- **Fuzzy names**: For workspaces/users - `\"My Workspace\"` or partial matches\n\n## Piping Input\n\nCommands that accept content (`thread create`, `thread reply`, `comment update`, `conversation reply`, `msg update`) auto-detect piped stdin:\n\n```bash\ncat notes.md | tdc thread reply <ref>\ntdc thread create <channel-ref> \"Title\" < body.md\necho \"Quick reply\" | tdc conversation reply <ref>\n```\n\nIf no content argument is provided and no stdin is piped, the CLI opens `$EDITOR` for interactive input. In non-TTY environments (e.g. when called by an agent or in a pipeline), the editor is automatically skipped and the command fails fast with an actionable error message. Use `--non-interactive` to force this behavior even in a TTY, or `--interactive` to override auto-detection.\n\n`tdc thread mark-read` also accepts thread refs from stdin, one per line:\n\n```bash\nprintf \"123\\n456\\n\" | tdc thread mark-read --yes\n```\n\n## Common Workflows\n\n**View by URL (auto-routes to the right command):**\n```bash\ntdc view https://comms.todoist.com/1585/ch/100/t/200 # View thread\ntdc view https://comms.todoist.com/a/1585/ch/100/t/200 # View thread\ntdc view https://comms.todoist.com/a/1585/ch/100/t/200/c/300 # View comment\ntdc view https://comms.todoist.com/a/1585/msg/400 # View conversation\ntdc view https://comms.todoist.com/a/1585/msg/400/m/500 --json # View message as JSON\n```\n\n**Check inbox and respond:**\n```bash\ntdc inbox --unread --json\ntdc thread view <id> --unread\ntdc thread reply <id> \"Thanks, I'll look into this.\"\ntdc thread done <id> --yes\n```\n\n**Search and review:**\n```bash\ntdc mentions --since 2026-04-01 --all --json\ntdc search \"deployment\" --type threads --json\ntdc thread view <thread-id>\n```\n\n**Check DMs:**\n```bash\ntdc conversation unread --json\ntdc conversation list --kind group --json # find a group DM by participants/name\ntdc conversation view <conversation-id>\ntdc conversation with \"Alice Example\"\ntdc conversation reply <id> \"Got it, thanks!\"\n```\n";
|
|
6
|
+
export declare const SKILL_CONTENT = "# Comms CLI (tdc)\n\nAccess Comms messaging via the `tdc` CLI. Use when the user asks about their Comms workspaces, threads, messages, or wants to interact with Comms in any way.\n\n## Setup\n\n```bash\ntdc auth login # OAuth login (standard write scopes)\ntdc auth login --read-only # OAuth login with read-only scope\ntdc auth login --full-access # OAuth login with delete/admin scopes\ntdc auth login --callback-port <n># Override the local OAuth callback port (default 8766)\ntdc auth login --json # Emit a JSON envelope for scripted / agent use\ntdc auth login --ndjson # Emit an NDJSON envelope for scripted / agent use\ntdc auth token # Save API token manually (prompts securely; scope unknown, assumed write-capable)\ntdc auth status # Verify authentication + show mode\ntdc auth status --json # Full status payload as JSON (--ndjson also supported)\ntdc auth status --user <ref> # Target a specific stored account (id, id:<n>, or display name)\ntdc --user <ref> auth <status|logout|token view|refresh-token view> # Equivalent to passing --user after the subcommand; other commands accept the flag but ignore it\ntdc auth logout # Remove saved token and auth metadata\ntdc auth logout --json # Emits `{\"ok\": true}` (--ndjson is silent)\ntdc auth logout --user <ref> # Target a specific stored account; mismatched ref errors with ACCOUNT_NOT_FOUND\ntdc auth token view # Print the saved token to stdout (pipe-safe; refuses if COMMS_API_TOKEN is set)\ntdc auth token view --user <ref> # Print the saved token for a specific stored account\ntdc auth refresh-token view # Print the saved OAuth refresh token to stdout (pipe-safe; OAuth logins only)\ntdc auth refresh-token view --user <ref> # Print the saved OAuth refresh token for a specific stored account\ntdc account [list|current|use <ref>|remove <ref>] # Manage stored accounts; all support --json/--ndjson\n # current's payload is {id, label, authMode, authScope, source:\"config\"} | {source:\"env\"} | {source:\"token-only\"}\ntdc auth login # Re-running auth login with a different OAuth grant adds a NEW account; default stays pinned unless none was set\ntdc workspaces # List available workspaces\ntdc workspace use <ref> # Set current workspace\ntdc completion install # Install shell completions\ntdc config view # Show the current CLI configuration file (token masked)\ntdc config set <key> <value> # Set a user preference (e.g. unarchive-new-threads true)\ntdc doctor # Diagnose CLI setup and environment issues\ntdc update # Update CLI to latest version\ntdc changelog # Show recent changelog entries\ntdc migrate urls <urls> # Translate old twist.com URLs to Comms URLs (needs a Twist token)\n```\n\nOAuth login uses Todoist OAuth for Comms access. The default grant can read Comms data and create/update content or messages. It does not include delete, channel management, or user/workspace write scopes; use `tdc auth login --full-access` only when needed. Stored auth uses the system credential manager when available. If secure storage is unavailable, `tdc` warns and falls back to `~/.config/comms-cli/config.json`. `COMMS_API_TOKEN` always takes priority over the stored token.\n\nIn read-only mode (`tdc auth login --read-only`), commands that modify Comms data (reply, archive, react, delete, etc.) are blocked by the CLI. Externally provided tokens (`COMMS_API_TOKEN` or `tdc auth token`) are treated as unknown scope and assumed write-capable.\n\n## View by URL\n\n```bash\ntdc view <url> # View any Comms entity by URL\n```\n\nRoutes automatically based on URL structure:\n- Message URL \u2192 `tdc msg view`\n- Conversation URL \u2192 `tdc conversation view`\n- Thread+comment URL \u2192 `tdc thread view` (comment ID extracted from URL)\n- Thread URL \u2192 `tdc thread view`\n\nURLs may use either `https://comms.todoist.com/{workspaceId}/...` or `https://comms.todoist.com/a/{workspaceId}/...`.\n\nAll target command flags pass through (e.g. `--json`, `--raw`, `--full`).\n\n## Inbox\n\n```bash\ntdc inbox # Show inbox threads\ntdc inbox --unread # Only unread threads\ntdc inbox --archive-filter all # Show active + done threads\ntdc inbox --archive-filter archived # Show only done threads\ntdc inbox --channel <filter> # Filter by channel name (fuzzy)\ntdc inbox --since <date> # Filter by date (ISO format)\ntdc inbox --limit <n> # Max items (default: 50)\n```\n\n## Threads\n\n```bash\ntdc thread <thread-ref> # View thread (shorthand for view)\ntdc thread view <thread-ref> # View thread with comments\ntdc thread view <ref> --comment <id> # View a specific comment\ntdc thread view <url-with-/c/id> # Comment ID extracted from URL\ntdc thread view <ref> --unread # Show only unread comments\ntdc thread view <ref> --context 3 # Include 3 read comments before unread\ntdc thread view <ref> --limit 20 # Limit number of comments\ntdc thread view <ref> --since <date> # Comments newer than date\ntdc thread view <ref> --raw # Show raw markdown\ntdc thread create <channel-ref> \"Title\" \"content\" # Create a new thread\ntdc thread create <channel-ref> \"Title\" \"content\" --json # Create and return as JSON\ntdc thread create <channel-ref> \"Title\" \"content\" --json --full # Include all thread fields\ntdc thread create <channel-ref> \"Title\" \"content\" --notify 123,456 # Notify specific users and/or groups by ID\ntdc thread create <channel-ref> \"Title\" \"content\" --unarchive # Land thread in author's Inbox (overrides default Comms auto-archive)\ntdc thread create <channel-ref> \"Title\" \"content\" --no-unarchive # Force archive even when userSettings.unarchiveNewThreads=true\ntdc thread create <channel-ref> \"Title\" \"content\" --dry-run # Preview without posting\ntdc thread create <channel-ref> \"Title\" --file ./a.png # Attach a file (repeatable; content optional)\ntdc thread reply <ref> \"content\" # Post a comment (notifies EVERYONE_IN_THREAD by default)\ntdc thread reply <ref> \"content\" --notify EVERYONE # Notify all workspace members\ntdc thread reply <ref> \"content\" --notify 123,id:456 # Notify specific users by ID\ntdc thread reply <ref> \"content\" --notify 123,Cbzzm11ZeYZoJYD4a6rti # Notify a user and a group (group IDs are base58, not numeric)\ntdc thread reply <ref> \"content\" --json # Post and return comment as JSON\ntdc thread reply <ref> \"content\" --json --full # Include all comment fields\ntdc thread reply <ref> \"content\" --close # Reply and close the thread\ntdc thread reply <ref> \"content\" --reopen # Reply and reopen a closed thread\ntdc thread reply <ref> \"content\" --file ./a.png # Attach a file (repeatable; content optional)\ntdc thread done <ref> # Preview thread archive (requires --yes to execute)\ntdc thread done <ref> --yes # Archive thread (mark done)\ntdc thread done <ref> --yes --json # Archive and return status as JSON\ntdc thread mark-read <ref> # Mark a thread read\ntdc thread mark-read <ref> <ref> --yes # Mark multiple threads read\nprintf \"123\\n456\\n\" | tdc thread mark-read --dry-run # Preview bulk mark-read from stdin\ntdc thread mute <ref> # Mute thread for 60 minutes (default)\ntdc thread mute <ref> --minutes 480 # Mute for custom duration\ntdc thread mute <ref> --json # Mute and return { id, mutedUntil } as JSON\ntdc thread mute <ref> --json --full # Mute and return full thread as JSON\ntdc thread unmute <ref> # Unmute a muted thread\ntdc thread unmute <ref> --json # Unmute and return { id, mutedUntil } as JSON\ntdc thread delete <ref> # Preview thread deletion (requires --yes to execute)\ntdc thread delete <ref> --yes # Permanently delete a thread\ntdc thread delete <ref> --yes --json # Delete and return status as JSON\ntdc thread rename <ref> \"New title\" # Rename a thread (change its title)\ntdc thread rename <ref> \"New title\" --json # Rename and return { id, title } as JSON\ntdc thread rename <ref> \"New title\" --json --full # Rename and return full thread as JSON\ntdc thread update <ref> \"New body\" # Update a thread's body (the first post)\necho \"New body\" | tdc thread update <ref> # Update body from stdin\ntdc thread update <ref> \"New body\" --dry-run # Preview without updating\ntdc thread update <ref> \"New body\" --json # Update and return { id, content } as JSON\ntdc thread update <ref> \"New body\" --json --full # Update and return full thread as JSON\n```\n\nDefault `--notify` for reply is EVERYONE_IN_THREAD, which may notify more people than intended. Before posting, confirm with the user whether specific people should be notified instead (via `--notify <ids>`). Options: EVERYONE, EVERYONE_IN_THREAD, or comma-separated user and/or group IDs.\n\n`--notify` automatically resolves IDs: group IDs are routed to the `groups` API field, user IDs to `recipients`. No special syntax needed.\n\n## Thread Comments\n\n```bash\ntdc comment <comment-ref> # View a comment (shorthand for view)\ntdc comment view <comment-ref> # View a single thread comment\ntdc comment view <comment-ref> --raw # Show raw markdown\ntdc comment view <comment-ref> --json # Output as JSON\ntdc comment view <comment-ref> --ndjson # Output as newline-delimited JSON\ntdc comment view <comment-ref> --json --full # Include all fields in JSON output\ntdc comment update <comment-ref> \"new content\" # Update a thread comment\ntdc comment update <comment-ref> \"content\" --json # Update and return updated comment as JSON\ntdc comment update <comment-ref> \"content\" --json --full # Include all comment fields\ntdc comment delete <comment-ref> # Preview comment deletion (requires --yes to execute)\ntdc comment delete <comment-ref> --yes # Delete a thread comment\ntdc comment delete <comment-ref> --yes --json # Delete and return status as JSON\n```\n\n## Conversations (DMs/Groups)\n\n```bash\ntdc conversation unread # List unread conversations\ntdc conversation list # List active conversations (DMs and groups)\ntdc conversation list --kind group # Only group conversations (3+ people)\ntdc conversation list --kind direct # Only 1:1 conversations (and your self-DM)\ntdc conversation list --participant \"Jane\" # Only conversations including these users (comma-separated)\ntdc conversation list --name \"release\" # Filter by title substring (case-insensitive)\ntdc conversation list --state archived # Archived conversations only (active|all|archived; default active)\ntdc conversation list --snippet # Include the latest message snippet\ntdc conversation list --limit 20 --json # Cap rows and output as JSON\ntdc conversation <conversation-ref> # View conversation (shorthand for view)\ntdc conversation view <conversation-ref> # View conversation messages\ntdc conversation with <user-ref> # Find your 1:1 DM with a user\ntdc conversation with <user-ref> --snippet # Include the latest message preview\ntdc conversation with <user-ref> --include-groups # List any conversations with that user\ntdc conversation reply <ref> \"content\" # Send a message\ntdc conversation reply <ref> \"content\" --json # Send and return message as JSON\ntdc conversation reply <ref> \"content\" --json --full # Include all message fields\ntdc conversation reply <ref> \"content\" --file ./a.png # Attach a file (repeatable; content optional)\ntdc conversation done <ref> # Preview conversation archive (requires --yes to execute)\ntdc conversation done <ref> --yes # Archive conversation\ntdc conversation done <ref> --yes --json # Archive and return status as JSON\ntdc conversation mute <ref> # Mute conversation for 60 minutes (default)\ntdc conversation mute <ref> --minutes 480 # Mute for custom duration\ntdc conversation mute <ref> --json # Mute and return { id, mutedUntil } as JSON\ntdc conversation mute <ref> --json --full # Mute and return full conversation as JSON\ntdc conversation unmute <ref> # Unmute a muted conversation\ntdc conversation unmute <ref> --json # Unmute and return { id, mutedUntil } as JSON\n```\n\nAlias: `tdc convo` works the same as `tdc conversation`.\n\n## Conversation Messages\n\n```bash\ntdc msg <message-ref> # View a message (shorthand for view)\ntdc msg view <message-ref> # View a single conversation message\ntdc msg update <ref> \"content\" # Edit a conversation message\ntdc msg update <ref> \"content\" --json # Edit and return updated message as JSON\ntdc msg update <ref> \"content\" --json --full # Include all message fields\ntdc msg delete <ref> # Preview message deletion (requires --yes to execute)\ntdc msg delete <ref> --yes # Delete a conversation message\ntdc msg delete <ref> --yes --json # Delete and return status as JSON\n```\n\nAlias: `tdc message` works the same as `tdc msg`.\n\n## Search\n\n```bash\ntdc mentions # Show content mentioning current user\ntdc mentions --since 2026-04-01 --all # Fetch every mention since a date\ntdc mentions --type threads --json # Limit mentions to threads\ntdc search \"query\" # Search content\ntdc search \"query\" --type threads # Filter: threads, messages, or all\ntdc search \"query\" --author <ref> # Filter by author\ntdc search \"query\" --to <ref> # Messages sent to user\ntdc search \"query\" --title-only # Search thread titles only\ntdc search \"query\" --mention-me # Results mentioning current user\ntdc search \"query\" --conversation <refs> # Limit to conversations (comma-separated refs)\ntdc search \"query\" --since <date> # Content from date\ntdc search \"query\" --until <date> # Content until date\ntdc search \"query\" --channel <refs> # Filter by channel refs (comma-separated)\ntdc search \"query\" --limit <n> # Max results (default: 50)\ntdc search \"query\" --cursor <cur> # Pagination cursor\ntdc search \"query\" --all # Fetch all result pages\n```\n\n## Users, Channels & Groups\n\n```bash\ntdc user # Show current user info\ntdc user --json # JSON output\ntdc user --json --full # Include all fields in JSON output\ntdc users # List active workspace users\ntdc users --search <text> # Filter by name/email\ntdc users --include-removed # Include users removed from the workspace\ntdc channels # List active joined workspace channels (alias of: tdc channel list)\ntdc channels --state all # Include archived joined channels too\ntdc channels --scope discoverable # Active public channels you can see but have not joined\ntdc channels --scope public --state all --json # All visible public channels, with joined status\ntdc channel create \"Engineering\" # Create a channel in the current workspace\ntdc channel create \"Leadership Team\" --private --users id:10,id:20 # Create private channel with initial members\ntdc channel create \"Product\" --workspace \"Doist\" --description \"Product discussions\" --json # Create and return channel as JSON\ntdc channel update <channel-ref> \"New name\" # Rename a channel\ntdc channel update <ref> --name \"New name\" # Rename with an explicit flag\ntdc channel update <ref> --description \"Team discussions\" # Update channel description\ntdc channel update <ref> --clear-description # Clear channel description\ntdc channel update <ref> --public # Make a channel public (--private makes it private)\ntdc channel update <ref> --description \"Team discussions\" --json --full # Update and return all channel fields\ntdc channel delete <channel-ref> --yes # Permanently delete a channel (requires --yes; usually admin-only)\ntdc channel delete <ref> --dry-run # Preview deletion\ntdc channel archive <channel-ref> # Archive a channel (no-op if already archived)\ntdc channel unarchive id:<id> # Unarchive a channel (pass id:/numeric ref for archived channels)\ntdc channel threads <channel-ref> # List threads in a channel (fuzzy name, id:, numeric ID, or URL)\ntdc channel threads \"general\" --unread # Only unread threads\ntdc channel threads <ref> --archive-filter all # Include archived threads (active|archived|all)\ntdc channel threads <ref> --since 2026-01-01 # Filter by last-updated date (ISO)\ntdc channel threads <ref> --limit 20 # Max threads per page (default: 50)\ntdc channel threads <ref> --limit 20 --cursor <cursor-from-prev> # Paginate\ntdc channel threads <ref> --json # { results, nextCursor } with isUnread + url\ntdc channel members <channel-ref> # List a channel's members + groups fully in the channel\ntdc channel members <ref> --json # JSON with id, name, workspaceId, members\ntdc channel members add <ref> alice group:Design # Add users and/or expand group:<ref> members\ntdc channel members add <ref> a@d.com id:789 --json # Add refs, output result as JSON\ntdc channel members remove <ref> alice group:Frontend # Remove users and/or group members\ntdc channel members set <ref> group:Squad --apply # Replace membership with the resolved set\ntdc channel members set <ref> alice bob # Dry-run by default; refuses to remove you (--include-self to override)\ntdc groups # List workspace groups\ntdc groups --search \"frontend\" # Filter groups by name (case-insensitive)\ntdc groups --json # JSON output\ntdc groups --json --full # Include all fields in JSON output\ntdc groups view <group-ref> # Show group with member details\ntdc groups view <ref> --json # JSON output with id, name, workspaceId, members\ntdc groups view <ref> --json --full # Include all fields in JSON output\ntdc groups create \"Name\" # Create a new group\ntdc groups create \"Name\" --users alice@doist.com,bob@doist.com # Create with members\ntdc groups create \"Name\" --json # Output created group as JSON\ntdc groups rename <group-ref> \"New name\" # Rename a group\ntdc groups rename <ref> \"Name\" --json # Output renamed group as JSON\ntdc groups delete <group-ref> --yes # Delete a group (requires --yes)\ntdc groups delete <ref> --dry-run # Preview deletion\ntdc groups add-user <group-ref> user1 user2 # Add users to a group\ntdc groups add-user <ref> a@d.com,b@d.com # Comma-separated refs\ntdc groups add-user <ref> id:123 --json # Output result as JSON\ntdc groups remove-user <group-ref> user1 user2 # Remove users from a group\ntdc groups remove-user <ref> id:123,id:456 # Comma-separated ID refs\n```\n\nIf a channel is not found in `tdc channels`, widen with broader listings such as `tdc channels --scope public`, then `tdc channels --scope public --state all`. Check `tdc channels --help` for other available filters.\n\n`tdc channel threads` returns every thread in the channel; pagination filters (`--limit`, `--cursor`, `--since`, `--until`, `--unread`) are applied client-side after fetch. `--archive-filter` is applied server-side. Results are sorted newest-first by last activity. In `--json` / `--ndjson`, the response includes a `nextCursor` string (opaque) you can pass via `--cursor` to fetch the next page; NDJSON emits the cursor as a final `{ \"_meta\": true, \"nextCursor\": \"...\" }` line.\n\nFor `tdc channel members add/remove/set`, refs accept user identifiers (`id:N`, email, name) or `group:<ref>`, which expands to the group's current members. Group expansion is one-shot \u2014 it is not a persistent link, so users added to the group later will not auto-join the channel. `set` replaces membership with the resolved set and is dry-run by default (pass `--apply` to mutate); it refuses to remove the acting user unless `--include-self` is passed.\n\n## Reactions\n\n```bash\ntdc react thread <ref> \uD83D\uDC4D # Add reaction to thread\ntdc react comment <ref> +1 # Add reaction (shortcode)\ntdc react message <ref> heart # Add reaction to DM message\ntdc react thread <ref> \uD83D\uDC4D --json # Output result as JSON\ntdc unreact thread <ref> \uD83D\uDC4D # Remove reaction\ntdc unreact thread <ref> \uD83D\uDC4D --json # Output result as JSON\n```\n\nSupported shortcodes: +1, -1, heart, tada, smile, laughing, thinking, fire, check, x, eyes, pray, clap, rocket, wave\n\n## Shell Completions\n\n```bash\ntdc completion install # Install tab completions (prompts for shell)\ntdc completion install bash # Install for specific shell\ntdc completion install zsh\ntdc completion install fish\ntdc completion uninstall # Remove completions\n```\n\n### Diagnostics\n\n```bash\ntdc doctor # Run local + network diagnostics\ntdc doctor --offline # Skip Comms and npm network checks\ntdc doctor --json # JSON output with per-check results\n```\n\n### Configuration\n\n```bash\ntdc config view # Pretty-printed config, token masked, labels actual token source\ntdc config view --json # Raw JSON, token masked\ntdc config view --show-token # Include the full token\ntdc config set unarchive-new-threads true # Persist: always unarchive new threads so they land in your Inbox\ntdc config set unarchive-new-threads false # Persist: keep Comms's default (thread auto-archived for author)\n```\n\nUser preferences are stored under `userSettings` in the config file. Currently supported keys: `unarchive-new-threads`. The flag on `tdc thread create` (`--unarchive` / `--no-unarchive`) overrides this default per-invocation.\n\n### Update\n\n```bash\ntdc update # Update CLI to latest version\ntdc update --check # Check for updates without installing, show channel\ntdc update --check --json # Same, JSON envelope\ntdc update --check --ndjson # Same, newline-delimited JSON envelope\ntdc update --channel # Show current update channel\ntdc update switch --stable # Switch to stable release channel\ntdc update switch --pre-release # Switch to pre-release (next) channel\ntdc update switch --pre-release --json # Same, JSON envelope\ntdc update switch --pre-release --ndjson # Same, newline-delimited JSON envelope\n```\n\n### Changelog\n```bash\ntdc changelog # Show last 5 versions\ntdc changelog -n 3 # Show last 3 versions\ntdc changelog --count 10 # Show last 10 versions\n```\n\n## Migration\n\nTranslate old `twist.com` URLs to their Comms equivalents (e.g. for rewriting bookmarks or history). The migration endpoint authenticates with a **Twist** token (not a Comms one). Prefer the `TWIST_AUTH_TOKEN` environment variable \u2014 a CLI flag exposes the token in process listings. `--twist-token` is supported for ad-hoc use and overrides the env var. If the Twist CLI (`tw`) is installed, populate the env var inline with `TWIST_AUTH_TOKEN=\"$(tw auth token view)\"`.\n\n```bash\n# Comma-separated list as an argument (token from the environment)\nTWIST_AUTH_TOKEN=\"$(tw auth token view)\" tdc migrate urls \"https://twist.com/a/1/ch/2/t/3,https://twist.com/a/1/ch/2/t/4\"\n\n# Or pipe URLs via stdin (comma- or newline-separated)\ncat old-urls.txt | TWIST_AUTH_TOKEN=\"$(tw auth token view)\" tdc migrate urls\n\n# --twist-token overrides the env var (visible in process lists \u2014 prefer the env var)\ntdc migrate urls \"https://twist.com/a/1/ch/2/t/3\" --twist-token <token>\n\ntdc migrate urls \"<urls>\" --json # Structured output ({ oldUrl, newUrl } / { oldUrl, error })\ntdc migrate urls \"<urls>\" --ndjson # Newline-delimited JSON\n```\n\nOutput is one line per URL in input order: `old -> new` on success, `old \u2717 <code>` on failure (`invalid_url` / `not_imported`, or `API_ERROR` when the endpoint gives no code). Per-URL failures don't abort the run; the command exits non-zero if any URL fails to migrate.\n\n## Global Options\n\n```bash\n--no-spinner # Disable loading animations\n--progress-jsonl # Machine-readable progress events (JSONL to stderr)\n--progress-jsonl=<path> # Same, but write events to <path> instead of stderr\n--progress-jsonl <path> # Same as above (space-separated form also accepted)\n--accessible # Add text labels to color-coded output (also: TDC_ACCESSIBLE=1)\n--non-interactive # Disable interactive prompts (auto-detected when stdin is not a TTY)\n--interactive # Force interactive mode even when stdin is not a TTY\n```\n\n## Output Formats\n\nAll list/view commands support:\n\n```bash\n--json # Output as JSON\n--ndjson # Output as newline-delimited JSON (for streaming)\n--full # Include all fields (default shows essential fields only)\n```\n\n## Dry Run\n\nMutating commands accept `--dry-run` to preview the operation without making the change. Where a command performs pre-flight validation (e.g. fetching the target thread to check channel access or ownership), those checks still run in dry-run \u2014 only the mutating write is skipped. Commands that have no pre-flight validation parse the reference and print the preview without hitting the API. The preview is structured:\n\n```\n[dry-run] Would <action>:\n <Key>: <resolved value>\n ...\nRun without --dry-run to execute.\n```\n\n## Reference System\n\nCommands accept flexible references:\n- **Numeric IDs**: `123` or `id:123`\n- **Comms URLs**: Full `https://comms.todoist.com/...` URLs (parsed automatically)\n- **Fuzzy names**: For workspaces/users - `\"My Workspace\"` or partial matches\n\n## Piping Input\n\nCommands that accept content (`thread create`, `thread reply`, `comment update`, `conversation reply`, `msg update`) auto-detect piped stdin:\n\n```bash\ncat notes.md | tdc thread reply <ref>\ntdc thread create <channel-ref> \"Title\" < body.md\necho \"Quick reply\" | tdc conversation reply <ref>\n```\n\nIf no content argument is provided and no stdin is piped, the CLI opens `$EDITOR` for interactive input. In non-TTY environments (e.g. when called by an agent or in a pipeline), the editor is automatically skipped and the command fails fast with an actionable error message. Use `--non-interactive` to force this behavior even in a TTY, or `--interactive` to override auto-detection.\n\n`tdc thread mark-read` also accepts thread refs from stdin, one per line:\n\n```bash\nprintf \"123\\n456\\n\" | tdc thread mark-read --yes\n```\n\n## Common Workflows\n\n**View by URL (auto-routes to the right command):**\n```bash\ntdc view https://comms.todoist.com/1585/ch/100/t/200 # View thread\ntdc view https://comms.todoist.com/a/1585/ch/100/t/200 # View thread\ntdc view https://comms.todoist.com/a/1585/ch/100/t/200/c/300 # View comment\ntdc view https://comms.todoist.com/a/1585/msg/400 # View conversation\ntdc view https://comms.todoist.com/a/1585/msg/400/m/500 --json # View message as JSON\n```\n\n**Check inbox and respond:**\n```bash\ntdc inbox --unread --json\ntdc thread view <id> --unread\ntdc thread reply <id> \"Thanks, I'll look into this.\"\ntdc thread done <id> --yes\n```\n\n**Search and review:**\n```bash\ntdc mentions --since 2026-04-01 --all --json\ntdc search \"deployment\" --type threads --json\ntdc thread view <thread-id>\n```\n\n**Check DMs:**\n```bash\ntdc conversation unread --json\ntdc conversation list --kind group --json # find a group DM by participants/name\ntdc conversation view <conversation-id>\ntdc conversation with \"Alice Example\"\ntdc conversation reply <id> \"Got it, thanks!\"\n```\n";
|
|
7
7
|
export declare const SKILL_FILE_CONTENT: string;
|
|
8
8
|
//# sourceMappingURL=content.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/lib/skills/content.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,cAAc,CAAA;AAErC,eAAO,MAAM,iBAAiB,2TAC8R,CAAA;AAE5T,eAAO,MAAM,YAAY,UAAU,CAAA;AAEnC,eAAO,MAAM,aAAa,QAAQ,CAAA;AAElC,eAAO,MAAM,aAAa,QAAsB,CAAA;AAEhD,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/lib/skills/content.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,cAAc,CAAA;AAErC,eAAO,MAAM,iBAAiB,2TAC8R,CAAA;AAE5T,eAAO,MAAM,YAAY,UAAU,CAAA;AAEnC,eAAO,MAAM,aAAa,QAAQ,CAAA;AAElC,eAAO,MAAM,aAAa,QAAsB,CAAA;AAEhD,eAAO,MAAM,aAAa,y+2BA2czB,CAAA;AAED,eAAO,MAAM,kBAAkB,QASd,CAAA"}
|
|
@@ -40,6 +40,7 @@ tdc config set <key> <value> # Set a user preference (e.g. unarchive-new-th
|
|
|
40
40
|
tdc doctor # Diagnose CLI setup and environment issues
|
|
41
41
|
tdc update # Update CLI to latest version
|
|
42
42
|
tdc changelog # Show recent changelog entries
|
|
43
|
+
tdc migrate urls <urls> # Translate old twist.com URLs to Comms URLs (needs a Twist token)
|
|
43
44
|
\`\`\`
|
|
44
45
|
|
|
45
46
|
OAuth login uses Todoist OAuth for Comms access. The default grant can read Comms data and create/update content or messages. It does not include delete, channel management, or user/workspace write scopes; use \`tdc auth login --full-access\` only when needed. Stored auth uses the system credential manager when available. If secure storage is unavailable, \`tdc\` warns and falls back to \`~/.config/comms-cli/config.json\`. \`COMMS_API_TOKEN\` always takes priority over the stored token.
|
|
@@ -350,6 +351,26 @@ tdc changelog -n 3 # Show last 3 versions
|
|
|
350
351
|
tdc changelog --count 10 # Show last 10 versions
|
|
351
352
|
\`\`\`
|
|
352
353
|
|
|
354
|
+
## Migration
|
|
355
|
+
|
|
356
|
+
Translate old \`twist.com\` URLs to their Comms equivalents (e.g. for rewriting bookmarks or history). The migration endpoint authenticates with a **Twist** token (not a Comms one). Prefer the \`TWIST_AUTH_TOKEN\` environment variable — a CLI flag exposes the token in process listings. \`--twist-token\` is supported for ad-hoc use and overrides the env var. If the Twist CLI (\`tw\`) is installed, populate the env var inline with \`TWIST_AUTH_TOKEN="$(tw auth token view)"\`.
|
|
357
|
+
|
|
358
|
+
\`\`\`bash
|
|
359
|
+
# Comma-separated list as an argument (token from the environment)
|
|
360
|
+
TWIST_AUTH_TOKEN="$(tw auth token view)" tdc migrate urls "https://twist.com/a/1/ch/2/t/3,https://twist.com/a/1/ch/2/t/4"
|
|
361
|
+
|
|
362
|
+
# Or pipe URLs via stdin (comma- or newline-separated)
|
|
363
|
+
cat old-urls.txt | TWIST_AUTH_TOKEN="$(tw auth token view)" tdc migrate urls
|
|
364
|
+
|
|
365
|
+
# --twist-token overrides the env var (visible in process lists — prefer the env var)
|
|
366
|
+
tdc migrate urls "https://twist.com/a/1/ch/2/t/3" --twist-token <token>
|
|
367
|
+
|
|
368
|
+
tdc migrate urls "<urls>" --json # Structured output ({ oldUrl, newUrl } / { oldUrl, error })
|
|
369
|
+
tdc migrate urls "<urls>" --ndjson # Newline-delimited JSON
|
|
370
|
+
\`\`\`
|
|
371
|
+
|
|
372
|
+
Output is one line per URL in input order: \`old -> new\` on success, \`old ✗ <code>\` on failure (\`invalid_url\` / \`not_imported\`, or \`API_ERROR\` when the endpoint gives no code). Per-URL failures don't abort the run; the command exits non-zero if any URL fails to migrate.
|
|
373
|
+
|
|
353
374
|
## Global Options
|
|
354
375
|
|
|
355
376
|
\`\`\`bash
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../../src/lib/skills/content.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,uBAAuB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAErE,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,CAAA;AAErC,MAAM,CAAC,MAAM,iBAAiB,GAC1B,wTAAwT,CAAA;AAE5T,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAA;AAEnC,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAA;AAElC,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,CAAA;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAG
|
|
1
|
+
{"version":3,"file":"content.js","sour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|
|
2
2
|
"name": "@doist/comms-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"description": "TypeScript CLI for Comms",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
],
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@doist/cli-core": "0.26.0",
|
|
54
|
-
"@doist/comms-sdk": "0.
|
|
54
|
+
"@doist/comms-sdk": "0.7.1",
|
|
55
55
|
"@pnpm/tabtab": "0.5.4",
|
|
56
56
|
"chalk": "5.6.2",
|
|
57
57
|
"commander": "14.0.3",
|