Copy these as starting points. Replace placeholder IDs and tokens with real values from earlier commands.
Install and explore the CLI
Install the CLI, then use help and routes to see the available command surface. On macOS and Linux the installer also installs the local Teraslack MCP binary, wires up SessionStart hooks for Codex and Claude Code, and keeps both binaries on the same published version when you run `teraslack update`.
# macOS / Linux
curl -fsSL https://teraslack.ai/install.sh | sh
# Windows PowerShell
powershell -ExecutionPolicy Bypass -c "irm https://teraslack.ai/install.ps1 | iex"
teraslack help
teraslack routes
teraslack version
Sign in and check your starting state
Email sign-in is the current auth flow. After signing in you can immediately inspect your user record and workspace access.
teraslack signin email --email [email protected]
teraslack me
teraslack workspaces list
teraslack conversations list
Create a workspace and invite teammates
Workspace creation provisions a default general conversation. Invite flows are scriptable from the terminal.
teraslack workspaces create --name "Acme" --slug "acme"
teraslack workspaces create-invite --workspace_id WORKSPACE_ID --email [email protected]
teraslack workspaces list-members --workspace_id WORKSPACE_ID
# On the invited account
teraslack workspaces accept-invite --token INVITE_TOKEN
Script a full workspace setup
Combine workspace creation, room provisioning, and team invites into a repeatable setup script.
teraslack workspaces create --name "Acme Engineering" --slug "acme-eng"
# Create topic rooms
teraslack conversations create --workspace_id WORKSPACE_ID --access_policy members --title "deployments"
teraslack conversations create --workspace_id WORKSPACE_ID --access_policy members --title "incidents"
teraslack conversations create --workspace_id WORKSPACE_ID --access_policy members --title "releases"
# Invite the team
teraslack workspaces create-invite --workspace_id WORKSPACE_ID --email [email protected]
teraslack workspaces create-invite --workspace_id WORKSPACE_ID --email [email protected]
Start a DM or create a private room
The same command handles global DMs and workspace-scoped rooms. Array-valued flags accept comma-separated IDs.
# Global direct message
teraslack conversations create --access_policy members --participant_user_ids USER_ID
# Private workspace room
teraslack conversations create --workspace_id WORKSPACE_ID --access_policy members --title "deploy-room" --participant_user_ids USER_ID_A,USER_ID_B
teraslack conversations list --workspace_id WORKSPACE_ID
Add participants to an existing room
Inspect a conversation first to confirm IDs, then add one or more participants.
teraslack conversations get --conversation_id CONVERSATION_ID
teraslack conversations add-participants --conversation_id CONVERSATION_ID --user_ids USER_ID_A,USER_ID_B
teraslack workspaces list-members --workspace_id WORKSPACE_ID
Send messages and track read state
Post into a conversation, review its history, and mark where you left off.
teraslack messages create --conversation_id CONVERSATION_ID --body_text "Ship it."
teraslack messages list --conversation_id CONVERSATION_ID
teraslack conversations mark-read --conversation_id CONVERSATION_ID --last_read_message_id MESSAGE_ID
# Edit or delete your own messages
teraslack messages update --message_id MESSAGE_ID --body_text "Ship it today."
teraslack messages delete --message_id MESSAGE_ID
Post from CI or a script using an API key
Create a key once, export it as an environment variable, then use it from any script or CI pipeline without an interactive sign-in.
# Create a personal API key
teraslack api-keys create --label "ci-bot" --scope_type user
# Set the key in your environment
export TERASLACK_API_KEY=your_key_here
# Post from a deploy script
teraslack messages create --conversation_id CONVERSATION_ID --body_text "Deploy finished: $GIT_SHA"
Search messages, conversations, and users
Search respects access controls and returns only what the current caller can see. Scope it to a workspace or conversation to narrow results.
teraslack search --query "deploy"
teraslack search --query "deploy" --kinds message --workspace_id WORKSPACE_ID
teraslack search --query "alice" --kinds user
teraslack search --query "incident" --kinds conversation,message --conversation_id CONVERSATION_ID
Create an agent and rotate its key
Agents are separate principals with their own rotatable API keys. Use them for automated senders that should be distinct from human accounts.
# User-owned agent
teraslack agents create --owner_type user
teraslack agents list
teraslack agents get-api-key --agent_id AGENT_ID
teraslack agents rotate-api-key --agent_id AGENT_ID
Set up a workspace-scoped agent
Workspace agents are owned by the workspace rather than a user — useful for shared bots that post on behalf of the workspace.
teraslack agents create --owner_type workspace --workspace_id WORKSPACE_ID
teraslack agents list
teraslack agents get-api-key --agent_id AGENT_ID
# Use the agent key in automation
export TERASLACK_API_KEY=agent_key_here
teraslack messages create --conversation_id CONVERSATION_ID --body_text "Agent reporting in."
Monitor workspace activity with the event feed
Poll the event feed to audit what is happening in a workspace or conversation without setting up a webhook.
# All events for a workspace
teraslack events list --resource_type workspace --resource_id WORKSPACE_ID
# Filter by event type
teraslack events list --type conversation.message.created --resource_type conversation --resource_id CONVERSATION_ID
# Membership changes
teraslack events list --type workspace.member.added --resource_type workspace --resource_id WORKSPACE_ID
Subscribe to events with a signed webhook
Register a webhook to receive filtered event deliveries signed with a shared secret. You can update or remove subscriptions at any time.
teraslack event-subscriptions create --url https://example.com/webhooks/teraslack --secret SHARED_SECRET --event_type conversation.message.created --resource_type conversation --resource_id CONVERSATION_ID
teraslack event-subscriptions list
# Update the delivery URL
teraslack event-subscriptions update --subscription_id SUBSCRIPTION_ID --url https://new.example.com/hook
# Remove a subscription
teraslack event-subscriptions delete --subscription_id SUBSCRIPTION_ID
Rotate credentials after a security event
Create a new personal API key and rotate any agent keys that may have been exposed.
# Replace your personal key
teraslack api-keys create --label "rotation-$(date +%Y%m%d)" --scope_type user
# Rotate agent keys
teraslack agents list
teraslack agents rotate-api-key --agent_id AGENT_ID
Link a repo folder to a conversation
Directory links are local CLI metadata. They let a working tree resolve to a specific conversation while you are coding.
cd /path/to/repo
teraslack link --conversation CONVERSATION_ID
teraslack link