export declare const SKILL_NAME = "twist-cli"; export declare const SKILL_DESCRIPTION = "Twist messaging CLI. View and respond to inbox threads, channel threads, direct messages, mentions, and group conversations; search, react, archive, mute, and manage workspaces. Use when the user mentions Twist, asks about their inbox, mentions, threads, DMs, channels, or wants to read or send Twist messages."; export declare const SKILL_AUTHOR = "Doist"; export declare const SKILL_LICENSE = "MIT"; export declare const SKILL_VERSION: string; 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 # 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 # Target a specific stored account (id, id:, or display name)\ntw --user auth # Equivalent to passing --user after the subcommand; other commands accept the flag but ignore it\ntw auth logout # Remove saved token and auth metadata\ntw auth logout --json # Emits `{\"ok\": true}` (--ndjson is silent)\ntw auth logout --user # 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 # Print the saved token for a specific stored account\ntw account [list|current|use |remove ] # Manage stored accounts; all support --json/--ndjson\n # current's payload is {id, label, authMode, authScope, source:\"config\"} | {source:\"env\"} | {source:\"legacy\"}\ntw auth login # Re-running auth login with a different OAuth grant adds a NEW account; default stays pinned unless none was set\ntw workspaces # List available workspaces\ntw workspace use # Set current workspace\ntw completion install # Install shell completions\ntw config view # Show the current CLI configuration file (token masked)\ntw config set # 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 # 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 by channel name (fuzzy)\ntw inbox --since # Filter by date (ISO format)\ntw inbox --limit # Max items (default: 50)\n```\n\n## Threads\n\n```bash\ntw thread # View thread (shorthand for view)\ntw thread view # View thread with comments\ntw thread view --comment # View a specific comment\ntw thread view # Comment ID extracted from URL\ntw thread view --unread # Show only unread comments\ntw thread view --context 3 # Include 3 read comments before unread\ntw thread view --limit 20 # Limit number of comments\ntw thread view --since # Comments newer than date\ntw thread view --raw # Show raw markdown\ntw thread create \"Title\" \"content\" # Create a new thread\ntw thread create \"Title\" \"content\" --json # Create and return as JSON\ntw thread create \"Title\" \"content\" --json --full # Include all thread fields\ntw thread create \"Title\" \"content\" --notify 123,456 # Notify specific users\ntw thread create \"Title\" \"content\" --unarchive # Land thread in author's Inbox (overrides default Twist auto-archive)\ntw thread create \"Title\" \"content\" --no-unarchive # Force archive even when userSettings.unarchiveNewThreads=true\ntw thread create \"Title\" \"content\" --dry-run # Preview without posting\ntw thread create \"Title\" --file ./a.png # Attach a file (repeatable; content optional)\ntw thread reply \"content\" # Post a comment (notifies EVERYONE_IN_THREAD by default)\ntw thread reply \"content\" --notify EVERYONE # Notify all workspace members\ntw thread reply \"content\" --notify 123,id:456 # Notify specific user IDs\ntw thread reply \"content\" --json # Post and return comment as JSON\ntw thread reply \"content\" --json --full # Include all comment fields\ntw thread reply \"content\" --close # Reply and close the thread\ntw thread reply \"content\" --reopen # Reply and reopen a closed thread\ntw thread reply \"content\" --file ./a.png # Attach a file (repeatable; content optional)\ntw thread done # Archive thread (mark done)\ntw thread done --json # Archive and return status as JSON\ntw thread mute # Mute thread for 60 minutes (default)\ntw thread mute --minutes 480 # Mute for custom duration\ntw thread mute --json # Mute and return { id, mutedUntil } as JSON\ntw thread mute --json --full # Mute and return full thread as JSON\ntw thread unmute # Unmute a muted thread\ntw thread unmute --json # Unmute and return { id, mutedUntil } as JSON\ntw thread delete # Preview thread deletion (requires --yes to execute)\ntw thread delete --yes # Permanently delete a thread\ntw thread delete --yes --json # Delete and return status as JSON\ntw thread rename \"New title\" # Rename a thread (change its title)\ntw thread rename \"New title\" --json # Rename and return { id, title } as JSON\ntw thread rename \"New title\" --json --full # Rename and return full thread as JSON\ntw thread update \"New body\" # Update a thread's body (the first post)\necho \"New body\" | tw thread update # Update body from stdin\ntw thread update \"New body\" --dry-run # Preview without updating\ntw thread update \"New body\" --json # Update and return { id, content } as JSON\ntw thread update \"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 `). 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 # View a comment (shorthand for view)\ntw comment view # View a single thread comment\ntw comment view --raw # Show raw markdown\ntw comment view --json # Output as JSON\ntw comment view --ndjson # Output as newline-delimited JSON\ntw comment view --json --full # Include all fields in JSON output\ntw comment update \"new content\" # Update a thread comment\ntw comment update \"content\" --json # Update and return updated comment as JSON\ntw comment update \"content\" --json --full # Include all comment fields\ntw comment delete # Delete a thread comment\ntw comment delete --json # Delete and return status as JSON\n```\n\n## Conversations (DMs/Groups)\n\n```bash\ntw conversation unread # List unread conversations\ntw conversation # View conversation (shorthand for view)\ntw conversation view # View conversation messages\ntw conversation with # Find your 1:1 DM with a user\ntw conversation with --snippet # Include the latest message preview\ntw conversation with --include-groups # List any conversations with that user\ntw conversation reply \"content\" # Send a message\ntw conversation reply \"content\" --json # Send and return message as JSON\ntw conversation reply \"content\" --json --full # Include all message fields\ntw conversation reply \"content\" --file ./a.png # Attach a file (repeatable; content optional)\ntw conversation done # Archive conversation\ntw conversation done --json # Archive and return status as JSON\ntw conversation mute # Mute conversation for 60 minutes (default)\ntw conversation mute --minutes 480 # Mute for custom duration\ntw conversation mute --json # Mute and return { id, mutedUntil } as JSON\ntw conversation mute --json --full # Mute and return full conversation as JSON\ntw conversation unmute # Unmute a muted conversation\ntw conversation unmute --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 # View a message (shorthand for view)\ntw msg view # View a single conversation message\ntw msg update \"content\" # Edit a conversation message\ntw msg update \"content\" --json # Edit and return updated message as JSON\ntw msg update \"content\" --json --full # Include all message fields\ntw msg delete # Delete a conversation message\ntw msg delete --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 # Filter by author\ntw search \"query\" --to # 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 # Limit to conversations (comma-separated refs)\ntw search \"query\" --since # Content from date\ntw search \"query\" --until # Content until date\ntw search \"query\" --channel # Filter by channel refs (comma-separated)\ntw search \"query\" --limit # Max results (default: 50)\ntw search \"query\" --cursor # 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 active workspace users\ntw users --search # Filter by name/email\ntw users --include-removed # Include users removed from the workspace\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 # List threads in a channel (fuzzy name, id:, numeric ID, or URL)\ntw channel threads \"general\" --unread # Only unread threads\ntw channel threads --archive-filter all # Include archived threads (active|archived|all)\ntw channel threads --since 2026-01-01 # Filter by last-updated date (ISO)\ntw channel threads --limit 20 # Max threads per page (default: 50)\ntw channel threads --limit 20 --cursor # Paginate\ntw channel threads --json # { results, nextCursor } with isUnread + url\ntw channel create \"Name\" # Create a new (public) channel in the default/current workspace\ntw channel create \"Name\" --workspace # Target a different workspace\ntw channel create \"Name\" --private # Create a private channel\ntw channel create \"Name\" --description \"...\" # Set channel description\ntw channel create \"Name\" --json --full # Output created channel as JSON (all fields)\ntw channel delete --yes # Delete a channel (requires --yes; usually admin-only on Twist)\ntw channel delete --workspace --yes # Target a different workspace\ntw channel delete --dry-run # Preview deletion\ntw channel archive # Archive a channel (no-op if already archived)\ntw channel unarchive id: # Unarchive a channel (pass id:/numeric ref for archived channels)\ntw channel members # List members + groups whose membership \u2286 channel\ntw channel members --json # JSON with id, name, members, groupsFullyInChannel\ntw channel members add # Add users and/or group: (group expansion is one-shot)\ntw channel members add alice group:Frontend # Mix of user refs and group: prefix\ntw channel members add id:123 --dry-run # Preview the diff\ntw channel members remove # Remove users and/or group:\ntw channel members set # Replace membership; dry-run by default\ntw channel members set group:Squad --apply # Mutate. Refuses to remove self unless --include-self\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 # Show group with member details\ntw groups view --json # JSON output with id, name, workspaceId, members\ntw groups view --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 \"New name\" # Rename a group\ntw groups rename \"Name\" --json # Output renamed group as JSON\ntw groups delete --yes # Delete a group (requires --yes)\ntw groups delete --dry-run # Preview deletion\ntw groups add-user user1 user2 # Add users to a group\ntw groups add-user a@d.com,b@d.com # Comma-separated refs\ntw groups add-user id:123 --json # Output result as JSON\ntw groups remove-user user1 user2 # Remove users from a group\ntw groups remove-user 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`tw channel members add`, `remove`, and `set` accept user refs (id:N, email, name) and `group:` mixed in any order. Groups are expanded to their current users at call time \u2014 the group is **not** persistently linked to the channel, so users added later to the group will not auto-join. `set` replaces the channel's membership with the resolved ref set; it is dry-run by default, pass `--apply` to mutate and `--include-self` to allow the diff to remove the acting user. `tw channel members` (with no subcommand) shows the user list plus a \"groups fully in channel\" hint \u2014 groups whose entire membership is currently present in the channel.\n\n## Away Status\n\n```bash\ntw away # Show current away status\ntw away set [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 \uD83D\uDC4D # Add reaction to thread\ntw react comment +1 # Add reaction (shortcode)\ntw react message heart # Add reaction to DM message\ntw react thread \uD83D\uDC4D --json # Output result as JSON\ntw unreact thread \uD83D\uDC4D # Remove reaction\ntw unreact thread \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= # Same, but write events to instead of stderr\n--progress-jsonl # 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 :\n : \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 \ntw thread create \"Title\" < body.md\necho \"Quick reply\" | tw conversation reply \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 --unread\ntw thread reply \"Thanks, I'll look into this.\"\ntw thread done \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 \n```\n\n**Check DMs:**\n```bash\ntw conversation unread --json\ntw conversation view \ntw conversation with \"Alice Example\"\ntw conversation reply \"Got it, thanks!\"\n```\n"; export declare const SKILL_FILE_CONTENT: string; //# sourceMappingURL=content.d.ts.map