@doist/twist-cli 2.36.5 → 2.38.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/dist/commands/auth/index.d.ts.map +1 -1
- package/dist/commands/auth/index.js +16 -2
- package/dist/commands/auth/index.js.map +1 -1
- package/dist/commands/config/view.d.ts.map +1 -1
- package/dist/commands/config/view.js +2 -2
- package/dist/commands/config/view.js.map +1 -1
- package/dist/lib/auth-provider.d.ts.map +1 -1
- package/dist/lib/auth-provider.js +92 -35
- package/dist/lib/auth-provider.js.map +1 -1
- package/dist/lib/auth.d.ts +1 -0
- package/dist/lib/auth.d.ts.map +1 -1
- package/dist/lib/auth.js +11 -5
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/errors.d.ts +1 -1
- package/dist/lib/errors.d.ts.map +1 -1
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/global-args.d.ts +1 -1
- package/dist/lib/global-args.d.ts.map +1 -1
- package/dist/lib/global-args.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 +4 -0
- package/dist/lib/skills/content.js.map +1 -1
- package/package.json +2 -2
- package/dist/lib/secure-store.d.ts +0 -11
- package/dist/lib/secure-store.d.ts.map +0 -1
- package/dist/lib/secure-store.js +0 -57
- package/dist/lib/secure-store.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [2.38.0](https://github.com/Doist/twist-cli/compare/v2.37.0...v2.38.0) (2026-05-16)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
- **auth:** add `tw auth token view` via cli-core attachTokenViewCommand ([#227](https://github.com/Doist/twist-cli/issues/227)) ([9ae4388](https://github.com/Doist/twist-cli/commit/9ae43882bc3f7d443438cf4469fba1c127f60fab))
|
|
6
|
+
|
|
7
|
+
## [2.37.0](https://github.com/Doist/twist-cli/compare/v2.36.5...v2.37.0) (2026-05-15)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
- **auth:** adopt cli-core 0.12.0 multi-user TokenStore shape ([#225](https://github.com/Doist/twist-cli/issues/225)) ([f5e806e](https://github.com/Doist/twist-cli/commit/f5e806e766f43aa0d603f7e6b9a3acca08c43ad6))
|
|
12
|
+
|
|
1
13
|
## [2.36.5](https://github.com/Doist/twist-cli/compare/v2.36.4...v2.36.5) (2026-05-13)
|
|
2
14
|
|
|
3
15
|
### Bug Fixes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAQnC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA8B1D"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { attachTokenViewCommand } from '@doist/cli-core/auth';
|
|
1
2
|
import { createTwistTokenStore } from '../../lib/auth-provider.js';
|
|
3
|
+
import { TOKEN_ENV_VAR } from '../../lib/auth.js';
|
|
2
4
|
import { attachTwistLoginCommand } from './login.js';
|
|
3
5
|
import { attachTwistLogoutCommand } from './logout.js';
|
|
4
6
|
import { attachTwistStatusCommand } from './status.js';
|
|
@@ -13,8 +15,20 @@ export function registerAuthCommand(program) {
|
|
|
13
15
|
attachTwistLoginCommand(auth, store);
|
|
14
16
|
attachTwistLogoutCommand(auth, store);
|
|
15
17
|
attachTwistStatusCommand(auth, store);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
// `token` is a hybrid: the positional `[token]` saves, and the `view`
|
|
19
|
+
// subcommand prints. Commander matches subcommand names before the parent
|
|
20
|
+
// action, so `tw auth token view` always dispatches to the view path —
|
|
21
|
+
// Twist OAuth tokens are opaque random strings so the literal "view" can
|
|
22
|
+
// never collide with a real token value.
|
|
23
|
+
const tokenCmd = auth
|
|
24
|
+
.command('token [token]')
|
|
25
|
+
.description('Save API token for CLI authentication (or use a subcommand: `view`)')
|
|
18
26
|
.action(loginWithToken);
|
|
27
|
+
attachTokenViewCommand(tokenCmd, {
|
|
28
|
+
name: 'view',
|
|
29
|
+
store,
|
|
30
|
+
envVarName: TOKEN_ENV_VAR,
|
|
31
|
+
description: 'Print the stored API token for the active user (or --user <ref>) to stdout for use in scripts',
|
|
32
|
+
});
|
|
19
33
|
}
|
|
20
34
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/auth/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAE7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAChD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAA;IAEzE,yEAAyE;IACzE,yEAAyE;IACzE,kEAAkE;IAClE,+BAA+B;IAC/B,MAAM,KAAK,GAAG,qBAAqB,EAAE,CAAA;IAErC,uBAAuB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IACpC,wBAAwB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IACrC,wBAAwB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IAErC,sEAAsE;IACtE,0EAA0E;IAC1E,uEAAuE;IACvE,yEAAyE;IACzE,yCAAyC;IACzC,MAAM,QAAQ,GAAG,IAAI;SAChB,OAAO,CAAC,eAAe,CAAC;SACxB,WAAW,CAAC,qEAAqE,CAAC;SAClF,MAAM,CAAC,cAAc,CAAC,CAAA;IAE3B,sBAAsB,CAAC,QAAQ,EAAE;QAC7B,IAAI,EAAE,MAAM;QACZ,KAAK;QACL,UAAU,EAAE,aAAa;QACzB,WAAW,EACP,+FAA+F;KACtG,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/commands/config/view.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/commands/config/view.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,iBAAiB;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,SAAS,CAAC,EAAE,OAAO,CAAA;CACtB;AA0GD,wBAAsB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyB1E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { SecureStoreUnavailableError } from '@doist/cli-core/auth';
|
|
1
2
|
import chalk from 'chalk';
|
|
2
|
-
import { NoTokenError, probeApiToken, TOKEN_ENV_VAR, } from '../../lib/auth.js';
|
|
3
|
+
import { NoTokenError, probeApiToken, SECURE_STORE_DESCRIPTION, TOKEN_ENV_VAR, } from '../../lib/auth.js';
|
|
3
4
|
import { getConfigPath, readConfigStrict } from '../../lib/config.js';
|
|
4
|
-
import { SECURE_STORE_DESCRIPTION, SecureStoreUnavailableError } from '../../lib/secure-store.js';
|
|
5
5
|
function maskToken(token) {
|
|
6
6
|
if (token.length < 5)
|
|
7
7
|
return '****';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../src/commands/config/view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAEH,YAAY,EACZ,aAAa,EACb,aAAa,GAChB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAe,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../src/commands/config/view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAEH,YAAY,EACZ,aAAa,EACb,wBAAwB,EACxB,aAAa,GAChB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAe,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAYlF,SAAS,SAAS,CAAC,KAAa;IAC5B,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,MAAM,CAAA;IACnC,OAAO,QAAQ,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AACpC,CAAC;AAED,SAAS,mBAAmB,CAAC,MAAmC;IAC5D,QAAQ,MAAM,EAAE,CAAC;QACb,KAAK,KAAK;YACN,OAAO,wBAAwB,aAAa,EAAE,CAAA;QAClD,KAAK,cAAc;YACf,OAAO,wBAAwB,CAAA;QACnC,KAAK,aAAa;YACd,OAAO,kCAAkC,CAAA;IACjD,CAAC;AACL,CAAC;AAED,KAAK,UAAU,kBAAkB;IAC7B,IAAI,CAAC;QACD,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,MAAM,aAAa,EAAE,CAAA;QACjD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,K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AS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAC1C,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;QAC5C,OAAM;IACV,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,kBAAkB,EAAE,CAAA;IAExC,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QACxD,OAAO,CAAC,GAAG,CACP,GAAG,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,aAAa,EAAE,IAAI,KAAK,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE,CACtF,CAAA;QACD,OAAM;IACV,CAAC;IAED,OAAO,CAAC,GAAG,CACP,gBAAgB,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,SAAS,IAAI,KAAK,EAAE,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CACxF,CAAA;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-provider.d.ts","sourceRoot":"","sources":["../../src/lib/auth-provider.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"auth-provider.d.ts","sourceRoot":"","sources":["../../src/lib/auth-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,WAAW,EAChB,KAAK,YAAY,EAIjB,KAAK,UAAU,EAClB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAKH,KAAK,kBAAkB,EAC1B,MAAM,WAAW,CAAA;AAClB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAI3C,eAAO,MAAM,iBAAiB,sCAAsC,CAAA;AACpE,eAAO,MAAM,SAAS,yCAAyC,CAAA;AAC/D,eAAO,MAAM,gBAAgB,qCAAqC,CAAA;AAKlE,eAAO,MAAM,iBAAiB,UAkB7B,CAAA;AAED,eAAO,MAAM,gBAAgB,UAW5B,CAAA;AAID;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,QAAQ,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;CACpB,CAAA;AAsED,wBAAgB,uBAAuB,IAAI,YAAY,CAAC,YAAY,CAAC,CA2HpE;AAED,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,YAAY,CAAC,GAAG;IACrD,oBAAoB,IAAI,kBAAkB,GAAG,SAAS,CAAA;IACtD,kBAAkB,IAAI,kBAAkB,GAAG,SAAS,CAAA;CACvD,CAAA;AAED,wBAAgB,qBAAqB,IAAI,eAAe,CAuHvD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { deriveChallenge, generateVerifier, } from '@doist/cli-core/auth';
|
|
1
|
+
import { deriveChallenge, generateVerifier, SecureStoreUnavailableError, } from '@doist/cli-core/auth';
|
|
2
2
|
import { createWrappedTwistClient } from './api.js';
|
|
3
3
|
import { clearApiToken, NoTokenError, probeApiToken, saveApiToken, } from './auth.js';
|
|
4
4
|
import { CliError } from './errors.js';
|
|
5
|
-
import {
|
|
5
|
+
import { parseRef } from './refs.js';
|
|
6
6
|
export const AUTHORIZATION_URL = 'https://twist.com/oauth/authorize';
|
|
7
7
|
export const TOKEN_URL = 'https://twist.com/oauth/access_token';
|
|
8
8
|
export const REGISTRATION_URL = 'https://twist.com/oauth/register';
|
|
@@ -182,41 +182,83 @@ export function createTwistAuthProvider() {
|
|
|
182
182
|
export function createTwistTokenStore() {
|
|
183
183
|
let lastStorageResult;
|
|
184
184
|
let lastClearResult;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
213
|
-
catch (error) {
|
|
214
|
-
if (error instanceof NoTokenError)
|
|
215
|
-
return null;
|
|
216
|
-
if (error instanceof SecureStoreUnavailableError)
|
|
185
|
+
/**
|
|
186
|
+
* Read the stored credential. By default `NoTokenError` collapses to
|
|
187
|
+
* `null` (i.e. "nothing stored" is not an exception), while
|
|
188
|
+
* `SecureStoreUnavailableError` propagates so callers see a keyring
|
|
189
|
+
* outage as distinct from "no account". The legacy `active()` no-ref
|
|
190
|
+
* path opts in to also tolerate the outage so headless / keyring-less
|
|
191
|
+
* hosts keep falling through to the standard `NoTokenError` envelope
|
|
192
|
+
* (matching the historical `getApiToken` → `showStatus()` behaviour).
|
|
193
|
+
*/
|
|
194
|
+
async function loadStoredSnapshot(options = {}) {
|
|
195
|
+
try {
|
|
196
|
+
const { token, metadata } = await probeApiToken();
|
|
197
|
+
return {
|
|
198
|
+
token,
|
|
199
|
+
account: {
|
|
200
|
+
id: metadata.authUserId !== undefined ? String(metadata.authUserId) : '',
|
|
201
|
+
label: metadata.authUserName ?? '',
|
|
202
|
+
authMode: metadata.authMode,
|
|
203
|
+
authScope: metadata.authScope ?? '',
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
if (error instanceof NoTokenError)
|
|
209
|
+
return null;
|
|
210
|
+
if (error instanceof SecureStoreUnavailableError) {
|
|
211
|
+
if (options.tolerateOutage)
|
|
217
212
|
return null;
|
|
218
213
|
throw error;
|
|
219
214
|
}
|
|
215
|
+
throw error;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Match the stored account against the user-supplied `--user <ref>`,
|
|
220
|
+
* normalising through `parseRef` so `id:42`, `42`, and a case-insensitive
|
|
221
|
+
* label all resolve consistently with the rest of the CLI. URL refs
|
|
222
|
+
* never apply to accounts — fall through to "no match" instead of
|
|
223
|
+
* silently accepting one.
|
|
224
|
+
*/
|
|
225
|
+
function matchesRef(account, ref) {
|
|
226
|
+
const parsed = parseRef(ref);
|
|
227
|
+
if (parsed.type === 'id')
|
|
228
|
+
return Number(account.id) === parsed.id;
|
|
229
|
+
if (parsed.type === 'name') {
|
|
230
|
+
return account.label.toLowerCase() === parsed.name.toLowerCase();
|
|
231
|
+
}
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Single source of truth for ref-aware lookups. Returns the snapshot
|
|
236
|
+
* when `ref` matches the stored account, throws `ACCOUNT_NOT_FOUND`
|
|
237
|
+
* otherwise (including when nothing is stored). Storage outages
|
|
238
|
+
* propagate so the caller sees the underlying failure rather than
|
|
239
|
+
* a misleading "account not found".
|
|
240
|
+
*/
|
|
241
|
+
async function resolveByRef(ref) {
|
|
242
|
+
const snapshot = await loadStoredSnapshot();
|
|
243
|
+
if (!snapshot || !matchesRef(snapshot.account, ref)) {
|
|
244
|
+
throw new CliError('ACCOUNT_NOT_FOUND', `No stored account matches "${ref}".`);
|
|
245
|
+
}
|
|
246
|
+
return snapshot;
|
|
247
|
+
}
|
|
248
|
+
return {
|
|
249
|
+
async active(ref) {
|
|
250
|
+
// No-ref legacy path — tolerate missing keyring / no token and
|
|
251
|
+
// return null so downstream callers (status's `fetchLive`,
|
|
252
|
+
// login's pre-flight, etc.) keep falling through to their own
|
|
253
|
+
// `NoTokenError` envelope rather than seeing a raw keyring
|
|
254
|
+
// error. Returning a snapshot whenever a token resolves — even
|
|
255
|
+
// when the persisted identity is empty (env var, manual
|
|
256
|
+
// `tw auth token`, pre-upgrade config) — also avoids a second
|
|
257
|
+
// credential read downstream.
|
|
258
|
+
if (ref === undefined) {
|
|
259
|
+
return loadStoredSnapshot({ tolerateOutage: true });
|
|
260
|
+
}
|
|
261
|
+
return resolveByRef(ref);
|
|
220
262
|
},
|
|
221
263
|
async set(account, token) {
|
|
222
264
|
const userId = Number(account.id);
|
|
@@ -227,9 +269,24 @@ export function createTwistTokenStore() {
|
|
|
227
269
|
authUserName: account.label,
|
|
228
270
|
});
|
|
229
271
|
},
|
|
230
|
-
async clear() {
|
|
272
|
+
async clear(ref) {
|
|
273
|
+
// With `ref`, validate before touching storage so a mismatch is
|
|
274
|
+
// an `ACCOUNT_NOT_FOUND` error rather than a silent
|
|
275
|
+
// ✓ Logged out — the upstream `attachLogoutCommand` treats any
|
|
276
|
+
// non-throwing `clear()` as success.
|
|
277
|
+
if (ref !== undefined) {
|
|
278
|
+
await resolveByRef(ref);
|
|
279
|
+
}
|
|
231
280
|
lastClearResult = await clearApiToken();
|
|
232
281
|
},
|
|
282
|
+
async list() {
|
|
283
|
+
const snapshot = await loadStoredSnapshot();
|
|
284
|
+
return snapshot ? [{ account: snapshot.account, isDefault: true }] : [];
|
|
285
|
+
},
|
|
286
|
+
async setDefault(ref) {
|
|
287
|
+
await resolveByRef(ref);
|
|
288
|
+
// Single-user store — already the default once `ref` matches.
|
|
289
|
+
},
|
|
233
290
|
getLastStorageResult() {
|
|
234
291
|
return lastStorageResult;
|
|
235
292
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-provider.js","sourceRoot":"","sources":["../../src/lib/auth-provider.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"auth-provider.js","sourceRoot":"","sources":["../../src/lib/auth-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,eAAe,EACf,gBAAgB,EAChB,2BAA2B,GAE9B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EACH,aAAa,EACb,YAAY,EACZ,aAAa,EACb,YAAY,GAEf,MAAM,WAAW,CAAA;AAElB,O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,KAAK,CAAC,GAAgB;YACxB,gEAAgE;YAChE,oDAAoD;YACpD,+DAA+D;YAC/D,qCAAqC;YACrC,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;gBACpB,MAAM,YAAY,CAAC,GAAG,CAAC,CAAA;YAC3B,CAAC;YACD,eAAe,GAAG,MAAM,aAAa,EAAE,CAAA;QAC3C,CAAC;QACD,KAAK,CAAC,IAAI;YACN,MAAM,QAAQ,GAAG,MAAM,kBAAkB,EAAE,CAAA;YAC3C,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;QAC3E,CAAC;QACD,KAAK,CAAC,UAAU,CAAC,GAAe;YAC5B,MAAM,YAAY,CAAC,GAAG,CAAC,CAAA;YACvB,8DAA8D;QAClE,CAAC;QACD,oBAAoB;YAChB,OAAO,iBAAiB,CAAA;QAC5B,CAAC;QACD,kBAAkB;YACd,OAAO,eAAe,CAAA;QAC1B,CAAC;KACJ,CAAA;AACL,CAAC"}
|
package/dist/lib/auth.d.ts
CHANGED
package/dist/lib/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAoD,MAAM,aAAa,CAAA;AAC7F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAKtC,eAAO,MAAM,wBAAwB,8BAA8B,CAAA;AAMnE,qBAAa,YAAa,SAAQ,QAAQ;;CAUzC;AAED,eAAO,MAAM,aAAa,oBAAoB,CAAA;AAC9C,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG,aAAa,CAAA;AAEjE,M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js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { unlink } from 'node:fs/promises';
|
|
2
|
+
import { createSecureStore, SecureStoreUnavailableError } from '@doist/cli-core/auth';
|
|
2
3
|
import { getConfig, getConfigPath, setConfig } from './config.js';
|
|
3
4
|
import { CliError } from './errors.js';
|
|
4
|
-
|
|
5
|
+
const SECURE_STORE_SERVICE = 'twist-cli';
|
|
6
|
+
const SECURE_STORE_ACCOUNT = 'api-token';
|
|
7
|
+
export const SECURE_STORE_DESCRIPTION = 'system credential manager';
|
|
8
|
+
function getSecureStore() {
|
|
9
|
+
return createSecureStore({ serviceName: SECURE_STORE_SERVICE, account: SECURE_STORE_ACCOUNT });
|
|
10
|
+
}
|
|
5
11
|
export class NoTokenError extends CliError {
|
|
6
12
|
constructor() {
|
|
7
13
|
super('NO_TOKEN', `No API token found. Set ${TOKEN_ENV_VAR} or run \`tw auth login\` or \`tw auth token <token>\`.`, ['Set TWIST_API_TOKEN or run: tw auth login'], 'info');
|
|
@@ -17,7 +23,7 @@ export async function getApiToken() {
|
|
|
17
23
|
}
|
|
18
24
|
const config = await getConfig();
|
|
19
25
|
const configToken = getConfigToken(config);
|
|
20
|
-
const secureStore =
|
|
26
|
+
const secureStore = getSecureStore();
|
|
21
27
|
if (configToken) {
|
|
22
28
|
try {
|
|
23
29
|
await secureStore.setSecret(configToken);
|
|
@@ -86,7 +92,7 @@ export async function probeApiToken() {
|
|
|
86
92
|
if (config.pendingSecureStoreClear) {
|
|
87
93
|
throw new NoTokenError();
|
|
88
94
|
}
|
|
89
|
-
const secureStore =
|
|
95
|
+
const secureStore = getSecureStore();
|
|
90
96
|
try {
|
|
91
97
|
const storedToken = await secureStore.getSecret();
|
|
92
98
|
if (storedToken?.trim()) {
|
|
@@ -133,7 +139,7 @@ export async function saveApiToken(token, options = {}) {
|
|
|
133
139
|
]);
|
|
134
140
|
}
|
|
135
141
|
const trimmedToken = token.trim();
|
|
136
|
-
const secureStore =
|
|
142
|
+
const secureStore = getSecureStore();
|
|
137
143
|
try {
|
|
138
144
|
await secureStore.setSecret(trimmedToken);
|
|
139
145
|
const existingConfig = await getConfig();
|
|
@@ -169,7 +175,7 @@ export async function saveApiToken(token, options = {}) {
|
|
|
169
175
|
}
|
|
170
176
|
export async function clearApiToken() {
|
|
171
177
|
const config = await getConfig();
|
|
172
|
-
const secureStore =
|
|
178
|
+
const secureStore = getSecureStore();
|
|
173
179
|
// Clear auth metadata from the in-memory config object so all subsequent
|
|
174
180
|
// writes (cleanupAuthFallbackState, withPendingSecureStoreClear) persist
|
|
175
181
|
// the removal atomically alongside other state changes.
|
package/dist/lib/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAA8B,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC7F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AACrF,OAAO,EAA8B,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC7F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,MAAM,oBAAoB,GAAG,WAAW,CAAA;AACxC,MAAM,oBAAoB,GAAG,WAAW,CAAA;AAExC,MAAM,CAAC,MAAM,wBAAwB,GAAG,2BAA2B,CAAA;AAEnE,SAAS,cAAc;IACnB,OAAO,iBAAiB,CAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,OAAO,EAAE,oBAAoB,EAA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rorType } from '@doist/cli-core';
|
|
|
6
6
|
* This union provides intellisense suggestions while still accepting any string,
|
|
7
7
|
* allowing dynamic codes and future additions.
|
|
8
8
|
*/
|
|
9
|
-
export type ErrorCode = 'AUTH_FAILED' | 'INSUFFICIENT_SCOPE' | 'INVALID_TOKEN' | 'NO_TOKEN' | 'READ_ONLY' | 'CONFLICTING_OPTIONS' | 'INVALID_CURSOR' | 'INVALID_DATE' | 'INVALID_ID' | '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' | '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' | 'FILE_READ_ERROR' | 'NOT_CREATOR' | 'NOT_INSTALLED' | 'UNKNOWN_AGENT' | 'API_ERROR' | 'INTERNAL_ERROR' | 'CONFIG_READ_FAILED' | 'CONFIG_INVALID_JSON' | 'CONFIG_INVALID_SHAPE' | (string & {});
|
|
9
|
+
export type ErrorCode = 'AUTH_FAILED' | 'INSUFFICIENT_SCOPE' | 'INVALID_TOKEN' | 'NO_TOKEN' | 'READ_ONLY' | 'CONFLICTING_OPTIONS' | 'INVALID_CURSOR' | 'INVALID_DATE' | 'INVALID_ID' | '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' | 'FILE_READ_ERROR' | 'NOT_CREATOR' | 'NOT_INSTALLED' | 'UNKNOWN_AGENT' | 'API_ERROR' | 'INTERNAL_ERROR' | 'CONFIG_READ_FAILED' | 'CONFIG_INVALID_JSON' | 'CONFIG_INVALID_SHAPE' | (string & {});
|
|
10
10
|
/**
|
|
11
11
|
* Check whether an error is a Twist API 403 "Insufficient scope" response.
|
|
12
12
|
* Works with any error shaped like TwistRequestError (httpStatusCode + responseData).
|
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;AAE7F,OAAO,EAAE,YAAY,EAAE,CAAA;AACvB,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAEf,aAAa,GACb,oBAAoB,GACpB,eAAe,GACf,UAAU,GACV,WAAW,GAEX,qBAAqB,GACrB,gBAAgB,GAChB,cAAc,GACd,YAAY,GACZ,iBAAiB,GACjB,aAAa,GACb,eAAe,GACf,eAAe,GACf,cAAc,GACd,aAAa,GACb,eAAe,GACf,iBAAiB,GACjB,kBAAkB,GAClB,aAAa,GACb,cAAc,GACd,eAAe,GAEf,mBAAmB,GACnB,iBAAiB,GACjB,WAAW,GACX,gBAAgB,GAChB,qBAAqB,GAErB,mBAAmB,GACnB,iBAA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d,iBAAiB,GACjB,aAAa,GACb,eAAe,GACf,eAAe,GAEf,WAAW,GACX,gBAAgB,GAEhB,oBAAoB,GACpB,qBAAqB,GACrB,sBAAsB,GAEtB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEnB;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAkB3D;AAED;;;;;;;;;GASG;AACH,qBAAa,QAAS,SAAQ,YAAY,CAAC,SAAS,CAAC;gBAE7C,IAAI,EAAE,SAAS,GAAG,YAAY,EAC9B,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM,EAAE,EAChB,IAAI,GAAE,SAAmB;CAIhC"}
|
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;AAE7F,OAAO,EAAE,YAAY,EAAE,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;AAE7F,OAAO,EAAE,YAAY,EAAE,CAAA;AA6DvB;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAC9C,IACI,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,CAAC,CAAC,gBAAgB,IAAI,KAAK,CAAC;QAC5B,CAAC,CAAC,cAAc,IAAI,KAAK,CAAC,EAC5B,CAAC;QACC,OAAO,KAAK,CAAA;IAChB,CAAC;IACD,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,KAGxC,CAAA;IACD,OAAO,CACH,cAAc,KAAK,GAAG;QACtB,OAAO,YAAY,EAAE,YAAY,KAAK,QAAQ;QAC9C,YAAY,CAAC,YAAY,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAC3D,CAAA;AACL,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"}
|
|
@@ -28,7 +28,7 @@ type TwSpecificFlags = {
|
|
|
28
28
|
* Commander — exposing them in the type would lie about what the binary
|
|
29
29
|
* supports.
|
|
30
30
|
*/
|
|
31
|
-
export type TwGlobalArgs = Pick<CoreGlobalArgs, 'json' | 'ndjson' | 'accessible' | 'noSpinner'> & TwSpecificFlags;
|
|
31
|
+
export type TwGlobalArgs = Pick<CoreGlobalArgs, 'json' | 'ndjson' | 'accessible' | 'noSpinner' | 'user'> & TwSpecificFlags;
|
|
32
32
|
/** Back-compat alias — pre-cli-core twist code imported `GlobalArgs` from this module. */
|
|
33
33
|
export type GlobalArgs = TwGlobalArgs;
|
|
34
34
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-args.d.ts","sourceRoot":"","sources":["../../src/lib/global-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAIH,KAAK,UAAU,IAAI,cAAc,EAEpC,MAAM,iBAAiB,CAAA;AAExB,KAAK,eAAe,GAAG;IACnB,0EAA0E;IAC1E,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,CAAA;IACpC,wFAAwF;IACxF,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,sBAAsB,EAAE,OAAO,CAAA;IAC/B,cAAc,EAAE,OAAO,CAAA;IACvB,WAAW,EAAE,OAAO,CAAA;CACvB,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"global-args.d.ts","sourceRoot":"","sources":["../../src/lib/global-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAIH,KAAK,UAAU,IAAI,cAAc,EAEpC,MAAM,iBAAiB,CAAA;AAExB,KAAK,eAAe,GAAG;IACnB,0EAA0E;IAC1E,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,CAAA;IACpC,wFAAwF;IACxF,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,sBAAsB,EAAE,OAAO,CAAA;IAC/B,cAAc,EAAE,OAAO,CAAA;IACvB,WAAW,EAAE,OAAO,CAAA;CACvB,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,CAC3B,cAAc,EACd,MAAM,GAAG,QAAQ,GAAG,YAAY,GAAG,WAAW,GAAG,MAAM,CAC1D,GACG,eAAe,CAAA;AAEnB,0FAA0F;AAC1F,MAAM,MAAM,UAAU,GAAG,YAAY,CAAA;AA+ErC;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,YAAY,CAG7D;AAID,4DAA4D;AAC5D,eAAO,MAAM,eAAe,YAAc,CAAA;AAM1C,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAED,wBAAgB,gBAAgB,IAAI,OAAO,CAK1C;AAED,wBAAgB,sBAAsB,IAAI,OAAO,CAMhD;AAED,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAED,wBAAgB,oBAAoB,IAAI,MAAM,GAAG,SAAS,CAEzD;AAED,eAAO,MAAM,YAAY,eAGvB,CAAA;AAEF,eAAO,MAAM,oBAAoB,eAI/B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-args.js","sourceRoot":"","sources":["../../src/lib/global-args.ts"],"names":[],"mappings":"AAAA;;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EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,cAAc;CAClD,CAAC,CAAA"}
|
|
@@ -3,6 +3,6 @@ export declare const SKILL_DESCRIPTION = "Twist 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 = "# Twist CLI (tw)\n\nAccess Twist messaging via the `tw` CLI. Use when the user asks about their Twist workspaces, threads, messages, or wants to interact with Twist in any way.\n\n## Setup\n\n```bash\ntw auth login # OAuth login (opens browser, read-write)\ntw auth login --read-only # OAuth login with read-only scope\ntw auth login --callback-port <n># Override the local OAuth callback port (default 8766)\ntw auth login --json # Emit a JSON envelope for scripted / agent use\ntw auth login --ndjson # Emit an NDJSON envelope for scripted / agent use\ntw auth token # Save API token manually (prompts securely; scope unknown, assumed write-capable)\ntw auth status # Verify authentication + show mode\ntw auth status --json # Full status payload as JSON (--ndjson also supported)\ntw auth logout # Remove saved token and auth metadata\ntw auth logout --json # Emits `{\"ok\": true}` (--ndjson is silent)\ntw workspaces # List available workspaces\ntw workspace use <ref> # Set current workspace\ntw completion install # Install shell completions\ntw config view # Show the current CLI configuration file (token masked)\ntw config set <key> <value> # Set a user preference (e.g. unarchive-new-threads true)\ntw doctor # Diagnose CLI setup and environment issues\ntw update # Update CLI to latest version\ntw changelog # Show recent changelog entries\n```\n\nStored auth uses the system credential manager when available. If secure storage is unavailable, `tw` warns and falls back to `~/.config/twist-cli/config.json`. `TWIST_API_TOKEN` always takes priority over the stored token, and legacy plaintext config tokens are migrated automatically when secure storage is available.\n\nIn read-only mode (`tw auth login --read-only`), commands that modify Twist data (reply, archive, react, delete, etc.) are blocked by the CLI. Externally provided tokens (`TWIST_API_TOKEN` or `tw auth token`) are treated as unknown scope and assumed write-capable.\n\n## View by URL\n\n```bash\ntw view <url> # View any Twist entity by URL\n```\n\nRoutes automatically based on URL structure:\n- Message URL \u2192 `tw msg view`\n- Conversation URL \u2192 `tw conversation view`\n- Thread+comment URL \u2192 `tw thread view` (comment ID extracted from URL)\n- Thread URL \u2192 `tw thread view`\n\nAll target command flags pass through (e.g. `--json`, `--raw`, `--full`).\n\n## Inbox\n\n```bash\ntw inbox # Show inbox threads\ntw inbox --unread # Only unread threads\ntw inbox --archive-filter all # Show active + done threads\ntw inbox --archive-filter archived # Show only done threads\ntw inbox --channel <filter> # Filter by channel name (fuzzy)\ntw inbox --since <date> # Filter by date (ISO format)\ntw inbox --limit <n> # Max items (default: 50)\n```\n\n## Threads\n\n```bash\ntw thread <thread-ref> # View thread (shorthand for view)\ntw thread view <thread-ref> # View thread with comments\ntw thread view <ref> --comment <id> # View a specific comment\ntw thread view <url-with-/c/id> # Comment ID extracted from URL\ntw thread view <ref> --unread # Show only unread comments\ntw thread view <ref> --context 3 # Include 3 read comments before unread\ntw thread view <ref> --limit 20 # Limit number of comments\ntw thread view <ref> --since <date> # Comments newer than date\ntw thread view <ref> --raw # Show raw markdown\ntw thread create <channel-ref> \"Title\" \"content\" # Create a new thread\ntw thread create <channel-ref> \"Title\" \"content\" --json # Create and return as JSON\ntw thread create <channel-ref> \"Title\" \"content\" --json --full # Include all thread fields\ntw thread create <channel-ref> \"Title\" \"content\" --notify 123,456 # Notify specific users\ntw thread create <channel-ref> \"Title\" \"content\" --unarchive # Land thread in author's Inbox (overrides default Twist auto-archive)\ntw thread create <channel-ref> \"Title\" \"content\" --no-unarchive # Force archive even when userSettings.unarchiveNewThreads=true\ntw thread create <channel-ref> \"Title\" \"content\" --dry-run # Preview without posting\ntw thread reply <ref> \"content\" # Post a comment (notifies EVERYONE_IN_THREAD by default)\ntw thread reply <ref> \"content\" --notify EVERYONE # Notify all workspace members\ntw thread reply <ref> \"content\" --notify 123,id:456 # Notify specific user IDs\ntw thread reply <ref> \"content\" --json # Post and return comment as JSON\ntw thread reply <ref> \"content\" --json --full # Include all comment fields\ntw thread reply <ref> \"content\" --close # Reply and close the thread\ntw thread reply <ref> \"content\" --reopen # Reply and reopen a closed thread\ntw thread done <ref> # Archive thread (mark done)\ntw thread done <ref> --json # Archive and return status as JSON\ntw thread mute <ref> # Mute thread for 60 minutes (default)\ntw thread mute <ref> --minutes 480 # Mute for custom duration\ntw thread mute <ref> --json # Mute and return { id, mutedUntil } as JSON\ntw thread mute <ref> --json --full # Mute and return full thread as JSON\ntw thread unmute <ref> # Unmute a muted thread\ntw thread unmute <ref> --json # Unmute and return { id, mutedUntil } as JSON\ntw thread delete <ref> # Preview thread deletion (requires --yes to execute)\ntw thread delete <ref> --yes # Permanently delete a thread\ntw thread delete <ref> --yes --json # Delete and return status as JSON\ntw thread rename <ref> \"New title\" # Rename a thread (change its title)\ntw thread rename <ref> \"New title\" --json # Rename and return { id, title } as JSON\ntw thread rename <ref> \"New title\" --json --full # Rename and return full thread as JSON\ntw thread update <ref> \"New body\" # Update a thread's body (the first post)\necho \"New body\" | tw thread update <ref> # Update body from stdin\ntw thread update <ref> \"New body\" --dry-run # Preview without updating\ntw thread update <ref> \"New body\" --json # Update and return { id, content } as JSON\ntw 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 <user-ids>`). Options: EVERYONE, EVERYONE_IN_THREAD, or comma-separated ID refs.\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\ntw comment <comment-ref> # View a comment (shorthand for view)\ntw comment view <comment-ref> # View a single thread comment\ntw comment view <comment-ref> --raw # Show raw markdown\ntw comment view <comment-ref> --json # Output as JSON\ntw comment view <comment-ref> --ndjson # Output as newline-delimited JSON\ntw comment view <comment-ref> --json --full # Include all fields in JSON output\ntw comment update <comment-ref> \"new content\" # Update a thread comment\ntw comment update <comment-ref> \"content\" --json # Update and return updated comment as JSON\ntw comment update <comment-ref> \"content\" --json --full # Include all comment fields\ntw comment delete <comment-ref> # Delete a thread comment\ntw comment delete <comment-ref> --json # Delete and return status as JSON\n```\n\n## Conversations (DMs/Groups)\n\n```bash\ntw conversation unread # List unread conversations\ntw conversation <conversation-ref> # View conversation (shorthand for view)\ntw conversation view <conversation-ref> # View conversation messages\ntw conversation with <user-ref> # Find your 1:1 DM with a user\ntw conversation with <user-ref> --snippet # Include the latest message preview\ntw conversation with <user-ref> --include-groups # List any conversations with that user\ntw conversation reply <ref> \"content\" # Send a message\ntw conversation reply <ref> \"content\" --json # Send and return message as JSON\ntw conversation reply <ref> \"content\" --json --full # Include all message fields\ntw conversation done <ref> # Archive conversation\ntw conversation done <ref> --json # Archive and return status as JSON\ntw conversation mute <ref> # Mute conversation for 60 minutes (default)\ntw conversation mute <ref> --minutes 480 # Mute for custom duration\ntw conversation mute <ref> --json # Mute and return { id, mutedUntil } as JSON\ntw conversation mute <ref> --json --full # Mute and return full conversation as JSON\ntw conversation unmute <ref> # Unmute a muted conversation\ntw conversation unmute <ref> --json # Unmute and return { id, mutedUntil } as JSON\n```\n\nAlias: `tw convo` works the same as `tw conversation`.\n\n## Conversation Messages\n\n```bash\ntw msg <message-ref> # View a message (shorthand for view)\ntw msg view <message-ref> # View a single conversation message\ntw msg update <ref> \"content\" # Edit a conversation message\ntw msg update <ref> \"content\" --json # Edit and return updated message as JSON\ntw msg update <ref> \"content\" --json --full # Include all message fields\ntw msg delete <ref> # Delete a conversation message\ntw msg delete <ref> --json # Delete and return status as JSON\n```\n\nAlias: `tw message` works the same as `tw msg`.\n\n## Search\n\n```bash\ntw mentions # Show content mentioning current user\ntw mentions --since 2026-04-01 --all # Fetch every mention since a date\ntw mentions --type threads --json # Limit mentions to threads\ntw search \"query\" # Search content\ntw search \"query\" --type threads # Filter: threads, messages, or all\ntw search \"query\" --author <ref> # Filter by author\ntw search \"query\" --to <ref> # Messages sent to user\ntw search \"query\" --title-only # Search thread titles only\ntw search \"query\" --mention-me # Results mentioning current user\ntw search \"query\" --conversation <refs> # Limit to conversations (comma-separated refs)\ntw search \"query\" --since <date> # Content from date\ntw search \"query\" --until <date> # Content until date\ntw search \"query\" --channel <refs> # Filter by channel refs (comma-separated)\ntw search \"query\" --limit <n> # Max results (default: 50)\ntw search \"query\" --cursor <cur> # Pagination cursor\ntw search \"query\" --all # Fetch all result pages\n```\n\n## Users, Channels & Groups\n\n```bash\ntw user # Show current user info\ntw user --json # JSON output\ntw user --json --full # Include all fields in JSON output\ntw users # List workspace users\ntw users --search <text> # Filter by name/email\ntw channels # List active joined workspace channels (alias of: tw channel list)\ntw channels --state all # Include archived joined channels too\ntw channels --scope discoverable # Active public channels you can see but have not joined\ntw channels --scope public --state all --json # All visible public channels, with joined status\ntw channel threads <channel-ref> # List threads in a channel (fuzzy name, id:, numeric ID, or URL)\ntw channel threads \"general\" --unread # Only unread threads\ntw channel threads <ref> --archive-filter all # Include archived threads (active|archived|all)\ntw channel threads <ref> --since 2026-01-01 # Filter by last-updated date (ISO)\ntw channel threads <ref> --limit 20 # Max threads per page (default: 50)\ntw channel threads <ref> --limit 20 --cursor <cursor-from-prev> # Paginate\ntw channel threads <ref> --json # { results, nextCursor } with isUnread + url\ntw groups # List workspace groups\ntw groups --search \"frontend\" # Filter groups by name (case-insensitive)\ntw groups --json # JSON output\ntw groups --json --full # Include all fields in JSON output\ntw groups view <group-ref> # Show group with member details\ntw groups view <ref> --json # JSON output with id, name, workspaceId, members\ntw groups view <ref> --json --full # Include all fields in JSON output\ntw groups create \"Name\" # Create a new group\ntw groups create \"Name\" --users alice@doist.com,bob@doist.com # Create with members\ntw groups create \"Name\" --json # Output created group as JSON\ntw groups rename <group-ref> \"New name\" # Rename a group\ntw groups rename <ref> \"Name\" --json # Output renamed group as JSON\ntw groups delete <group-ref> --yes # Delete a group (requires --yes)\ntw groups delete <ref> --dry-run # Preview deletion\ntw groups add-user <group-ref> user1 user2 # Add users to a group\ntw groups add-user <ref> a@d.com,b@d.com # Comma-separated refs\ntw groups add-user <ref> id:123 --json # Output result as JSON\ntw groups remove-user <group-ref> user1 user2 # Remove users from a group\ntw groups remove-user <ref> id:123,id:456 # Comma-separated ID refs\n```\n\nIf a channel is not found in `tw channels`, widen with broader listings such as `tw channels --scope public`, then `tw channels --scope public --state all`. Check `tw channels --help` for other available filters.\n\n`tw 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\n## Away Status\n\n```bash\ntw away # Show current away status\ntw away set <type> [until] # Set away (type: vacation, parental, sickleave, other)\ntw away set vacation 2026-03-20 # Away until March 20\ntw away set vacation 2026-03-20 --from 2026-03-15 # Custom start date\ntw away clear # Clear away status\n```\n\n## Reactions\n\n```bash\ntw react thread <ref> \uD83D\uDC4D # Add reaction to thread\ntw react comment <ref> +1 # Add reaction (shortcode)\ntw react message <ref> heart # Add reaction to DM message\ntw react thread <ref> \uD83D\uDC4D --json # Output result as JSON\ntw unreact thread <ref> \uD83D\uDC4D # Remove reaction\ntw 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\ntw completion install # Install tab completions (prompts for shell)\ntw completion install bash # Install for specific shell\ntw completion install zsh\ntw completion install fish\ntw completion uninstall # Remove completions\n```\n\n### Diagnostics\n\n```bash\ntw doctor # Run local + network diagnostics\ntw doctor --offline # Skip Twist and npm network checks\ntw doctor --json # JSON output with per-check results\n```\n\n### Configuration\n\n```bash\ntw config view # Pretty-printed config, token masked, labels actual token source\ntw config view --json # Raw JSON, token masked\ntw config view --show-token # Include the full token\ntw config set unarchive-new-threads true # Persist: always unarchive new threads so they land in your Inbox\ntw config set unarchive-new-threads false # Persist: keep Twist'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 `tw thread create` (`--unarchive` / `--no-unarchive`) overrides this default per-invocation.\n\n### Update\n\n```bash\ntw update # Update CLI to latest version\ntw update --check # Check for updates without installing, show channel\ntw update --check --json # Same, JSON envelope\ntw update --check --ndjson # Same, newline-delimited JSON envelope\ntw update --channel # Show current update channel\ntw update switch --stable # Switch to stable release channel\ntw update switch --pre-release # Switch to pre-release (next) channel\ntw update switch --pre-release --json # Same, JSON envelope\ntw update switch --pre-release --ndjson # Same, newline-delimited JSON envelope\n```\n\n### Changelog\n```bash\ntw changelog # Show last 5 versions\ntw changelog -n 3 # Show last 3 versions\ntw changelog --count 10 # Show last 10 versions\n```\n\n## Global Options\n\n```bash\n--no-spinner # Disable loading animations\n--progress-jsonl # Machine-readable progress events (JSONL to stderr)\n--progress-jsonl=<path> # Same, but write events to <path> instead of stderr\n--progress-jsonl <path> # Same as above (space-separated form also accepted)\n--accessible # Add text labels to color-coded output (also: TW_ACCESSIBLE=1)\n--non-interactive # Disable interactive prompts (auto-detected when stdin is not a TTY)\n--interactive # Force interactive mode even when stdin is not a TTY\n```\n\n## Output Formats\n\nAll list/view commands support:\n\n```bash\n--json # Output as JSON\n--ndjson # Output as newline-delimited JSON (for streaming)\n--full # Include all fields (default shows essential fields only)\n```\n\n## Dry Run\n\nMutating commands accept `--dry-run` to preview the operation without making the change. Where a command performs pre-flight validation (e.g. fetching the target thread to check channel access or ownership), those checks still run in dry-run \u2014 only the mutating write is skipped. Commands that have no pre-flight validation parse the reference and print the preview without hitting the API. The preview is structured:\n\n```\n[dry-run] Would <action>:\n <Key>: <resolved value>\n ...\nRun without --dry-run to execute.\n```\n\n## Reference System\n\nCommands accept flexible references:\n- **Numeric IDs**: `123` or `id:123`\n- **Twist URLs**: Full `https://twist.com/...` URLs (parsed automatically)\n- **Fuzzy names**: For workspaces/users - `\"My Workspace\"` or partial matches\n\n## Piping Content\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 | tw thread reply <ref>\ntw thread create <channel-ref> \"Title\" < body.md\necho \"Quick reply\" | tw 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## Common Workflows\n\n**View by URL (auto-routes to the right command):**\n```bash\ntw view https://twist.com/a/1585/ch/100/t/200 # View thread\ntw view https://twist.com/a/1585/ch/100/t/200/c/300 # View comment\ntw view https://twist.com/a/1585/msg/400 # View conversation\ntw view https://twist.com/a/1585/msg/400/m/500 --json # View message as JSON\n```\n\n**Check inbox and respond:**\n```bash\ntw inbox --unread --json\ntw thread view <id> --unread\ntw thread reply <id> \"Thanks, I'll look into this.\"\ntw thread done <id>\n```\n\n**Search and review:**\n```bash\ntw mentions --since 2026-04-01 --all --json\ntw search \"deployment\" --type threads --json\ntw thread view <thread-id>\n```\n\n**Check DMs:**\n```bash\ntw conversation unread --json\ntw conversation view <conversation-id>\ntw conversation with \"Alice Example\"\ntw conversation reply <id> \"Got it, thanks!\"\n```\n";
|
|
6
|
+
export declare const SKILL_CONTENT = "# Twist CLI (tw)\n\nAccess Twist messaging via the `tw` CLI. Use when the user asks about their Twist workspaces, threads, messages, or wants to interact with Twist in any way.\n\n## Setup\n\n```bash\ntw auth login # OAuth login (opens browser, read-write)\ntw auth login --read-only # OAuth login with read-only scope\ntw auth login --callback-port <n># Override the local OAuth callback port (default 8766)\ntw auth login --json # Emit a JSON envelope for scripted / agent use\ntw auth login --ndjson # Emit an NDJSON envelope for scripted / agent use\ntw auth token # Save API token manually (prompts securely; scope unknown, assumed write-capable)\ntw auth status # Verify authentication + show mode\ntw auth status --json # Full status payload as JSON (--ndjson also supported)\ntw auth status --user <ref> # Target a specific stored account (id, id:<n>, or display name)\ntw auth logout # Remove saved token and auth metadata\ntw auth logout --json # Emits `{\"ok\": true}` (--ndjson is silent)\ntw auth logout --user <ref> # Target a specific stored account; mismatched ref errors with ACCOUNT_NOT_FOUND\ntw auth token view # Print the saved token to stdout (pipe-safe; refuses if TWIST_API_TOKEN is set)\ntw auth token view --user <ref> # Print the saved token for a specific stored account\ntw workspaces # List available workspaces\ntw workspace use <ref> # Set current workspace\ntw completion install # Install shell completions\ntw config view # Show the current CLI configuration file (token masked)\ntw config set <key> <value> # Set a user preference (e.g. unarchive-new-threads true)\ntw doctor # Diagnose CLI setup and environment issues\ntw update # Update CLI to latest version\ntw changelog # Show recent changelog entries\n```\n\nStored auth uses the system credential manager when available. If secure storage is unavailable, `tw` warns and falls back to `~/.config/twist-cli/config.json`. `TWIST_API_TOKEN` always takes priority over the stored token, and legacy plaintext config tokens are migrated automatically when secure storage is available.\n\nIn read-only mode (`tw auth login --read-only`), commands that modify Twist data (reply, archive, react, delete, etc.) are blocked by the CLI. Externally provided tokens (`TWIST_API_TOKEN` or `tw auth token`) are treated as unknown scope and assumed write-capable.\n\n## View by URL\n\n```bash\ntw view <url> # View any Twist entity by URL\n```\n\nRoutes automatically based on URL structure:\n- Message URL \u2192 `tw msg view`\n- Conversation URL \u2192 `tw conversation view`\n- Thread+comment URL \u2192 `tw thread view` (comment ID extracted from URL)\n- Thread URL \u2192 `tw thread view`\n\nAll target command flags pass through (e.g. `--json`, `--raw`, `--full`).\n\n## Inbox\n\n```bash\ntw inbox # Show inbox threads\ntw inbox --unread # Only unread threads\ntw inbox --archive-filter all # Show active + done threads\ntw inbox --archive-filter archived # Show only done threads\ntw inbox --channel <filter> # Filter by channel name (fuzzy)\ntw inbox --since <date> # Filter by date (ISO format)\ntw inbox --limit <n> # Max items (default: 50)\n```\n\n## Threads\n\n```bash\ntw thread <thread-ref> # View thread (shorthand for view)\ntw thread view <thread-ref> # View thread with comments\ntw thread view <ref> --comment <id> # View a specific comment\ntw thread view <url-with-/c/id> # Comment ID extracted from URL\ntw thread view <ref> --unread # Show only unread comments\ntw thread view <ref> --context 3 # Include 3 read comments before unread\ntw thread view <ref> --limit 20 # Limit number of comments\ntw thread view <ref> --since <date> # Comments newer than date\ntw thread view <ref> --raw # Show raw markdown\ntw thread create <channel-ref> \"Title\" \"content\" # Create a new thread\ntw thread create <channel-ref> \"Title\" \"content\" --json # Create and return as JSON\ntw thread create <channel-ref> \"Title\" \"content\" --json --full # Include all thread fields\ntw thread create <channel-ref> \"Title\" \"content\" --notify 123,456 # Notify specific users\ntw thread create <channel-ref> \"Title\" \"content\" --unarchive # Land thread in author's Inbox (overrides default Twist auto-archive)\ntw thread create <channel-ref> \"Title\" \"content\" --no-unarchive # Force archive even when userSettings.unarchiveNewThreads=true\ntw thread create <channel-ref> \"Title\" \"content\" --dry-run # Preview without posting\ntw thread reply <ref> \"content\" # Post a comment (notifies EVERYONE_IN_THREAD by default)\ntw thread reply <ref> \"content\" --notify EVERYONE # Notify all workspace members\ntw thread reply <ref> \"content\" --notify 123,id:456 # Notify specific user IDs\ntw thread reply <ref> \"content\" --json # Post and return comment as JSON\ntw thread reply <ref> \"content\" --json --full # Include all comment fields\ntw thread reply <ref> \"content\" --close # Reply and close the thread\ntw thread reply <ref> \"content\" --reopen # Reply and reopen a closed thread\ntw thread done <ref> # Archive thread (mark done)\ntw thread done <ref> --json # Archive and return status as JSON\ntw thread mute <ref> # Mute thread for 60 minutes (default)\ntw thread mute <ref> --minutes 480 # Mute for custom duration\ntw thread mute <ref> --json # Mute and return { id, mutedUntil } as JSON\ntw thread mute <ref> --json --full # Mute and return full thread as JSON\ntw thread unmute <ref> # Unmute a muted thread\ntw thread unmute <ref> --json # Unmute and return { id, mutedUntil } as JSON\ntw thread delete <ref> # Preview thread deletion (requires --yes to execute)\ntw thread delete <ref> --yes # Permanently delete a thread\ntw thread delete <ref> --yes --json # Delete and return status as JSON\ntw thread rename <ref> \"New title\" # Rename a thread (change its title)\ntw thread rename <ref> \"New title\" --json # Rename and return { id, title } as JSON\ntw thread rename <ref> \"New title\" --json --full # Rename and return full thread as JSON\ntw thread update <ref> \"New body\" # Update a thread's body (the first post)\necho \"New body\" | tw thread update <ref> # Update body from stdin\ntw thread update <ref> \"New body\" --dry-run # Preview without updating\ntw thread update <ref> \"New body\" --json # Update and return { id, content } as JSON\ntw 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 <user-ids>`). Options: EVERYONE, EVERYONE_IN_THREAD, or comma-separated ID refs.\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\ntw comment <comment-ref> # View a comment (shorthand for view)\ntw comment view <comment-ref> # View a single thread comment\ntw comment view <comment-ref> --raw # Show raw markdown\ntw comment view <comment-ref> --json # Output as JSON\ntw comment view <comment-ref> --ndjson # Output as newline-delimited JSON\ntw comment view <comment-ref> --json --full # Include all fields in JSON output\ntw comment update <comment-ref> \"new content\" # Update a thread comment\ntw comment update <comment-ref> \"content\" --json # Update and return updated comment as JSON\ntw comment update <comment-ref> \"content\" --json --full # Include all comment fields\ntw comment delete <comment-ref> # Delete a thread comment\ntw comment delete <comment-ref> --json # Delete and return status as JSON\n```\n\n## Conversations (DMs/Groups)\n\n```bash\ntw conversation unread # List unread conversations\ntw conversation <conversation-ref> # View conversation (shorthand for view)\ntw conversation view <conversation-ref> # View conversation messages\ntw conversation with <user-ref> # Find your 1:1 DM with a user\ntw conversation with <user-ref> --snippet # Include the latest message preview\ntw conversation with <user-ref> --include-groups # List any conversations with that user\ntw conversation reply <ref> \"content\" # Send a message\ntw conversation reply <ref> \"content\" --json # Send and return message as JSON\ntw conversation reply <ref> \"content\" --json --full # Include all message fields\ntw conversation done <ref> # Archive conversation\ntw conversation done <ref> --json # Archive and return status as JSON\ntw conversation mute <ref> # Mute conversation for 60 minutes (default)\ntw conversation mute <ref> --minutes 480 # Mute for custom duration\ntw conversation mute <ref> --json # Mute and return { id, mutedUntil } as JSON\ntw conversation mute <ref> --json --full # Mute and return full conversation as JSON\ntw conversation unmute <ref> # Unmute a muted conversation\ntw conversation unmute <ref> --json # Unmute and return { id, mutedUntil } as JSON\n```\n\nAlias: `tw convo` works the same as `tw conversation`.\n\n## Conversation Messages\n\n```bash\ntw msg <message-ref> # View a message (shorthand for view)\ntw msg view <message-ref> # View a single conversation message\ntw msg update <ref> \"content\" # Edit a conversation message\ntw msg update <ref> \"content\" --json # Edit and return updated message as JSON\ntw msg update <ref> \"content\" --json --full # Include all message fields\ntw msg delete <ref> # Delete a conversation message\ntw msg delete <ref> --json # Delete and return status as JSON\n```\n\nAlias: `tw message` works the same as `tw msg`.\n\n## Search\n\n```bash\ntw mentions # Show content mentioning current user\ntw mentions --since 2026-04-01 --all # Fetch every mention since a date\ntw mentions --type threads --json # Limit mentions to threads\ntw search \"query\" # Search content\ntw search \"query\" --type threads # Filter: threads, messages, or all\ntw search \"query\" --author <ref> # Filter by author\ntw search \"query\" --to <ref> # Messages sent to user\ntw search \"query\" --title-only # Search thread titles only\ntw search \"query\" --mention-me # Results mentioning current user\ntw search \"query\" --conversation <refs> # Limit to conversations (comma-separated refs)\ntw search \"query\" --since <date> # Content from date\ntw search \"query\" --until <date> # Content until date\ntw search \"query\" --channel <refs> # Filter by channel refs (comma-separated)\ntw search \"query\" --limit <n> # Max results (default: 50)\ntw search \"query\" --cursor <cur> # Pagination cursor\ntw search \"query\" --all # Fetch all result pages\n```\n\n## Users, Channels & Groups\n\n```bash\ntw user # Show current user info\ntw user --json # JSON output\ntw user --json --full # Include all fields in JSON output\ntw users # List workspace users\ntw users --search <text> # Filter by name/email\ntw channels # List active joined workspace channels (alias of: tw channel list)\ntw channels --state all # Include archived joined channels too\ntw channels --scope discoverable # Active public channels you can see but have not joined\ntw channels --scope public --state all --json # All visible public channels, with joined status\ntw channel threads <channel-ref> # List threads in a channel (fuzzy name, id:, numeric ID, or URL)\ntw channel threads \"general\" --unread # Only unread threads\ntw channel threads <ref> --archive-filter all # Include archived threads (active|archived|all)\ntw channel threads <ref> --since 2026-01-01 # Filter by last-updated date (ISO)\ntw channel threads <ref> --limit 20 # Max threads per page (default: 50)\ntw channel threads <ref> --limit 20 --cursor <cursor-from-prev> # Paginate\ntw channel threads <ref> --json # { results, nextCursor } with isUnread + url\ntw groups # List workspace groups\ntw groups --search \"frontend\" # Filter groups by name (case-insensitive)\ntw groups --json # JSON output\ntw groups --json --full # Include all fields in JSON output\ntw groups view <group-ref> # Show group with member details\ntw groups view <ref> --json # JSON output with id, name, workspaceId, members\ntw groups view <ref> --json --full # Include all fields in JSON output\ntw groups create \"Name\" # Create a new group\ntw groups create \"Name\" --users alice@doist.com,bob@doist.com # Create with members\ntw groups create \"Name\" --json # Output created group as JSON\ntw groups rename <group-ref> \"New name\" # Rename a group\ntw groups rename <ref> \"Name\" --json # Output renamed group as JSON\ntw groups delete <group-ref> --yes # Delete a group (requires --yes)\ntw groups delete <ref> --dry-run # Preview deletion\ntw groups add-user <group-ref> user1 user2 # Add users to a group\ntw groups add-user <ref> a@d.com,b@d.com # Comma-separated refs\ntw groups add-user <ref> id:123 --json # Output result as JSON\ntw groups remove-user <group-ref> user1 user2 # Remove users from a group\ntw groups remove-user <ref> id:123,id:456 # Comma-separated ID refs\n```\n\nIf a channel is not found in `tw channels`, widen with broader listings such as `tw channels --scope public`, then `tw channels --scope public --state all`. Check `tw channels --help` for other available filters.\n\n`tw 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\n## Away Status\n\n```bash\ntw away # Show current away status\ntw away set <type> [until] # Set away (type: vacation, parental, sickleave, other)\ntw away set vacation 2026-03-20 # Away until March 20\ntw away set vacation 2026-03-20 --from 2026-03-15 # Custom start date\ntw away clear # Clear away status\n```\n\n## Reactions\n\n```bash\ntw react thread <ref> \uD83D\uDC4D # Add reaction to thread\ntw react comment <ref> +1 # Add reaction (shortcode)\ntw react message <ref> heart # Add reaction to DM message\ntw react thread <ref> \uD83D\uDC4D --json # Output result as JSON\ntw unreact thread <ref> \uD83D\uDC4D # Remove reaction\ntw 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\ntw completion install # Install tab completions (prompts for shell)\ntw completion install bash # Install for specific shell\ntw completion install zsh\ntw completion install fish\ntw completion uninstall # Remove completions\n```\n\n### Diagnostics\n\n```bash\ntw doctor # Run local + network diagnostics\ntw doctor --offline # Skip Twist and npm network checks\ntw doctor --json # JSON output with per-check results\n```\n\n### Configuration\n\n```bash\ntw config view # Pretty-printed config, token masked, labels actual token source\ntw config view --json # Raw JSON, token masked\ntw config view --show-token # Include the full token\ntw config set unarchive-new-threads true # Persist: always unarchive new threads so they land in your Inbox\ntw config set unarchive-new-threads false # Persist: keep Twist'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 `tw thread create` (`--unarchive` / `--no-unarchive`) overrides this default per-invocation.\n\n### Update\n\n```bash\ntw update # Update CLI to latest version\ntw update --check # Check for updates without installing, show channel\ntw update --check --json # Same, JSON envelope\ntw update --check --ndjson # Same, newline-delimited JSON envelope\ntw update --channel # Show current update channel\ntw update switch --stable # Switch to stable release channel\ntw update switch --pre-release # Switch to pre-release (next) channel\ntw update switch --pre-release --json # Same, JSON envelope\ntw update switch --pre-release --ndjson # Same, newline-delimited JSON envelope\n```\n\n### Changelog\n```bash\ntw changelog # Show last 5 versions\ntw changelog -n 3 # Show last 3 versions\ntw changelog --count 10 # Show last 10 versions\n```\n\n## Global Options\n\n```bash\n--no-spinner # Disable loading animations\n--progress-jsonl # Machine-readable progress events (JSONL to stderr)\n--progress-jsonl=<path> # Same, but write events to <path> instead of stderr\n--progress-jsonl <path> # Same as above (space-separated form also accepted)\n--accessible # Add text labels to color-coded output (also: TW_ACCESSIBLE=1)\n--non-interactive # Disable interactive prompts (auto-detected when stdin is not a TTY)\n--interactive # Force interactive mode even when stdin is not a TTY\n```\n\n## Output Formats\n\nAll list/view commands support:\n\n```bash\n--json # Output as JSON\n--ndjson # Output as newline-delimited JSON (for streaming)\n--full # Include all fields (default shows essential fields only)\n```\n\n## Dry Run\n\nMutating commands accept `--dry-run` to preview the operation without making the change. Where a command performs pre-flight validation (e.g. fetching the target thread to check channel access or ownership), those checks still run in dry-run \u2014 only the mutating write is skipped. Commands that have no pre-flight validation parse the reference and print the preview without hitting the API. The preview is structured:\n\n```\n[dry-run] Would <action>:\n <Key>: <resolved value>\n ...\nRun without --dry-run to execute.\n```\n\n## Reference System\n\nCommands accept flexible references:\n- **Numeric IDs**: `123` or `id:123`\n- **Twist URLs**: Full `https://twist.com/...` URLs (parsed automatically)\n- **Fuzzy names**: For workspaces/users - `\"My Workspace\"` or partial matches\n\n## Piping Content\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 | tw thread reply <ref>\ntw thread create <channel-ref> \"Title\" < body.md\necho \"Quick reply\" | tw 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## Common Workflows\n\n**View by URL (auto-routes to the right command):**\n```bash\ntw view https://twist.com/a/1585/ch/100/t/200 # View thread\ntw view https://twist.com/a/1585/ch/100/t/200/c/300 # View comment\ntw view https://twist.com/a/1585/msg/400 # View conversation\ntw view https://twist.com/a/1585/msg/400/m/500 --json # View message as JSON\n```\n\n**Check inbox and respond:**\n```bash\ntw inbox --unread --json\ntw thread view <id> --unread\ntw thread reply <id> \"Thanks, I'll look into this.\"\ntw thread done <id>\n```\n\n**Search and review:**\n```bash\ntw mentions --since 2026-04-01 --all --json\ntw search \"deployment\" --type threads --json\ntw thread view <thread-id>\n```\n\n**Check DMs:**\n```bash\ntw conversation unread --json\ntw conversation view <conversation-id>\ntw conversation with \"Alice Example\"\ntw conversation reply <id> \"Got it, thanks!\"\n```\n";
|
|
7
7
|
export declare const SKILL_FILE_CONTENT: string;
|
|
8
8
|
//# sourceMappingURL=content.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/lib/skills/content.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,cAAc,CAAA;AAErC,eAAO,MAAM,iBAAiB,2TAC8R,CAAA;AAE5T,eAAO,MAAM,YAAY,UAAU,CAAA;AAEnC,eAAO,MAAM,aAAa,QAAQ,CAAA;AAElC,eAAO,MAAM,aAAa,QAAsB,CAAA;AAEhD,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/lib/skills/content.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,cAAc,CAAA;AAErC,eAAO,MAAM,iBAAiB,2TAC8R,CAAA;AAE5T,eAAO,MAAM,YAAY,UAAU,CAAA;AAEnC,eAAO,MAAM,aAAa,QAAQ,CAAA;AAElC,eAAO,MAAM,aAAa,QAAsB,CAAA;AAEhD,eAAO,MAAM,aAAa,69oBAqYzB,CAAA;AAED,eAAO,MAAM,kBAAkB,QASd,CAAA"}
|
|
@@ -19,8 +19,12 @@ tw auth login --ndjson # Emit an NDJSON envelope for scripted / agent
|
|
|
19
19
|
tw auth token # Save API token manually (prompts securely; scope unknown, assumed write-capable)
|
|
20
20
|
tw auth status # Verify authentication + show mode
|
|
21
21
|
tw auth status --json # Full status payload as JSON (--ndjson also supported)
|
|
22
|
+
tw auth status --user <ref> # Target a specific stored account (id, id:<n>, or display name)
|
|
22
23
|
tw auth logout # Remove saved token and auth metadata
|
|
23
24
|
tw auth logout --json # Emits \`{"ok": true}\` (--ndjson is silent)
|
|
25
|
+
tw auth logout --user <ref> # Target a specific stored account; mismatched ref errors with ACCOUNT_NOT_FOUND
|
|
26
|
+
tw auth token view # Print the saved token to stdout (pipe-safe; refuses if TWIST_API_TOKEN is set)
|
|
27
|
+
tw auth token view --user <ref> # Print the saved token for a specific stored account
|
|
24
28
|
tw workspaces # List available workspaces
|
|
25
29
|
tw workspace use <ref> # Set current workspace
|
|
26
30
|
tw completion install # Install shell completions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../../src/lib/skills/content.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,uBAAuB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAErE,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,CAAA;AAErC,MAAM,CAAC,MAAM,iBAAiB,GAC1B,wTAAwT,CAAA;AAE5T,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAA;AAEnC,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAA;AAElC,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,CAAA;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAG
|
|
1
|
+
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../../src/lib/skills/content.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,uBAAuB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAErE,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,CAAA;AAErC,MAAM,CAAC,MAAM,iBAAiB,GAC1B,wTAAwT,CAAA;AAE5T,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAA;AAEnC,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAA;AAElC,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,CAAA;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqY5B,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG;QAC1B,UAAU;eACH,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC;WACrC,aAAa;;YAEZ,YAAY;aACX,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;;;EAGxC,aAAa,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doist/twist-cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.38.0",
|
|
4
4
|
"description": "TypeScript CLI for Twist",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"CHANGELOG.md"
|
|
51
51
|
],
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@doist/cli-core": "0.
|
|
53
|
+
"@doist/cli-core": "0.16.1",
|
|
54
54
|
"@doist/twist-sdk": "2.5.1",
|
|
55
55
|
"@pnpm/tabtab": "0.5.4",
|
|
56
56
|
"chalk": "5.6.2",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const SECURE_STORE_DESCRIPTION = "system credential manager";
|
|
2
|
-
export declare class SecureStoreUnavailableError extends Error {
|
|
3
|
-
constructor(message?: string);
|
|
4
|
-
}
|
|
5
|
-
export interface SecureStore {
|
|
6
|
-
getSecret(): Promise<string | null>;
|
|
7
|
-
setSecret(secret: string): Promise<void>;
|
|
8
|
-
deleteSecret(): Promise<boolean>;
|
|
9
|
-
}
|
|
10
|
-
export declare function createSecureStore(): SecureStore;
|
|
11
|
-
//# sourceMappingURL=secure-store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"secure-store.d.ts","sourceRoot":"","sources":["../../src/lib/secure-store.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,wBAAwB,8BAA8B,CAAA;AAEnE,qBAAa,2BAA4B,SAAQ,KAAK;gBACtC,OAAO,SAA6C;CAInE;AAED,MAAM,WAAW,WAAW;IACxB,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IACnC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACxC,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC,CAAA;CACnC;AAED,wBAAgB,iBAAiB,IAAI,WAAW,CA6B/C"}
|
package/dist/lib/secure-store.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
const SERVICE_NAME = 'twist-cli';
|
|
2
|
-
const ACCOUNT_NAME = 'api-token';
|
|
3
|
-
export const SECURE_STORE_DESCRIPTION = 'system credential manager';
|
|
4
|
-
export class SecureStoreUnavailableError extends Error {
|
|
5
|
-
constructor(message = 'System credential storage is unavailable') {
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'SecureStoreUnavailableError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export function createSecureStore() {
|
|
11
|
-
return {
|
|
12
|
-
async getSecret() {
|
|
13
|
-
const entry = await getEntry();
|
|
14
|
-
try {
|
|
15
|
-
return (await entry.getPassword()) ?? null;
|
|
16
|
-
}
|
|
17
|
-
catch (error) {
|
|
18
|
-
throw toUnavailableError(error);
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
async setSecret(secret) {
|
|
22
|
-
const entry = await getEntry();
|
|
23
|
-
try {
|
|
24
|
-
await entry.setPassword(secret);
|
|
25
|
-
}
|
|
26
|
-
catch (error) {
|
|
27
|
-
throw toUnavailableError(error);
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
async deleteSecret() {
|
|
31
|
-
const entry = await getEntry();
|
|
32
|
-
try {
|
|
33
|
-
return await entry.deleteCredential();
|
|
34
|
-
}
|
|
35
|
-
catch (error) {
|
|
36
|
-
throw toUnavailableError(error);
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
async function getEntry() {
|
|
42
|
-
try {
|
|
43
|
-
const { AsyncEntry } = await import('@napi-rs/keyring');
|
|
44
|
-
return new AsyncEntry(SERVICE_NAME, ACCOUNT_NAME);
|
|
45
|
-
}
|
|
46
|
-
catch (error) {
|
|
47
|
-
throw toUnavailableError(error);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
function toUnavailableError(error) {
|
|
51
|
-
if (error instanceof SecureStoreUnavailableError) {
|
|
52
|
-
return error;
|
|
53
|
-
}
|
|
54
|
-
const message = error instanceof Error ? error.message : 'System credential storage is unavailable';
|
|
55
|
-
return new SecureStoreUnavailableError(message);
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=secure-store.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"secure-store.js","sourceRoot":"","sources":["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