@doist/twist-cli 2.36.3 → 2.36.4

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.
Files changed (123) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/commands/auth/helpers.d.ts +8 -1
  3. package/dist/commands/auth/helpers.d.ts.map +1 -1
  4. package/dist/commands/auth/helpers.js +12 -7
  5. package/dist/commands/auth/helpers.js.map +1 -1
  6. package/dist/commands/auth/index.d.ts.map +1 -1
  7. package/dist/commands/auth/index.js +12 -12
  8. package/dist/commands/auth/index.js.map +1 -1
  9. package/dist/commands/auth/login.d.ts +3 -3
  10. package/dist/commands/auth/login.d.ts.map +1 -1
  11. package/dist/commands/auth/login.js +24 -62
  12. package/dist/commands/auth/login.js.map +1 -1
  13. package/dist/commands/auth/logout.d.ts +10 -1
  14. package/dist/commands/auth/logout.d.ts.map +1 -1
  15. package/dist/commands/auth/logout.js +18 -6
  16. package/dist/commands/auth/logout.js.map +1 -1
  17. package/dist/commands/auth/status.d.ts +15 -3
  18. package/dist/commands/auth/status.d.ts.map +1 -1
  19. package/dist/commands/auth/status.js +87 -22
  20. package/dist/commands/auth/status.js.map +1 -1
  21. package/dist/commands/changelog.d.ts +0 -5
  22. package/dist/commands/changelog.d.ts.map +1 -1
  23. package/dist/commands/changelog.js +9 -103
  24. package/dist/commands/changelog.js.map +1 -1
  25. package/dist/commands/channel/list.js +5 -5
  26. package/dist/commands/channel/list.js.map +1 -1
  27. package/dist/commands/config/view.d.ts.map +1 -1
  28. package/dist/commands/config/view.js +3 -3
  29. package/dist/commands/config/view.js.map +1 -1
  30. package/dist/commands/conversation/helpers.d.ts.map +1 -1
  31. package/dist/commands/conversation/helpers.js +4 -3
  32. package/dist/commands/conversation/helpers.js.map +1 -1
  33. package/dist/commands/conversation/unread.d.ts.map +1 -1
  34. package/dist/commands/conversation/unread.js +5 -4
  35. package/dist/commands/conversation/unread.js.map +1 -1
  36. package/dist/commands/conversation/view.d.ts.map +1 -1
  37. package/dist/commands/conversation/view.js +8 -6
  38. package/dist/commands/conversation/view.js.map +1 -1
  39. package/dist/commands/inbox.d.ts.map +1 -1
  40. package/dist/commands/inbox.js +9 -7
  41. package/dist/commands/inbox.js.map +1 -1
  42. package/dist/commands/thread/view.d.ts.map +1 -1
  43. package/dist/commands/thread/view.js +14 -12
  44. package/dist/commands/thread/view.js.map +1 -1
  45. package/dist/commands/update/index.d.ts.map +1 -1
  46. package/dist/commands/update/index.js +43 -14
  47. package/dist/commands/update/index.js.map +1 -1
  48. package/dist/index.js +27 -4
  49. package/dist/index.js.map +1 -1
  50. package/dist/lib/api.d.ts +16 -5
  51. package/dist/lib/api.d.ts.map +1 -1
  52. package/dist/lib/api.js +49 -3
  53. package/dist/lib/api.js.map +1 -1
  54. package/dist/lib/auth-pages.d.ts +3 -0
  55. package/dist/lib/auth-pages.d.ts.map +1 -0
  56. package/dist/lib/{oauth-server.js → auth-pages.js} +3 -120
  57. package/dist/lib/auth-pages.js.map +1 -0
  58. package/dist/lib/auth-provider.d.ts +28 -0
  59. package/dist/lib/auth-provider.d.ts.map +1 -0
  60. package/dist/lib/auth-provider.js +241 -0
  61. package/dist/lib/auth-provider.js.map +1 -0
  62. package/dist/lib/auth.d.ts +16 -10
  63. package/dist/lib/auth.d.ts.map +1 -1
  64. package/dist/lib/auth.js +18 -0
  65. package/dist/lib/auth.js.map +1 -1
  66. package/dist/lib/config.d.ts +23 -2
  67. package/dist/lib/config.d.ts.map +1 -1
  68. package/dist/lib/config.js +95 -47
  69. package/dist/lib/config.js.map +1 -1
  70. package/dist/lib/errors.d.ts +15 -6
  71. package/dist/lib/errors.d.ts.map +1 -1
  72. package/dist/lib/errors.js +14 -9
  73. package/dist/lib/errors.js.map +1 -1
  74. package/dist/lib/global-args.d.ts +35 -21
  75. package/dist/lib/global-args.d.ts.map +1 -1
  76. package/dist/lib/global-args.js +84 -64
  77. package/dist/lib/global-args.js.map +1 -1
  78. package/dist/lib/markdown.d.ts +1 -0
  79. package/dist/lib/markdown.d.ts.map +1 -1
  80. package/dist/lib/markdown.js +9 -14
  81. package/dist/lib/markdown.js.map +1 -1
  82. package/dist/lib/options.d.ts +2 -3
  83. package/dist/lib/options.d.ts.map +1 -1
  84. package/dist/lib/output.d.ts +5 -3
  85. package/dist/lib/output.d.ts.map +1 -1
  86. package/dist/lib/output.js +15 -17
  87. package/dist/lib/output.js.map +1 -1
  88. package/dist/lib/skills/content.d.ts +1 -1
  89. package/dist/lib/skills/content.d.ts.map +1 -1
  90. package/dist/lib/skills/content.js +16 -6
  91. package/dist/lib/skills/content.js.map +1 -1
  92. package/dist/lib/spinner.d.ts +2 -23
  93. package/dist/lib/spinner.d.ts.map +1 -1
  94. package/dist/lib/spinner.js +6 -107
  95. package/dist/lib/spinner.js.map +1 -1
  96. package/dist/lib/update.d.ts +9 -13
  97. package/dist/lib/update.d.ts.map +1 -1
  98. package/dist/lib/update.js +17 -43
  99. package/dist/lib/update.js.map +1 -1
  100. package/package.json +6 -6
  101. package/dist/commands/update/action.d.ts +0 -12
  102. package/dist/commands/update/action.d.ts.map +0 -1
  103. package/dist/commands/update/action.js +0 -104
  104. package/dist/commands/update/action.js.map +0 -1
  105. package/dist/commands/update/switch.d.ts +0 -5
  106. package/dist/commands/update/switch.d.ts.map +0 -1
  107. package/dist/commands/update/switch.js +0 -28
  108. package/dist/commands/update/switch.js.map +0 -1
  109. package/dist/lib/oauth-server.d.ts +0 -13
  110. package/dist/lib/oauth-server.d.ts.map +0 -1
  111. package/dist/lib/oauth-server.js.map +0 -1
  112. package/dist/lib/oauth.d.ts +0 -31
  113. package/dist/lib/oauth.d.ts.map +0 -1
  114. package/dist/lib/oauth.js +0 -150
  115. package/dist/lib/oauth.js.map +0 -1
  116. package/dist/lib/pkce.d.ts +0 -16
  117. package/dist/lib/pkce.d.ts.map +0 -1
  118. package/dist/lib/pkce.js +0 -35
  119. package/dist/lib/pkce.js.map +0 -1
  120. package/dist/test-helpers/empty-output.d.ts +0 -18
  121. package/dist/test-helpers/empty-output.d.ts.map +0 -1
  122. package/dist/test-helpers/empty-output.js +0 -43
  123. package/dist/test-helpers/empty-output.js.map +0 -1
