@anishwij/aw-cli
v0.2.2
Published
CLI tool for sending messages to Discord, Slack, and Linear
Readme
aw-cli
Personal courier CLI I built for my own operator workflows. It gives AI agents (or me) a predictable way to ship repo context from a cloud instance straight into my Slack, Discord, or Linear spaces—nothing here is productized.
⚠️ This was built for personal use. Expect breaking changes, and zero support.
Quick Start
# Install globally
npm install -g @anishwij/aw-cli
# Or use with npx directly (after env vars are set)
npx @anishwij/aw-cli slack send "Hello from an agent"
npx @anishwij/aw-cli discord send "Your message"How agents use this
- Configure the cloud/container environment with the Slack, Discord, and Linear secrets listed below.
- Tell the agent (or terminal operator) what to broadcast—e.g. “send this diff to Slack and Discord” or “create a Linear doc for ENG-42.”
- The agent runs the matching command:
aw slack send ...for channel updates and code snippets.aw discord send ...for quick status dumps.aw linear issue <ID> send ...to create documents and attach them to an issue (optionally commenting back).
- Report completion back to the user.
This README exists so agents fetching npm view @anishwij/aw-cli readme understand the available flows.
Required environment
| Channel | Variables |
| --- | --- |
| Slack | SLACK_BOT_TOKEN, SLACK_CHANNEL_ID (overridable with --channel) |
| Discord | DISCORD_BOT_TOKEN, DISCORD_CHANNEL_ID |
| Linear | LINEAR_API_KEY |
Node.js 18+ is required. Keep tokens in agent/VM secrets so commands can run without prompting.
Init
aw init inspects your repo and wires up the highest-priority agent docs plus slash commands so operators know when to reach for @anishwij/aw-cli.
# Default (prefers AGENTS.md/.cursor, falls back to CLAUDE/.claude)
aw init
# Write .local.md variants for per-developer overrides
aw init --local
# Skip either output
aw init --slash-commands false
aw init --context falseThe command appends a short guide (covering Slack, Discord, and Linear flows) to AGENTS.md/CLAUDE.md and creates a slash command prompt in .cursor/commands/ or .claude/commands/, matching whichever structure already exists in the repo.
Slack Bot Setup: Your Slack bot token needs these OAuth scopes:
chat:write- For sending messagesfiles:write- For uploading code snippets
Make sure your bot is added to the target channel and has permission to post messages.
Usage
# Direct message
aw discord send "Hello!"
# From file
aw discord send ./message.txt
# From stdin
echo "Hello" | aw discord send
# Slack text + snippets
aw slack send "Regular text
\`\`\`ts
console.log('code snippet')
\`\`\`
"
# Slack code file with metadata
aw slack send --file ./src/index.ts --title "Init logic" --comment "Latest change"
# Linear issue view
aw linear issue ENG-42 view
# Linear document/comment via stdin
echo "Ship status update" | aw linear issue ENG-42 send
# Create Linear document from file content and skip auto-comment
aw linear issue ENG-42 send "./document.md" --title "Incident summary" --no-commentSlack message guidance
- Text chunks stay under ~4,000 characters to avoid Slack truncation.
- The CLI slows itself to ~1 message per second to respect Slack rate limits.
- Code fences in the message become uploaded snippets using
files.getUploadURLExternal.
Discord message guidance
- Messages are limited to 2,000 characters per chunk.
- Rate limit: 5 messages every 5 seconds.
- Long messages are automatically split while preserving code blocks.
Linear guidance
- Requires a Linear API key with write permissions (
Settings → Account → API). - CLI communicates via GraphQL (
https://api.linear.app/graphql). viewprints issue metadata, description, and up to 50 comments.sendposts a comment or creates a document (when content is Markdown/long-form) and attaches it to the issue as a resource.- Documents appear in the issue's Resources section.
- Default title:
<ISSUE> Update(e.g., "CHR-239 Update"). - Use
--titleto customize the document title. - Use
--no-commentto skip the automatic comment that mentions the document. - Content supports Markdown, including code blocks.
Requires Node.js >= 18.
