@doist/comms-cli 3.5.1 → 3.6.0
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/README.md +7 -3
- package/dist/commands/status/clear.d.ts +3 -0
- package/dist/commands/status/clear.d.ts.map +1 -0
- package/dist/commands/status/clear.js +18 -0
- package/dist/commands/status/clear.js.map +1 -0
- package/dist/commands/status/helpers.d.ts +4 -0
- package/dist/commands/status/helpers.d.ts.map +1 -0
- package/dist/commands/status/helpers.js +6 -0
- package/dist/commands/status/helpers.js.map +1 -0
- package/dist/commands/status/index.d.ts +3 -0
- package/dist/commands/status/index.d.ts.map +1 -0
- package/dist/commands/status/index.js +44 -0
- package/dist/commands/status/index.js.map +1 -0
- package/dist/commands/status/set.d.ts +10 -0
- package/dist/commands/status/set.d.ts.map +1 -0
- package/dist/commands/status/set.js +96 -0
- package/dist/commands/status/set.js.map +1 -0
- package/dist/commands/status/show.d.ts +3 -0
- package/dist/commands/status/show.d.ts.map +1 -0
- package/dist/commands/status/show.js +12 -0
- package/dist/commands/status/show.js.map +1 -0
- package/dist/commands/user.d.ts.map +1 -1
- package/dist/commands/user.js +6 -2
- package/dist/commands/user.js.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/api.d.ts.map +1 -1
- package/dist/lib/api.js +4 -2
- package/dist/lib/api.js.map +1 -1
- package/dist/lib/dates.d.ts +13 -0
- package/dist/lib/dates.d.ts.map +1 -1
- package/dist/lib/dates.js +68 -4
- package/dist/lib/dates.js.map +1 -1
- package/dist/lib/duration.d.ts +6 -0
- package/dist/lib/duration.d.ts.map +1 -0
- package/dist/lib/duration.js +18 -0
- package/dist/lib/duration.js.map +1 -0
- package/dist/lib/errors.d.ts +2 -12
- package/dist/lib/errors.d.ts.map +1 -1
- package/dist/lib/errors.js +3 -32
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/output.d.ts.map +1 -1
- package/dist/lib/output.js +25 -5
- package/dist/lib/output.js.map +1 -1
- package/dist/lib/permissions.d.ts.map +1 -1
- package/dist/lib/permissions.js +2 -0
- package/dist/lib/permissions.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 +13 -2
- package/dist/lib/skills/content.js.map +1 -1
- package/dist/lib/status.d.ts +4 -0
- package/dist/lib/status.d.ts.map +1 -0
- package/dist/lib/status.js +13 -0
- package/dist/lib/status.js.map +1 -0
- package/package.json +3 -3
package/dist/lib/dates.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const SECOND = 1000;
|
|
2
|
-
const MINUTE = 60 * SECOND;
|
|
3
|
-
const HOUR = 60 * MINUTE;
|
|
4
|
-
const DAY = 24 * HOUR;
|
|
1
|
+
export const SECOND = 1000;
|
|
2
|
+
export const MINUTE = 60 * SECOND;
|
|
3
|
+
export const HOUR = 60 * MINUTE;
|
|
4
|
+
export const DAY = 24 * HOUR;
|
|
5
5
|
export function formatRelativeDate(date) {
|
|
6
6
|
const d = typeof date === 'string' ? new Date(date) : date;
|
|
7
7
|
const now = new Date();
|
|
@@ -41,4 +41,68 @@ export function parseDate(dateStr) {
|
|
|
41
41
|
const d = new Date(dateStr);
|
|
42
42
|
return Number.isNaN(d.getTime()) ? null : d;
|
|
43
43
|
}
|
|
44
|
+
// The real range of UTC offsets, -12:00 to +14:00; anything wider is a typo such as +20:00 for +02:00.
|
|
45
|
+
const MIN_OFFSET_MINUTES = -12 * 60;
|
|
46
|
+
const MAX_OFFSET_MINUTES = 14 * 60;
|
|
47
|
+
const ISO_LOCAL = /^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?)?(Z|[+-]\d{2}:?\d{2})?$/i;
|
|
48
|
+
/**
|
|
49
|
+
* Parses `YYYY-MM-DD` or `YYYY-MM-DD[T ]HH:MM[:SS[.fraction]]` with an optional `Z` or `+HH:MM`
|
|
50
|
+
* offset, which includes everything `Date.toISOString()` produces.
|
|
51
|
+
* Without an offset the value is local time, date-only included (unlike `new Date('2026-10-20')`,
|
|
52
|
+
* which is UTC). Returns `null` for anything else, including calendar dates that `Date` would
|
|
53
|
+
* silently roll over such as `2026-02-30`.
|
|
54
|
+
*/
|
|
55
|
+
export function parseLocalDate(value) {
|
|
56
|
+
const match = ISO_LOCAL.exec(value.trim());
|
|
57
|
+
if (!match) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
const [, year, month, day, hour, minute, second, fraction, zone] = match;
|
|
61
|
+
if (hour === undefined && zone !== undefined) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
const [y, mo, d, h, mi, s] = [year, month, day, hour ?? '0', minute ?? '0', second ?? '0'].map(Number);
|
|
65
|
+
const ms = Number((fraction ?? '').padEnd(3, '0').slice(0, 3));
|
|
66
|
+
if (mo < 1 || mo > 12 || d < 1 || h > 23 || mi > 59 || s > 59) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
if (zone === undefined) {
|
|
70
|
+
const local = new Date(y, mo - 1, d, h, mi, s, ms);
|
|
71
|
+
// `new Date(y, ...)` maps the years 0 to 99 to 1900 to 1999, and rolls an impossible day over.
|
|
72
|
+
if (local.getFullYear() !== y || local.getMonth() !== mo - 1 || local.getDate() !== d) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
// A time typed inside a daylight-saving gap does not exist and `Date` shifts it to the next
|
|
76
|
+
// hour. A date with no time is exempt: where midnight is skipped it is the first instant
|
|
77
|
+
// of that day, which is what "until that day" means.
|
|
78
|
+
const typedTimeExists = hour === undefined ||
|
|
79
|
+
(local.getHours() === h && local.getMinutes() === mi && local.getSeconds() === s);
|
|
80
|
+
return typedTimeExists ? local : null;
|
|
81
|
+
}
|
|
82
|
+
const utc = new Date(Date.UTC(y, mo - 1, d, h, mi, s, ms));
|
|
83
|
+
if (utc.getUTCFullYear() !== y || utc.getUTCMonth() !== mo - 1 || utc.getUTCDate() !== d) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
if (zone.toUpperCase() === 'Z') {
|
|
87
|
+
return utc;
|
|
88
|
+
}
|
|
89
|
+
const digits = zone.slice(1).replace(':', '');
|
|
90
|
+
const offsetMinutes = (zone.startsWith('-') ? -1 : 1) *
|
|
91
|
+
(Number(digits.slice(0, 2)) * 60 + Number(digits.slice(2)));
|
|
92
|
+
if (Number(digits.slice(2)) > 59 ||
|
|
93
|
+
offsetMinutes < MIN_OFFSET_MINUTES ||
|
|
94
|
+
offsetMinutes > MAX_OFFSET_MINUTES) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
return new Date(utc.getTime() - offsetMinutes * MINUTE);
|
|
98
|
+
}
|
|
99
|
+
export function formatDateTime(date) {
|
|
100
|
+
return date.toLocaleString('en-US', {
|
|
101
|
+
month: 'short',
|
|
102
|
+
day: 'numeric',
|
|
103
|
+
year: 'numeric',
|
|
104
|
+
hour: 'numeric',
|
|
105
|
+
minute: '2-digit',
|
|
106
|
+
});
|
|
107
|
+
}
|
|
44
108
|
//# sourceMappingURL=dates.js.map
|
package/dist/lib/dates.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dates.js","sourceRoot":"","sources":["../../src/lib/dates.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"dates.js","sourceRoot":"","sources":["../../src/lib/dates.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,CAAA;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,EAAE,GAAG,MAAM,CAAA;AACjC,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,GAAG,MAAM,CAAA;AAC/B,MAAM,CAAC,MAAM,GAAG,GAAG,EAAE,GAAG,IAAI,CAAA;AAE5B,MAAM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CAAC;IACD,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,aAAa,GAAG,MAAM,CAAC,CAAA;AAC3D,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAU;IACrC,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE;QAChC,KAAK,EAAE,OAAO;QACd,GAAG,EAAE,SAAS;QACd,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,SAAS;KACpB,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses a compact duration such as `30m`, `2h`, `1d` or `1h30m` into milliseconds.
|
|
3
|
+
* Returns `null` for anything else, including a zero duration.
|
|
4
|
+
*/
|
|
5
|
+
export declare function parseDuration(value: string): number | null;
|
|
6
|
+
//# sourceMappingURL=duration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration.d.ts","sourceRoot":"","sources":["../../src/lib/duration.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAW1D"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DAY, HOUR, MINUTE } from './dates.js';
|
|
2
|
+
const UNIT_MS = { d: DAY, h: HOUR, m: MINUTE };
|
|
3
|
+
/**
|
|
4
|
+
* Parses a compact duration such as `30m`, `2h`, `1d` or `1h30m` into milliseconds.
|
|
5
|
+
* Returns `null` for anything else, including a zero duration.
|
|
6
|
+
*/
|
|
7
|
+
export function parseDuration(value) {
|
|
8
|
+
const match = /^(?:(\d+)d)?(?:(\d+)h)?(?:(\d+)m)?$/.exec(value.trim().toLowerCase());
|
|
9
|
+
if (!match || match.slice(1).every((part) => part === undefined)) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const [, days, hours, minutes] = match;
|
|
13
|
+
const total = Number(days ?? 0) * UNIT_MS.d +
|
|
14
|
+
Number(hours ?? 0) * UNIT_MS.h +
|
|
15
|
+
Number(minutes ?? 0) * UNIT_MS.m;
|
|
16
|
+
return Number.isFinite(total) && total > 0 ? total : null;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=duration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration.js","sourceRoot":"","sources":["../../src/lib/duration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAE9C,MAAM,OAAO,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAW,CAAA;AAEvD;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa;IACvC,MAAM,KAAK,GAAG,qCAAqC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAA;IACpF,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,EAAE,CAAC;QAC/D,OAAO,IAAI,CAAA;IACf,CAAC;IACD,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,KAAK,CAAA;IACtC,MAAM,KAAK,GACP,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;QAC7B,MAAM,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;QAC9B,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAA;IACpC,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;AAC7D,CAAC"}
|
package/dist/lib/errors.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ export type { ErrorType } from '@doist/cli-core';
|
|
|
9
9
|
export type ErrorCode = 'AUTH_DCR_FAILED' | 'AUTH_FAILED' | 'AUTH_REFRESH_EXPIRED' | 'AUTH_REFRESH_TRANSIENT' | 'AUTH_TOKEN_EXCHANGE_FAILED' | 'FORBIDDEN' | 'INSUFFICIENT_SCOPE' | 'INVALID_CREDENTIAL_STORE' | 'INVALID_TOKEN' | 'NO_TOKEN' | 'READ_ONLY' | 'CONFLICTING_OPTIONS' | 'INVALID_CURSOR' | 'INVALID_DATE' | 'INVALID_ID' | 'INVALID_LIMIT' | 'INVALID_MINUTES' | 'INVALID_REF' | 'INVALID_SCOPE' | 'INVALID_STATE' | 'INVALID_TYPE' | 'INVALID_URL' | 'INVALID_VALUE' | 'MISSING_CONTENT' | 'MISSING_YES_FLAG' | 'UNKNOWN_KEY' | 'INVALID_NAME' | 'MISSING_USERS' | 'ACCOUNT_NOT_FOUND' | 'CHANNEL_NOT_FOUND' | 'GROUP_NOT_FOUND' | 'NOT_FOUND' | 'USER_NOT_FOUND' | 'WORKSPACE_NOT_FOUND' | 'AMBIGUOUS_CHANNEL' | 'AMBIGUOUS_GROUP' | 'AMBIGUOUS_USER' | 'AMBIGUOUS_WORKSPACE' | 'ALREADY_INSTALLED' | 'BATCH_FAILED' | 'PAGINATION_STALLED' | 'FILE_NOT_FOUND' | 'FILE_READ_ERROR' | 'NOT_CREATOR' | 'NOT_INSTALLED' | 'UNKNOWN_AGENT' | 'API_ERROR' | 'CONFLICT' | 'INTERNAL_ERROR' | 'CONFIG_READ_FAILED' | 'CONFIG_INVALID_JSON' | 'CONFIG_INVALID_SHAPE' | (string & {});
|
|
10
10
|
/**
|
|
11
11
|
* Check whether an error is a Comms API 403 "Insufficient scope" response.
|
|
12
|
-
*
|
|
12
|
+
* The status is read from any error carrying an `httpStatusCode`; the message
|
|
13
|
+
* only from a `CommsRequestError`.
|
|
13
14
|
*/
|
|
14
15
|
export declare function isInsufficientScope(error: unknown): boolean;
|
|
15
16
|
/**
|
|
@@ -29,17 +30,6 @@ export declare function isForbidden(error: unknown): boolean;
|
|
|
29
30
|
export declare function isInvalidToken(error: unknown): boolean;
|
|
30
31
|
/** True when `error` is a CliError carrying one of the given codes. */
|
|
31
32
|
export declare function isCliErrorCode(error: unknown, ...codes: ErrorCode[]): boolean;
|
|
32
|
-
export declare function isNotFound(error: unknown): boolean;
|
|
33
|
-
export declare function isConflict(error: unknown): boolean;
|
|
34
|
-
/** The server's `error_string`, when the response body carried one. */
|
|
35
|
-
export declare function getCommsErrorString(error: unknown): string | null;
|
|
36
|
-
/** The server's numeric `error_code`, when the response body carried one. */
|
|
37
|
-
export declare function getCommsErrorCode(error: unknown): number | null;
|
|
38
|
-
/**
|
|
39
|
-
* Comms answers 409 with error_code 217 when an id does not base58-decode to
|
|
40
|
-
* 16 bytes. That is a bad reference, not a conflict.
|
|
41
|
-
*/
|
|
42
|
-
export declare function isMalformedId(error: unknown): boolean;
|
|
43
33
|
/**
|
|
44
34
|
* Comms-flavoured CliError that preserves the historical positional
|
|
45
35
|
* `(code, message, hints?, type?)` signature used across hundreds of call
|
package/dist/lib/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAG7F,OAAO,EAAE,YAAY,EAAE,CAAA;AACvB,YAAY,E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E,SAAS,GAAG,YAAY,EAC9B,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM,EAAE,EAChB,IAAI,GAAE,SAAmB;CAIhC"}
|
package/dist/lib/errors.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CliError as BaseCliError } from '@doist/cli-core';
|
|
2
|
+
import { getCommsErrorString } from '@doist/comms-sdk';
|
|
2
3
|
export { BaseCliError };
|
|
3
4
|
function hasCommsStatusCode(error, status) {
|
|
4
5
|
return (typeof error === 'object' &&
|
|
@@ -9,7 +10,8 @@ function hasCommsStatusCode(error, status) {
|
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
11
12
|
* Check whether an error is a Comms API 403 "Insufficient scope" response.
|
|
12
|
-
*
|
|
13
|
+
* The status is read from any error carrying an `httpStatusCode`; the message
|
|
14
|
+
* only from a `CommsRequestError`.
|
|
13
15
|
*/
|
|
14
16
|
export function isInsufficientScope(error) {
|
|
15
17
|
return (hasCommsStatusCode(error, 403) &&
|
|
@@ -38,37 +40,6 @@ export function isInvalidToken(error) {
|
|
|
38
40
|
export function isCliErrorCode(error, ...codes) {
|
|
39
41
|
return error instanceof CliError && codes.includes(error.code);
|
|
40
42
|
}
|
|
41
|
-
export function isNotFound(error) {
|
|
42
|
-
return hasCommsStatusCode(error, 404);
|
|
43
|
-
}
|
|
44
|
-
export function isConflict(error) {
|
|
45
|
-
return hasCommsStatusCode(error, 409);
|
|
46
|
-
}
|
|
47
|
-
function getCommsResponseField(error, field) {
|
|
48
|
-
if (typeof error !== 'object' || error === null || !('responseData' in error))
|
|
49
|
-
return undefined;
|
|
50
|
-
const data = error.responseData;
|
|
51
|
-
if (typeof data !== 'object' || data === null || !(field in data))
|
|
52
|
-
return undefined;
|
|
53
|
-
return data[field];
|
|
54
|
-
}
|
|
55
|
-
/** The server's `error_string`, when the response body carried one. */
|
|
56
|
-
export function getCommsErrorString(error) {
|
|
57
|
-
const value = getCommsResponseField(error, 'error_string');
|
|
58
|
-
return typeof value === 'string' ? value : null;
|
|
59
|
-
}
|
|
60
|
-
/** The server's numeric `error_code`, when the response body carried one. */
|
|
61
|
-
export function getCommsErrorCode(error) {
|
|
62
|
-
const value = getCommsResponseField(error, 'error_code');
|
|
63
|
-
return typeof value === 'number' ? value : null;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Comms answers 409 with error_code 217 when an id does not base58-decode to
|
|
67
|
-
* 16 bytes. That is a bad reference, not a conflict.
|
|
68
|
-
*/
|
|
69
|
-
export function isMalformedId(error) {
|
|
70
|
-
return isConflict(error) && getCommsErrorCode(error) === 217;
|
|
71
|
-
}
|
|
72
43
|
/**
|
|
73
44
|
* Comms-flavoured CliError that preserves the historical positional
|
|
74
45
|
* `(code, message, hints?, type?)` signature used across hundreds of call
|
package/dist/lib/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAqC,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAqC,MAAM,iBAAiB,CAAA;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,EAAE,YAAY,EAAE,CAAA;AAuEvB,SAAS,kBAAkB,CAAC,KAAc,EAAE,MAAc;IACtD,OAAO,CACH,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,gBAAgB,IAAI,KAAK;QACzB,OAAO,KAAK,CAAC,cAAc,KAAK,QAAQ;QACxC,KAAK,CAAC,cAAc,KAAK,MAAM,CAClC,CAAA;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAC9C,OAAO,CACH,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC;QAC9B,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,oBAAoB,CAAC,IAAI,KAAK,CAAC,CACxE,CAAA;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc;IACtC,OAAO,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAA;AACxE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,KAAc;IACzC,OAAO,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;AACzC,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,cAAc,CAAC,KAAc,EAAE,GAAG,KAAkB;IAChE,OAAO,KAAK,YAAY,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;AAClE,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,QAAS,SAAQ,YAAuB;IACjD,YACI,IAA8B,EAC9B,OAAe,EACf,KAAgB,EAChB,OAAkB,OAAO;QAEzB,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;IACzC,CAAC;CACJ"}
|
package/dist/lib/output.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/lib/output.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C,KAAK,WAAW,GAAG,YAAY,CAAC,MAAM,CAAC,CAAA;AAEvC,eAAO,MAAM,MAAM;;;;;;;CAOlB,CAAA;
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/lib/output.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa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Ae,CAAC,CAAC,CAAC,EACxB,IAAI,CAAC,EAAE,UAAU,EACjB,IAAI,UAAQ,GACb,MAAM,CAOR;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAAA;AACvD,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;AAmBpD,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAAA;AAC3D,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;AAcxF,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEhD;AAED,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,UAAU,EAAE,IAAI,UAAQ,GAAG,IAAI,CAEhG;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,UAAU,EAAE,IAAI,UAAQ,GAAG,IAAI,CAE/F;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED,wBAAgB,WAAW,CACvB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAM,GACjD,IAAI,CAYN"}
|
package/dist/lib/output.js
CHANGED
|
@@ -56,6 +56,7 @@ const USER_ESSENTIAL_FIELDS = [
|
|
|
56
56
|
'timezone',
|
|
57
57
|
'userType',
|
|
58
58
|
'removed',
|
|
59
|
+
'status',
|
|
59
60
|
];
|
|
60
61
|
const CHANNEL_ESSENTIAL_FIELDS = [
|
|
61
62
|
'id',
|
|
@@ -87,6 +88,20 @@ function getEssentialFields(type) {
|
|
|
87
88
|
return GROUP_ESSENTIAL_FIELDS;
|
|
88
89
|
}
|
|
89
90
|
}
|
|
91
|
+
// Credentials the API attaches to the session user (session-type bearers only).
|
|
92
|
+
// Dropped for the top-level `user` entity on both the curated and --full paths.
|
|
93
|
+
// Shallow: a user nested inside another object is not redacted.
|
|
94
|
+
const SECRET_FIELDS = {
|
|
95
|
+
user: ['token', 'cometChannel'],
|
|
96
|
+
};
|
|
97
|
+
function omitSecrets(item, secrets) {
|
|
98
|
+
if (!secrets.some((field) => field in item))
|
|
99
|
+
return item;
|
|
100
|
+
const copy = { ...item };
|
|
101
|
+
for (const field of secrets)
|
|
102
|
+
delete copy[field];
|
|
103
|
+
return copy;
|
|
104
|
+
}
|
|
90
105
|
function pickFields(item, fields) {
|
|
91
106
|
const result = {};
|
|
92
107
|
for (const field of fields) {
|
|
@@ -99,7 +114,12 @@ function pickFields(item, fields) {
|
|
|
99
114
|
}
|
|
100
115
|
export function filterEntityFields(data, type, full = false) {
|
|
101
116
|
if (full) {
|
|
102
|
-
|
|
117
|
+
const secrets = SECRET_FIELDS[type];
|
|
118
|
+
if (!secrets)
|
|
119
|
+
return data;
|
|
120
|
+
return Array.isArray(data)
|
|
121
|
+
? data.map((item) => omitSecrets(item, secrets))
|
|
122
|
+
: omitSecrets(data, secrets);
|
|
103
123
|
}
|
|
104
124
|
const fields = getEssentialFields(type);
|
|
105
125
|
if (Array.isArray(data)) {
|
|
@@ -108,14 +128,14 @@ export function filterEntityFields(data, type, full = false) {
|
|
|
108
128
|
return pickFields(data, fields);
|
|
109
129
|
}
|
|
110
130
|
export function formatJson(data, type, full = false) {
|
|
111
|
-
if (
|
|
131
|
+
if (!type)
|
|
112
132
|
return formatJsonCore(data);
|
|
113
|
-
return formatJsonCore(filterEntityFields(data, type));
|
|
133
|
+
return formatJsonCore(filterEntityFields(data, type, full));
|
|
114
134
|
}
|
|
115
135
|
export function formatNdjson(items, type, full = false) {
|
|
116
|
-
if (
|
|
136
|
+
if (!type)
|
|
117
137
|
return formatNdjsonCore(items);
|
|
118
|
-
return formatNdjsonCore(filterEntityFields(items, type));
|
|
138
|
+
return formatNdjsonCore(filterEntityFields(items, type, full));
|
|
119
139
|
}
|
|
120
140
|
export function formatPaginatedJson(data, type, full = false) {
|
|
121
141
|
const results = type ? filterEntityFields(data.results, type, full) : data.results;
|
package/dist/lib/output.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/lib/output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAChG,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,MAAM,CAAC,MAAM,MAAM,GAAG;IAClB,MAAM,EAAE,KAAK,CAAC,IAAI;IAClB,SAAS,EAAE,KAAK,CAAC,GAAG;IACpB,OAAO,EAAE,KAAK,CAAC,IAAI;IACnB,MAAM,EAAE,KAAK,CAAC,IAAI;IAClB,GAAG,EAAE,KAAK,CAAC,GAAG;IACd,KAAK,EAAE,KAAK,CAAC,GAAG;CACnB,CAAA;AAED,MAAM,uBAAuB,GAAG;IAC5B,IAAI;IACJ,OAAO;IACP,WAAW;IACX,aAAa;IACb,SAAS;IACT,QAAQ;IACR,aAAa;IACb,cAAc;IACd,YAAY;IACZ,UAAU;IACV,kBAAkB;IAClB,KAAK;IACL,WAAW;CACL,CAAA;AAEV,MAAM,wBAAwB,GAAG;IAC7B,IAAI;IACJ,SAAS;IACT,SAAS;IACT,UAAU;IACV,QAAQ;IACR,WAAW;CACL,CAAA;AAEV,MAAM,6BAA6B,GAAG;IAClC,IAAI;IACJ,aAAa;IACb,SAAS;IACT,OAAO;IACP,cAAc;IACd,YAAY;IACZ,UAAU;CACJ,CAAA;AAEV,MAAM,wBAAwB,GAAG;IAC7B,IAAI;IACJ,SAAS;IACT,SAAS;IACT,gBAAgB;IAChB,QAAQ;IACR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EAAE,CAAC,CAAA;YAC9B,CAAC;QACL,CAAC;IACL,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC,CAAA;AAC/D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/lib/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,WAAW,CAAA;AAI9D,eAAO,MAAM,uBAAuB,yHACsF,CAAA;
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/lib/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,WAAW,CAAA;AAI9D,eAAO,MAAM,uBAAuB,yHACsF,CAAA;AAiD1H,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED,2EAA2E;AAC3E,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEvE;AAED,wBAAsB,kBAAkB,CAAC,SAAS,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAOhF;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACpC,UAAU,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,YAAY,GACzB,OAAO,CAAC,IAAI,CAAC,CAmBf;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI7E"}
|
package/dist/lib/permissions.js
CHANGED
|
@@ -39,6 +39,8 @@ const KNOWN_SAFE_API_METHODS = new Set([
|
|
|
39
39
|
* `wrapResult` turns into the same guidance.
|
|
40
40
|
*/
|
|
41
41
|
const API_METHOD_SCOPES = {
|
|
42
|
+
'users.setStatus': 'user:write',
|
|
43
|
+
'users.clearStatus': 'user:write',
|
|
42
44
|
'groups.createGroup': 'workspaces:write',
|
|
43
45
|
'groups.updateGroup': 'workspaces:write',
|
|
44
46
|
'groups.deleteGroup': 'workspaces:write',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../src/lib/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,eAAe,EAAE,MAAM,WAAW,CAAA;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,MAAM,CAAC,MAAM,uBAAuB,GAChC,sHAAsH,CAAA;AAE1H;;;GAGG;AACH,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IACnC,sBAAsB;IACtB,0BAA0B;IAC1B,8BAA8B;IAC9B,kCAAkC;IAClC,4BAA4B;IAC5B,mBAAmB;IACnB,mBAAmB;IACnB,qBAAqB;IACrB,sBAAsB;IACtB,qBAAqB;IACrB,sBAAsB;IACtB,gCAAgC;IAChC,+BAA+B;IAC/B,yBAAyB;IACzB,iCAAiC;IACjC,kCAAkC;IAClC,gBAAgB;IAChB,kBAAkB;IAClB,iBAAiB;IACjB,OAAO;CACV,CAAC,CAAA;AAEF;;;;;;;;;GASG;AACH,MAAM,iBAAiB,GAA2B;IAC9C,oBAAoB,EAAE,kBAAkB;IACxC,oBAAoB,EAAE,kBAAkB;IACxC,oBAAoB,EAAE,kBAAkB;IACxC,iBAAiB,EAAE,kBAAkB;IACrC,oBAAoB,EAAE,kBAAkB;CAC3C,CAAA;AAED,MAAM,UAAU,gBAAgB,CAAC,UAAkB;IAC/C,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;AAClD,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,gBAAgB,CAAC,UAAkB;IAC/C,OAAO,iBAAiB,CAAC,UAAU,CAAC,CAAA;AACxC,CAAC;AAED,MAAM,CAAC,KAAK,UA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A;IACN,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACpC,UAAkB,EAClB,SAAwB;IAExB,MAAM,aAAa,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAA;IAClD,2EAA2E;IAC3E,IAAI,CAAC,aAAa;QAAE,OAAM;IAE1B,MAAM,QAAQ,GAAG,SAAS,IAAI,CAAC,MAAM,eAAe,EAAE,CAAC,CAAA;IACvD,MAAM,YAAY,GAAG,QAAQ,CAAC,SAAS,CAAA;IACvC,IAAI,CAAC,YAAY;QAAE,OAAM;IAEzB,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,QAAQ,CACd,oBAAoB,EACpB,8BAA8B,aAAa,2CAA2C,EACtF;YACI,sCAAsC;YACtC,gDAAgD;SACnD,CACJ,CAAA;IACL,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,UAAkB;IAC1D,MAAM,QAAQ,GAAG,MAAM,eAAe,EAAE,CAAA;IACxC,MAAM,kBAAkB,CAAC,QAAQ,CAAC,CAAA;IAClC,MAAM,kBAAkB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;AAClD,CAAC"}
|
|
@@ -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 --credential-store system # Require the system credential manager\ntdc auth login --credential-store plaintext # Explicitly allow plaintext config storage\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 token --credential-store system # Require the system credential manager\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; refreshes an expiring OAuth token first; 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 workspaces --ids-only # Output only workspace IDs\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 (all `tdc groups` writes require it). Credential storage defaults to `fallback`: use the system credential manager when available, otherwise warn and save to `~/.config/comms-cli/config.json`. Pass `--credential-store system` to fail instead of writing plaintext, or `--credential-store plaintext` to choose config-file storage explicitly. `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 --mentions # Only unread threads where you were mentioned (implies --unread)\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)\ntdc inbox --ids-only # Output only thread IDs, one per line\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,Cbzzm11ZeYZoJYD4a6rti # Notify user and/or group IDs\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 NONE # Post without notifying anyone\ntdc thread reply <ref> \"content\" --notify NONE --dry-run # Preview without posting\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\" --close --notify NONE # Reply and close without notifying anyone\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 undone <ref> --yes # Unarchive thread (move it back to your inbox); inverse of done\ntdc thread undone <ref> --yes --json # Unarchive 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 \"id:CbT8n2Kp4Qx6Rz9Lm3Va\\nid:CbT9m4Qr7Vz2Nx8Lp5Sa\\n\" | tdc thread mark-read --dry-run # Preview bulk mark-read from stdin\ntdc thread mark-unread <ref> # Mark a whole thread unread; inverse of mark-read\ntdc thread mark-unread <ref> --from <comment-ref> # Mark unread from that comment onward (single thread only)\ntdc thread mark-unread <ref> <ref> --yes # Mark multiple threads unread (also accepts refs on 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>`) or nobody (via `--notify NONE`). Options: NONE, EVERYONE, EVERYONE_IN_THREAD, or comma-separated user and/or group IDs.\n\n`--notify NONE` sends empty user, group, and direct-mention recipient lists without adding a notification audience. It also works with `--close` and `--reopen`. The `--dry-run` preview displays `Notify: NONE`.\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 list --ids-only # Output only conversation IDs\ntdc conversation unread --ids-only # Output only unread conversation IDs\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 undone <ref> --yes # Unarchive conversation; inverse of done\ntdc conversation undone <ref> --yes --json # Unarchive 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 users --ids-only # Output only user IDs\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 channels --ids-only # Output only channel IDs\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: for archived channels)\ntdc channel threads <channel-ref> # List threads in a channel (fuzzy name, 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 threads <ref> --ids-only # Output only thread IDs; pagination notice goes to stderr\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 <ref> --ids-only # Output only member user IDs\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 --ids-only # Output only group IDs\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\nAll group *writes* (`groups create`, `rename`, `delete`, `add-user`, `remove-user`) need the `workspaces:write` scope, which only `tdc auth login --full-access` grants. Group *reads* (`groups`, `groups view`) work on a default login.\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\nList and view commands commonly support `--json`, `--ndjson`, and `--full`. List commands with one clear entity ID also support `--ids-only`; check command help for the exact surface.\n\n```bash\n--json # Output as JSON\n--ndjson # Output as newline-delimited JSON (for streaming)\n--ids-only # Output one stable ID per line; mutually exclusive with JSON/NDJSON\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- **IDs**: `id:<id>` (or a bare ID when unambiguous). Workspace/user IDs are numeric; most Comms entity IDs are opaque strings.\n- **Comms URLs**: Full `https://comms.todoist.com/...` URLs (parsed automatically)\n- **Fuzzy names**: For workspaces/users/channels/groups - `\"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` and `tdc thread mark-unread` also accept thread refs from stdin, one per line:\n\n```bash\nprintf \"id:CbT8n2Kp4Qx6Rz9Lm3Va\\nid:CbT9m4Qr7Vz2Nx8Lp5Sa\\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/CbC8n2Kp4Qx6Rz9Lm3Va/t/CbT8n2Kp4Qx6Rz9Lm3Va # View thread\ntdc view https://comms.todoist.com/a/1585/ch/CbC8n2Kp4Qx6Rz9Lm3Va/t/CbT8n2Kp4Qx6Rz9Lm3Va # View thread\ntdc view https://comms.todoist.com/a/1585/ch/CbC8n2Kp4Qx6Rz9Lm3Va/t/CbT8n2Kp4Qx6Rz9Lm3Va/c/CbM8n2Kp4Qx6Rz9Lm3Va # View comment\ntdc view https://comms.todoist.com/a/1585/msg/CbV8n2Kp4Qx6Rz9Lm3Va # View conversation\ntdc view https://comms.todoist.com/a/1585/msg/CbV8n2Kp4Qx6Rz9Lm3Va/m/CbS8n2Kp4Qx6Rz9Lm3Va --json # View message as JSON\n```\n\n**Check inbox and respond:**\n```bash\ntdc inbox --unread --json\ntdc inbox --mentions --json # Unread threads with an unread @mention of you\ntdc thread view <thread-ref> --unread\ntdc thread reply <thread-ref> \"Thanks, I'll look into this.\"\ntdc thread done <thread-ref> --yes\ntdc thread undone <thread-ref> --yes # Changed your mind: back to the inbox\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 <conversation-ref> \"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 --credential-store system # Require the system credential manager\ntdc auth login --credential-store plaintext # Explicitly allow plaintext config storage\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 token --credential-store system # Require the system credential manager\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; refreshes an expiring OAuth token first; 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 workspaces --ids-only # Output only workspace IDs\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 (all `tdc groups` writes and `tdc status set|clear` require it). Credential storage defaults to `fallback`: use the system credential manager when available, otherwise warn and save to `~/.config/comms-cli/config.json`. Pass `--credential-store system` to fail instead of writing plaintext, or `--credential-store plaintext` to choose config-file storage explicitly. `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 --mentions # Only unread threads where you were mentioned (implies --unread)\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)\ntdc inbox --ids-only # Output only thread IDs, one per line\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,Cbzzm11ZeYZoJYD4a6rti # Notify user and/or group IDs\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 NONE # Post without notifying anyone\ntdc thread reply <ref> \"content\" --notify NONE --dry-run # Preview without posting\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\" --close --notify NONE # Reply and close without notifying anyone\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 undone <ref> --yes # Unarchive thread (move it back to your inbox); inverse of done\ntdc thread undone <ref> --yes --json # Unarchive 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 \"id:CbT8n2Kp4Qx6Rz9Lm3Va\\nid:CbT9m4Qr7Vz2Nx8Lp5Sa\\n\" | tdc thread mark-read --dry-run # Preview bulk mark-read from stdin\ntdc thread mark-unread <ref> # Mark a whole thread unread; inverse of mark-read\ntdc thread mark-unread <ref> --from <comment-ref> # Mark unread from that comment onward (single thread only)\ntdc thread mark-unread <ref> <ref> --yes # Mark multiple threads unread (also accepts refs on 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>`) or nobody (via `--notify NONE`). Options: NONE, EVERYONE, EVERYONE_IN_THREAD, or comma-separated user and/or group IDs.\n\n`--notify NONE` sends empty user, group, and direct-mention recipient lists without adding a notification audience. It also works with `--close` and `--reopen`. The `--dry-run` preview displays `Notify: NONE`.\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 list --ids-only # Output only conversation IDs\ntdc conversation unread --ids-only # Output only unread conversation IDs\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 undone <ref> --yes # Unarchive conversation; inverse of done\ntdc conversation undone <ref> --yes --json # Unarchive 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 # All fields, except session credentials\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 users --ids-only # Output only user IDs\ntdc status # Show your status (default login is enough)\ntdc status --json # Show it as { status } JSON (null when unset; --full for the whole user)\ntdc status set \"Deep work\" --emoji \uD83C\uDFAF --for 2h --pause-notifications # Set it (replaces any current status; needs --full-access)\ntdc status set \"On holiday\" --until 2026-10-20T09:00 # End at a date (YYYY-MM-DD, YYYY-MM-DDTHH:MM or a full ISO 8601 timestamp; local time unless it has Z or an offset)\ntdc status set \"Away\" --dry-run # Preview without setting\ntdc status set \"Away\" --json # Set and return { status } as JSON\ntdc status clear # Clear your status (--dry-run, --json supported)\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 channels --ids-only # Output only channel IDs\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: for archived channels)\ntdc channel threads <channel-ref> # List threads in a channel (fuzzy name, 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 threads <ref> --ids-only # Output only thread IDs; pagination notice goes to stderr\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 <ref> --ids-only # Output only member user IDs\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 --ids-only # Output only group IDs\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\nAll group *writes* (`groups create`, `rename`, `delete`, `add-user`, `remove-user`) need the `workspaces:write` scope, which only `tdc auth login --full-access` grants. Group *reads* (`groups`, `groups view`) work on a default login.\n\n`tdc status set` and `tdc status clear` need the `user:write` scope, which only `tdc auth login --full-access` grants. `tdc status` (show) works on a default login.\n\nOnly pass `--pause-notifications` when the user asks for it. It holds back Comms notifications only for now: each app has to read the status and hold its own notifications back, and Todoist does not yet. Held notifications are not sent later.\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\nList and view commands commonly support `--json`, `--ndjson`, and `--full`. List commands with one clear entity ID also support `--ids-only`; check command help for the exact surface.\n\n```bash\n--json # Output as JSON\n--ndjson # Output as newline-delimited JSON (for streaming)\n--ids-only # Output one stable ID per line; mutually exclusive with JSON/NDJSON\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- **IDs**: `id:<id>` (or a bare ID when unambiguous). Workspace/user IDs are numeric; most Comms entity IDs are opaque strings.\n- **Comms URLs**: Full `https://comms.todoist.com/...` URLs (parsed automatically)\n- **Fuzzy names**: For workspaces/users/channels/groups - `\"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` and `tdc thread mark-unread` also accept thread refs from stdin, one per line:\n\n```bash\nprintf \"id:CbT8n2Kp4Qx6Rz9Lm3Va\\nid:CbT9m4Qr7Vz2Nx8Lp5Sa\\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/CbC8n2Kp4Qx6Rz9Lm3Va/t/CbT8n2Kp4Qx6Rz9Lm3Va # View thread\ntdc view https://comms.todoist.com/a/1585/ch/CbC8n2Kp4Qx6Rz9Lm3Va/t/CbT8n2Kp4Qx6Rz9Lm3Va # View thread\ntdc view https://comms.todoist.com/a/1585/ch/CbC8n2Kp4Qx6Rz9Lm3Va/t/CbT8n2Kp4Qx6Rz9Lm3Va/c/CbM8n2Kp4Qx6Rz9Lm3Va # View comment\ntdc view https://comms.todoist.com/a/1585/msg/CbV8n2Kp4Qx6Rz9Lm3Va # View conversation\ntdc view https://comms.todoist.com/a/1585/msg/CbV8n2Kp4Qx6Rz9Lm3Va/m/CbS8n2Kp4Qx6Rz9Lm3Va --json # View message as JSON\n```\n\n**Check inbox and respond:**\n```bash\ntdc inbox --unread --json\ntdc inbox --mentions --json # Unread threads with an unread @mention of you\ntdc thread view <thread-ref> --unread\ntdc thread reply <thread-ref> \"Thanks, I'll look into this.\"\ntdc thread done <thread-ref> --yes\ntdc thread undone <thread-ref> --yes # Changed your mind: back to the inbox\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 <conversation-ref> \"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,q+/BAofzB,CAAA;AAED,eAAO,MAAM,kBAAkB,QASd,CAAA"}
|
|
@@ -47,7 +47,7 @@ tdc changelog # Show recent changelog entries
|
|
|
47
47
|
tdc migrate urls <urls> # Translate old twist.com URLs to Comms URLs (needs a Twist token)
|
|
48
48
|
\`\`\`
|
|
49
49
|
|
|
50
|
-
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 (all \`tdc groups\` writes require it). Credential storage defaults to \`fallback\`: use the system credential manager when available, otherwise warn and save to \`~/.config/comms-cli/config.json\`. Pass \`--credential-store system\` to fail instead of writing plaintext, or \`--credential-store plaintext\` to choose config-file storage explicitly. \`COMMS_API_TOKEN\` always takes priority over the stored token.
|
|
50
|
+
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 (all \`tdc groups\` writes and \`tdc status set|clear\` require it). Credential storage defaults to \`fallback\`: use the system credential manager when available, otherwise warn and save to \`~/.config/comms-cli/config.json\`. Pass \`--credential-store system\` to fail instead of writing plaintext, or \`--credential-store plaintext\` to choose config-file storage explicitly. \`COMMS_API_TOKEN\` always takes priority over the stored token.
|
|
51
51
|
|
|
52
52
|
In 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.
|
|
53
53
|
|
|
@@ -245,11 +245,18 @@ tdc search "query" --all # Fetch all result pages
|
|
|
245
245
|
\`\`\`bash
|
|
246
246
|
tdc user # Show current user info
|
|
247
247
|
tdc user --json # JSON output
|
|
248
|
-
tdc user --json --full #
|
|
248
|
+
tdc user --json --full # All fields, except session credentials
|
|
249
249
|
tdc users # List active workspace users
|
|
250
250
|
tdc users --search <text> # Filter by name/email
|
|
251
251
|
tdc users --include-removed # Include users removed from the workspace
|
|
252
252
|
tdc users --ids-only # Output only user IDs
|
|
253
|
+
tdc status # Show your status (default login is enough)
|
|
254
|
+
tdc status --json # Show it as { status } JSON (null when unset; --full for the whole user)
|
|
255
|
+
tdc status set "Deep work" --emoji 🎯 --for 2h --pause-notifications # Set it (replaces any current status; needs --full-access)
|
|
256
|
+
tdc status set "On holiday" --until 2026-10-20T09:00 # End at a date (YYYY-MM-DD, YYYY-MM-DDTHH:MM or a full ISO 8601 timestamp; local time unless it has Z or an offset)
|
|
257
|
+
tdc status set "Away" --dry-run # Preview without setting
|
|
258
|
+
tdc status set "Away" --json # Set and return { status } as JSON
|
|
259
|
+
tdc status clear # Clear your status (--dry-run, --json supported)
|
|
253
260
|
tdc channels # List active joined workspace channels (alias of: tdc channel list)
|
|
254
261
|
tdc channels --state all # Include archived joined channels too
|
|
255
262
|
tdc channels --scope discoverable # Active public channels you can see but have not joined
|
|
@@ -308,6 +315,10 @@ tdc groups remove-user <ref> id:123,id:456 # Comma-separated ID refs
|
|
|
308
315
|
|
|
309
316
|
All group *writes* (\`groups create\`, \`rename\`, \`delete\`, \`add-user\`, \`remove-user\`) need the \`workspaces:write\` scope, which only \`tdc auth login --full-access\` grants. Group *reads* (\`groups\`, \`groups view\`) work on a default login.
|
|
310
317
|
|
|
318
|
+
\`tdc status set\` and \`tdc status clear\` need the \`user:write\` scope, which only \`tdc auth login --full-access\` grants. \`tdc status\` (show) works on a default login.
|
|
319
|
+
|
|
320
|
+
Only pass \`--pause-notifications\` when the user asks for it. It holds back Comms notifications only for now: each app has to read the status and hold its own notifications back, and Todoist does not yet. Held notifications are not sent later.
|
|
321
|
+
|
|
311
322
|
If 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.
|
|
312
323
|
|
|
313
324
|
\`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.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../../src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