@@ -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 token # Save API token manually (prompts securely; scope unknown, assumed write-capable)\ntw auth status # Verify authentication + show mode\ntw auth status --json # JSON output: { id, email, name }\ntw auth logout # Remove saved token and auth metadata\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 --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\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--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 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";
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,wvmBAuXzB,CAAA;AAED,eAAO,MAAM,kBAAkB,QASd,CAAA"}
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,4joBAiYzB,CAAA;AAED,eAAO,MAAM,kBAAkB,QASd,CAAA"}
@@ -13,10 +13,14 @@ Access Twist messaging via the \`tw\` CLI. Use when the user asks about their Tw
13
13
  \`\`\`bash
14
14
  tw auth login # OAuth login (opens browser, read-write)
15
15
  tw auth login --read-only # OAuth login with read-only scope
16
+ tw auth login --callback-port <n># Override the local OAuth callback port (default 8766)
17
+ tw auth login --json # Emit a JSON envelope for scripted / agent use
18
+ tw auth login --ndjson # Emit an NDJSON envelope for scripted / agent use
16
19
  tw auth token # Save API token manually (prompts securely; scope unknown, assumed write-capable)
17
20
  tw auth status # Verify authentication + show mode
18
- tw auth status --json # JSON output: { id, email, name }
21
+ tw auth status --json # Full status payload as JSON (--ndjson also supported)
19
22
  tw auth logout # Remove saved token and auth metadata
23
+ tw auth logout --json # Emits \`{"ok": true}\` (--ndjson is silent)
20
24
  tw workspaces # List available workspaces
21
25
  tw workspace use <ref> # Set current workspace
22
26
  tw completion install # Install shell completions
@@ -285,9 +289,13 @@ User preferences are stored under \`userSettings\` in the config file. Currently
285
289
  \`\`\`bash
286
290
  tw update # Update CLI to latest version
287
291
  tw update --check # Check for updates without installing, show channel
292
+ tw update --check --json # Same, JSON envelope
293
+ tw update --check --ndjson # Same, newline-delimited JSON envelope
288
294
  tw update --channel # Show current update channel
289
295
  tw update switch --stable # Switch to stable release channel
290
296
  tw update switch --pre-release # Switch to pre-release (next) channel
297
+ tw update switch --pre-release --json # Same, JSON envelope
298
+ tw update switch --pre-release --ndjson # Same, newline-delimited JSON envelope
291
299
  \`\`\`
292
300
 
293
301
  ### Changelog
@@ -300,11 +308,13 @@ tw changelog --count 10 # Show last 10 versions
300
308
  ## Global Options
301
309
 
302
310
  \`\`\`bash
303
- --no-spinner # Disable loading animations
304
- --progress-jsonl # Machine-readable progress events (JSONL to stderr)
305
- --accessible # Add text labels to color-coded output (also: TW_ACCESSIBLE=1)
306
- --non-interactive # Disable interactive prompts (auto-detected when stdin is not a TTY)
307
- --interactive # Force interactive mode even when stdin is not a TTY
311
+ --no-spinner # Disable loading animations
312
+ --progress-jsonl # Machine-readable progress events (JSONL to stderr)
313
+ --progress-jsonl=<path> # Same, but write events to <path> instead of stderr
314
+ --progress-jsonl <path> # Same as above (space-separated form also accepted)
315
+ --accessible # Add text labels to color-coded output (also: TW_ACCESSIBLE=1)
316
+ --non-interactive # Disable interactive prompts (auto-detected when stdin is not a TTY)
317
+ --interactive # Force interactive mode even when stdin is not a TTY
308
318
  \`\`\`
309
319
 
310
320
  ## Output Formats
@@ -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,C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,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiY5B,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"}
@@ -1,24 +1,3 @@
1
- interface SpinnerOptions {
2
- text: string;
3
- color?: 'green' | 'yellow' | 'blue' | 'red' | 'gray' | 'cyan' | 'magenta';
4
- noSpinner?: boolean;
5
- }
6
- export declare function startEarlySpinner(): void;
7
- export declare function stopEarlySpinner(): void;
8
- /** For tests only — reset singleton state without stopping */
9
- export declare function resetEarlySpinner(): void;
10
- declare class LoadingSpinner {
11
- private spinnerInstance;
12
- private adopted;
13
- start(options: SpinnerOptions): this;
14
- succeed(text?: string): void;
15
- fail(text?: string): void;
16
- stop(): void;
17
- }
18
- /**
19
- * High-level wrapper function for running async operations with a loading spinner.
20
- * Automatically handles success/failure states and cleanup.
21
- */
22
- export declare function withSpinner<T>(options: SpinnerOptions, asyncOperation: () => Promise<T>): Promise<T>;
23
- export { LoadingSpinner, type SpinnerOptions };
1
+ export type { SpinnerOptions } from '@doist/cli-core';
2
+ export declare const LoadingSpinner: new () => import("@doist/cli-core").LoadingSpinner, withSpinner: <T>(options: import("@doist/cli-core").SpinnerOptions, op: () => Promise<T>) => Promise<T>, startEarlySpinner: (text?: string) => void, stopEarlySpinner: () => void;
24
3
  //# sourceMappingURL=spinner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/lib/spinner.ts"],"names":[],"mappings":"AAIA,UAAU,cAAc;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACzE,SAAS,CAAC,EAAE,OAAO,CAAA;CACtB;AAOD,wBAAgB,iBAAiB,IAAI,IAAI,CAcxC;AAED,wBAAgB,gBAAgB,IAAI,IAAI,CASvC;AAED,8DAA8D;AAC9D,wBAAgB,iBAAiB,IAAI,IAAI,CAGxC;AAID,cAAM,cAAc;IAChB,OAAO,CAAC,eAAe,CAA+C;IACtE,OAAO,CAAC,OAAO,CAAQ;IAEvB,KAAK,CAAC,OAAO,EAAE,cAAc;IAuB7B,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM;IAcrB,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM;IASlB,IAAI;CAaP;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAAC,CAAC,EAC/B,OAAO,EAAE,cAAc,EACvB,cAAc,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACjC,OAAO,CAAC,CAAC,CAAC,CAWZ;AAED,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/lib/spinner.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AASrD,eAAO,MAAQ,cAAc,sDAAE,WAAW,8FAAE,iBAAiB,2BAAE,gBAAgB,YAAY,CAAA"}
@@ -1,111 +1,10 @@
1
- import chalk from 'chalk';
2
- import yoctoSpinner from 'yocto-spinner';
1
+ import { createSpinner } from '@doist/cli-core';
3
2
  import { shouldDisableSpinner } from './global-args.js';
4
- // ── Early spinner (shown before command module is loaded) ──────────────
5
- let earlySpinnerInstance = null;
6
- let originalStdoutWrite = null;
7
- export function startEarlySpinner() {
8
- if (!process.stdout.isTTY || shouldDisableSpinner()) {
9
- return;
10
- }
11
- earlySpinnerInstance = yoctoSpinner({ text: chalk.blue('Loading...') });
12
- earlySpinnerInstance.start();
13
- // Intercept stdout.write so the spinner auto-stops before any command output
14
- originalStdoutWrite = process.stdout.write.bind(process.stdout);
15
- process.stdout.write = ((...args) => {
16
- stopEarlySpinner();
17
- return process.stdout.write(...args);
18
- });
19
- }
20
- export function stopEarlySpinner() {
21
- if (originalStdoutWrite) {
22
- process.stdout.write = originalStdoutWrite;
23
- originalStdoutWrite = null;
24
- }
25
- if (earlySpinnerInstance) {
26
- earlySpinnerInstance.stop();
27
- earlySpinnerInstance = null;
28
- }
29
- }
30
- /** For tests only — reset singleton state without stopping */
31
- export function resetEarlySpinner() {
32
- earlySpinnerInstance = null;
33
- originalStdoutWrite = null;
34
- }
35
- // ── LoadingSpinner (used by API calls) ─────────────────────────────────
36
- class LoadingSpinner {
37
- spinnerInstance = null;
38
- adopted = false;
39
- start(options) {
40
- // Don't show spinner in non-interactive environments, when disabled via options, or when JSON output is expected
41
- if (!process.stdout.isTTY || options.noSpinner || shouldDisableSpinner()) {
42
- return this;
43
- }
44
- // If an early spinner is running, adopt it instead of creating a new one
45
- if (earlySpinnerInstance) {
46
- this.spinnerInstance = earlySpinnerInstance;
47
- this.spinnerInstance.text = chalk[options.color || 'blue'](options.text);
48
- earlySpinnerInstance = null;
49
- this.adopted = true;
50
- return this;
51
- }
52
- const colorFn = chalk[options.color || 'blue'];
53
- this.spinnerInstance = yoctoSpinner({
54
- text: colorFn(options.text),
55
- });
56
- this.spinnerInstance.start();
57
- return this;
58
- }
59
- succeed(text) {
60
- if (this.spinnerInstance) {
61
- if (this.adopted) {
62
- // Release back so subsequent API calls can re-adopt
63
- earlySpinnerInstance = this.spinnerInstance;
64
- this.spinnerInstance = null;
65
- this.adopted = false;
66
- return;
67
- }
68
- this.spinnerInstance.success(text ? chalk.green(`✓ ${text}`) : undefined);
69
- this.spinnerInstance = null;
70
- }
71
- }
72
- fail(text) {
73
- if (this.spinnerInstance) {
74
- // Errors always stop the spinner for real
75
- this.spinnerInstance.error(text ? chalk.red(`✗ ${text}`) : undefined);
76
- this.spinnerInstance = null;
77
- this.adopted = false;
78
- }
79
- }
80
- stop() {
81
- if (this.spinnerInstance) {
82
- if (this.adopted) {
83
- // Release back so subsequent API calls can re-adopt
84
- earlySpinnerInstance = this.spinnerInstance;
85
- this.spinnerInstance = null;
86
- this.adopted = false;
87
- return;
88
- }
89
- this.spinnerInstance.stop();
90
- this.spinnerInstance = null;
91
- }
92
- }
93
- }
94
3
  /**
95
- * High-level wrapper function for running async operations with a loading spinner.
96
- * Automatically handles success/failure states and cleanup.
4
+ * Twist spinner kit. The CLI-specific bit is `shouldDisableSpinner`
5
+ * everything else (early-spinner singleton, adoption, withSpinner, the
6
+ * LoadingSpinner class) lives in cli-core.
97
7
  */
98
- export async function withSpinner(options, asyncOperation) {
99
- const loadingSpinner = new LoadingSpinner().start(options);
100
- try {
101
- const result = await asyncOperation();
102
- loadingSpinner.stop(); // Don't show success message by default - let the command handle its own output
103
- return result;
104
- }
105
- catch (error) {
106
- loadingSpinner.fail();
107
- throw error;
108
- }
109
- }
110
- export { LoadingSpinner };
8
+ const spinner = createSpinner({ isDisabled: shouldDisableSpinner });
9
+ export const { LoadingSpinner, withSpinner, startEarlySpinner, stopEarlySpinner } = spinner;
111
10
  //# sourceMappingURL=spinner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../src/lib/spinner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK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ACrB,MAAM,KAAK,CAAA;IACf,CAAC;AACL,CAAC;AAED,OAAO,EAAE,cAAc,EAAuB,CAAA"}
1
+ {"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../src/lib/spinner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAIvD;;;;GAIG;AACH,MAAM,OAAO,GAAG,aAAa,CAAC,EAAE,UAAU,EAAE,oBAAoB,EAAE,CAAC,CAAA;AAEnE,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAA"}
@@ -1,17 +1,13 @@
1
1
  import { type UpdateChannel } from './config.js';
2
- export declare const PACKAGE_NAME = "@doist/twist-cli";
3
- interface ParsedVersion {
4
- major: number;
5
- minor: number;
6
- patch: number;
7
- prerelease: string | undefined;
8
- }
9
- export declare function getInstallTag(channel: UpdateChannel): string;
10
- export declare function normalizeUpdateChannel(channel: unknown): UpdateChannel;
11
- export declare function parseVersion(version: string): ParsedVersion;
12
- export declare function compareVersions(a: string, b: string): number;
13
- export declare function isNewer(current: string, candidate: string): boolean;
2
+ export { compareVersions, getInstallTag, isNewer, parseVersion } from '@doist/cli-core/commands';
14
3
  export declare function fetchLatestVersion(channel: UpdateChannel): Promise<string>;
4
+ /**
5
+ * Tolerant channel read for `tw doctor`. Returns the persisted value when
6
+ * valid, otherwise `'stable'`. cli-core's strict `getConfiguredUpdateChannel`
7
+ * throws `INVALID_UPDATE_CHANNEL` — right behaviour for the user-facing
8
+ * `tw update` command (handled by cli-core internally), wrong behaviour for
9
+ * diagnostics which should surface the problem as a doctor warning rather
10
+ * than crash.
11
+ */
15
12
  export declare function getConfiguredUpdateChannel(): Promise<UpdateChannel>;
16
- export {};
17
13
  //# sourceMappingURL=update.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/lib/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3D,eAAO,MAAM,YAAY,qBAAqB,CAAA;AAO9C,UAAU,aAAa;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;CACjC;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAE5D;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,CAItE;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,CAI3D;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAgB5D;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAEnE;AAED,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAQhF;AAED,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,aAAa,CAAC,CAGzE"}
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/lib/update.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,aAAa,EAAmB,MAAM,aAAa,CAAA;AAE5E,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEhG,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAEhF;AAED;;;;;;;GAOG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,aAAa,CAAC,CAMzE"}
@@ -1,49 +1,23 @@
1
- import { getConfig } from './config.js';
2
- export const PACKAGE_NAME = '@doist/twist-cli';
3
- const VALID_UPDATE_CHANNELS = new Set(['stable', 'pre-release']);
4
- export function getInstallTag(channel) {
5
- return channel === 'pre-release' ? 'next' : 'latest';
6
- }
7
- export function normalizeUpdateChannel(channel) {
8
- return typeof channel === 'string' && VALID_UPDATE_CHANNELS.has(channel)
9
- ? channel
10
- : 'stable';
11
- }
12
- export function parseVersion(version) {
13
- const [core, ...rest] = version.replace(/^v/, '').split('-');
14
- const [major, minor, patch] = core.split('.').map(Number);
15
- return { major, minor, patch, prerelease: rest.length > 0 ? rest.join('-') : undefined };
16
- }
17
- export function compareVersions(a, b) {
18
- const left = parseVersion(a);
19
- const right = parseVersion(b);
20
- for (const key of ['major', 'minor', 'patch']) {
21
- if (left[key] !== right[key])
22
- return left[key] > right[key] ? 1 : -1;
23
- }
24
- if (!left.prerelease && right.prerelease)
25
- return 1;
26
- if (left.prerelease && !right.prerelease)
27
- return -1;
28
- if (left.prerelease && right.prerelease) {
29
- return left.prerelease.localeCompare(right.prerelease, undefined, { numeric: true });
30
- }
31
- return 0;
32
- }
33
- export function isNewer(current, candidate) {
34
- return compareVersions(candidate, current) > 0;
35
- }
1
+ import { fetchLatestVersion as fetchLatestVersionCore } from '@doist/cli-core/commands';
2
+ import packageJson from '../../package.json' with { type: 'json' };
3
+ import { getConfig, UPDATE_CHANNELS } from './config.js';
4
+ export { compareVersions, getInstallTag, isNewer, parseVersion } from '@doist/cli-core/commands';
36
5
  export async function fetchLatestVersion(channel) {
37
- const url = `https://registry.npmjs.org/${PACKAGE_NAME}/${getInstallTag(channel)}`;
38
- const response = await fetch(url);
39
- if (!response.ok) {
40
- throw new Error(`Registry returned ${response.status}`);
41
- }
42
- const data = (await response.json());
43
- return data.version;
6
+ return fetchLatestVersionCore({ packageName: packageJson.name, channel });
44
7
  }
8
+ /**
9
+ * Tolerant channel read for `tw doctor`. Returns the persisted value when
10
+ * valid, otherwise `'stable'`. cli-core's strict `getConfiguredUpdateChannel`
11
+ * throws `INVALID_UPDATE_CHANNEL` — right behaviour for the user-facing
12
+ * `tw update` command (handled by cli-core internally), wrong behaviour for
13
+ * diagnostics which should surface the problem as a doctor warning rather
14
+ * than crash.
15
+ */
45
16
  export async function getConfiguredUpdateChannel() {
46
17
  const config = await getConfig();
47
- return normalizeUpdateChannel(config.updateChannel);
18
+ const channel = config.updateChannel;
19
+ return typeof channel === 'string' && UPDATE_CHANNELS.has(channel)
20
+ ? channel
21
+ : 'stable';
48
22
  }
49
23
  //# sourceMappingURL=update.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/lib/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAsB,MAAM,aAAa,CAAA;AAE3D,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAA;AAC9C,MAAM,qBAAqB,GAA+B,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAA;AAa5F,MAAM,UAAU,aAAa,CAAC,OAAsB;IAChD,OAAO,OAAO,KAAK,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAA;AACxD,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,OAAgB;IACnD,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,qBAAqB,CAAC,GAAG,CAAC,OAAwB,CAAC;QACrF,CAAC,CAAE,OAAyB;QAC5B,CAAC,CAAC,QAAQ,CAAA;AAClB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,OAAe;IACxC,MAAM,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC5D,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;I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;IACpC,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,eAAe,CAAC,GAAG,CAAC,OAAwB,CAAC;QAC/E,CAAC,CAAE,OAAyB;QAC5B,CAAC,CAAC,QAAQ,CAAA;AAClB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/twist-cli",
3
- "version": "2.36.3",
3
+ "version": "2.36.4",
4
4
  "description": "TypeScript CLI for Twist",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -50,24 +50,24 @@
50
50
  "CHANGELOG.md"
51
51
  ],
52
52
  "dependencies": {
53
+ "@doist/cli-core": "0.10.0",
53
54
  "@doist/twist-sdk": "2.5.1",
54
55
  "@pnpm/tabtab": "0.5.4",
55
56
  "chalk": "5.6.2",
56
57
  "commander": "14.0.3",
57
58
  "marked": "18.0.3",
58
59
  "marked-terminal-renderer": "2.2.0",
59
- "open": "11.0.0",
60
- "yocto-spinner": "1.2.0"
60
+ "open": "11.0.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@semantic-release/changelog": "6.0.3",
64
64
  "@semantic-release/exec": "7.1.0",
65
65
  "@semantic-release/git": "10.0.1",
66
- "@types/node": "25.6.0",
66
+ "@types/node": "25.6.2",
67
67
  "conventional-changelog-conventionalcommits": "9.3.1",
68
68
  "lefthook": "2.1.6",
69
- "oxfmt": "0.47.0",
70
- "oxlint": "1.62.0",
69
+ "oxfmt": "0.48.0",
70
+ "oxlint": "1.63.0",
71
71
  "semantic-release": "25.0.3",
72
72
  "typescript": "6.0.3",
73
73
  "vitest": "4.1.5"
@@ -1,12 +0,0 @@
1
- export declare function detectPackageManager(): string;
2
- export declare function runInstall(pm: string, tag: string): Promise<{
3
- exitCode: number;
4
- stderr: string;
5
- }>;
6
- interface UpdateOptions {
7
- check?: boolean;
8
- channel?: boolean;
9
- }
10
- export declare function updateAction(options: UpdateOptions): Promise<void>;
11
- export {};
12
- //# sourceMappingURL=action.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../src/commands/update/action.ts"],"names":[],"mappings":"AAaA,wBAAgB,oBAAoB,IAAI,MAAM,CAM7C;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAejG;AAED,UAAU,aAAa;IACnB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,OAAO,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAsGxE"}
@@ -1,104 +0,0 @@
1
- import { spawn } from 'node:child_process';
2
- import chalk from 'chalk';
3
- import pkg from '../../../package.json' with { type: 'json' };
4
- import { CliError } from '../../lib/errors.js';
5
- import { withSpinner } from '../../lib/spinner.js';
6
- import { fetchLatestVersion, getConfiguredUpdateChannel, getInstallTag, isNewer, PACKAGE_NAME, } from '../../lib/update.js';
7
- export function detectPackageManager() {
8
- const execPath = process.env.npm_execpath ?? '';
9
- if (execPath.includes('pnpm')) {
10
- return 'pnpm';
11
- }
12
- return 'npm';
13
- }
14
- export function runInstall(pm, tag) {
15
- const command = pm === 'pnpm' ? 'add' : 'install';
16
- return new Promise((resolve, reject) => {
17
- const child = spawn(pm, [command, '-g', `${PACKAGE_NAME}@${tag}`], {
18
- stdio: 'pipe',
19
- });
20
- let stderr = '';
21
- child.stderr?.on('data', (data) => {
22
- stderr += data.toString();
23
- });
24
- child.on('error', reject);
25
- child.on('close', (code) => resolve({ exitCode: code ?? 1, stderr }));
26
- });
27
- }
28
- export async function updateAction(options) {
29
- if (options.check && options.channel) {
30
- throw new CliError('CONFLICTING_OPTIONS', 'Specify either --check or --channel, not both.');
31
- }
32
- if (options.channel) {
33
- const ch = await getConfiguredUpdateChannel();
34
- if (ch === 'pre-release') {
35
- console.log(`Update channel: ${chalk.magenta('pre-release')}`);
36
- }
37
- else {
38
- console.log(`Update channel: ${chalk.green('stable')}`);
39
- }
40
- return;
41
- }
42
- const currentVersion = pkg.version;
43
- const channel = await getConfiguredUpdateChannel();
44
- const tag = getInstallTag(channel);
45
- const label = channel === 'pre-release' ? ` ${chalk.magenta('(pre-release)')}` : '';
46
- let latestVersion;
47
- try {
48
- latestVersion = await withSpinner({ text: `Checking for updates${label}...` }, () => fetchLatestVersion(channel));
49
- }
50
- catch (error) {
51
- const message = error instanceof Error ? error.message : 'Unknown error';
52
- throw new CliError('API_ERROR', `Failed to check for updates: ${message}`);
53
- }
54
- const updateAvailable = isNewer(currentVersion, latestVersion);
55
- if (options.check) {
56
- const channelLine = channel === 'pre-release'
57
- ? ` Channel: ${chalk.magenta('pre-release')}`
58
- : ` Channel: ${chalk.green('stable')}`;
59
- if (currentVersion === latestVersion) {
60
- console.log(chalk.green('✓'), `Already up to date (v${currentVersion})`);
61
- }
62
- else if (updateAvailable) {
63
- console.log(`Update available: ${chalk.dim(`v${currentVersion}`)} → ${chalk.green(`v${latestVersion}`)}${label}`);
64
- }
65
- else {
66
- console.log(`Downgrade available: ${chalk.dim(`v${currentVersion}`)} → ${chalk.yellow(`v${latestVersion}`)}${label}`);
67
- }
68
- console.log(channelLine);
69
- return;
70
- }
71
- if (currentVersion === latestVersion) {
72
- console.log(chalk.green('✓'), `Already up to date (v${currentVersion})`);
73
- return;
74
- }
75
- if (updateAvailable) {
76
- console.log(`Update available${label}: ${chalk.dim(`v${currentVersion}`)} → ${chalk.green(`v${latestVersion}`)}`);
77
- }
78
- else {
79
- console.log(`Downgrade available${label}: ${chalk.dim(`v${currentVersion}`)} → ${chalk.yellow(`v${latestVersion}`)}`);
80
- }
81
- const pm = detectPackageManager();
82
- let result;
83
- try {
84
- result = await withSpinner({ text: `Updating to v${latestVersion}${label}...`, color: 'blue' }, () => runInstall(pm, tag));
85
- }
86
- catch (error) {
87
- if (error instanceof Error && 'code' in error && error.code === 'EACCES') {
88
- throw new CliError('INTERNAL_ERROR', 'Permission denied.', [
89
- `Try running with sudo: sudo ${pm} ${pm === 'pnpm' ? 'add' : 'install'} -g ${PACKAGE_NAME}@${tag}`,
90
- ]);
91
- }
92
- const message = error instanceof Error ? error.message : 'Unknown error';
93
- throw new CliError('INTERNAL_ERROR', `Update failed: ${message}`);
94
- }
95
- if (result.exitCode !== 0) {
96
- const detail = result.stderr ? `\n${result.stderr.trim()}` : '';
97
- throw new CliError('INTERNAL_ERROR', `Update failed: ${pm} exited with code ${result.exitCode}${detail}`);
98
- }
99
- console.log(chalk.green('✓'), `Updated to v${latestVersion}`);
100
- if (channel !== 'pre-release') {
101
- console.log(chalk.dim(' Run'), chalk.cyan('tw changelog'), chalk.dim('to see what changed'));
102
- }
103
- }
104
- //# sourceMappingURL=action.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action.js","sourceRoot":"","sources":["../../../src/commands/update/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,GAAG,MAAM,uBAAuB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EACH,kBAAkB,EAClB,0BAA0B,EAC1B,aAAa,EACb,OAAO,EACP,YAAY,GACf,MAAM,qBAAqB,CAAA;AAE5B,MAAM,UAAU,oBAAoB;IAChC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAA;IAC/C,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAA;IACjB,CAAC;IACD,OAAO,KAAK,CAAA;AAChB,CAAC;AAED,MAAM,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