npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@asafrose/agent-slack

v0.3.4

Published

Slack CLI tool for AI agents - replaces MCP Slack tools with a token-efficient CLI

Downloads

418

Readme

agent-slack

A Bun CLI + Claude Code plugin that replaces the 12 Slack MCP server tools with a single, token-efficient CLI. Instead of spending ~18K tokens per session on MCP tool descriptions, Claude loads a lightweight skill file and calls agent-slack via Bash.

Prerequisites

  • Bun v1.0+
  • A Slack workspace you can authorize against

Authentication

agent-slack login

This opens your browser for Slack OAuth authorization. Click "Allow" and the token is saved to ~/.agent-slack/config.json.

agent-slack read-user-profile   # verify it works
agent-slack logout               # remove stored token

Installation

Homebrew (recommended)

brew tap asafrose/agent-slack
brew install agent-slack

From Source

git clone https://github.com/Asafrose/agent-slack.git
cd agent-slack
bun install
bun link

Usage

agent-slack <command> [flags]
agent-slack --help
agent-slack <command> --help

Commands

| Command | Description | Replaces MCP Tool | | ------------------- | ------------------------------------- | --------------------------------- | | send-message | Send a message to a channel | slack_send_message | | schedule-message | Schedule a message for later | slack_schedule_message | | draft-message | Create a draft message | slack_send_message_draft | | search-channels | Find channels by name/purpose | slack_search_channels | | read-channel | Read channel message history | slack_read_channel | | search-messages | Search public channel messages | slack_search_public | | read-thread | Read a thread's messages | slack_read_thread | | search-users | Find users by name/email/title | slack_search_users | | read-user-profile | Get a user's profile | slack_read_user_profile | | search-all | Search all channels incl. private/DMs | slack_search_public_and_private | | create-canvas | Create a Canvas document | slack_create_canvas | | read-canvas | Read a Canvas document | slack_read_canvas | | login | Authenticate with Slack via OAuth | — | | logout | Remove stored Slack token | — |

Output Formats

Every command supports three output modes:

agent-slack read-channel --channel C12345              # concise (default, token-efficient)
agent-slack read-channel --channel C12345 --detailed   # verbose with all fields
agent-slack read-channel --channel C12345 --json       # raw JSON, pipe to jq

Message Content Input

Commands that accept text (send-message, schedule-message, draft-message, create-canvas) support three input methods:

# Inline
agent-slack send-message --channel C12345 --text "Hello world"

# From file (recommended for complex content)
agent-slack send-message --channel C12345 --text-file /tmp/message.md

# From stdin
echo "Hello world" | agent-slack send-message --channel C12345

For create-canvas, use --content / --content-file instead of --text / --text-file.

Examples

# Send a message
agent-slack send-message --channel C12345 --text "Deploy complete"

# Search for a channel, get its ID
agent-slack search-channels --query "engineering" --json | jq -r '.channels[0].id'

# Read last 20 messages from a channel
agent-slack read-channel --channel C12345 --limit 20

# Search messages with Slack search syntax
agent-slack search-messages --query "from:<@U12345> in:engineering bug after:2024-01-01"

# Read a thread
agent-slack read-thread --channel C12345 --ts 1234567890.123456

# Schedule a message
agent-slack schedule-message --channel C12345 --text "Reminder" --post-at "2025-03-01T09:00:00Z"

# Look up a user
agent-slack read-user-profile --user U12345

Using as a Claude Code Plugin

This project is a Claude Code plugin. It includes a skill (skills/slack/SKILL.md) that teaches Claude how to use the CLI for all Slack operations.

Setup

Install the plugin from within Claude Code using the /plugin command:

  1. Add the marketplace (one-time):

    /plugin marketplace add Asafrose/agent-slack
  2. Install the plugin:

    /plugin install agent-slack@agent-slack

You can choose to install at user scope (default, applies to all projects) or project scope (applies to the current repository only).

For local development or testing, you can also load the plugin directly from a local directory:

claude --plugin-dir /path/to/agent-slack

Once loaded, Claude will automatically use agent-slack via Bash whenever Slack tasks arise — no MCP server needed.

How It Works

  • The skill file (skills/slack/SKILL.md) contains complete documentation of all 12 commands, flags, search syntax, output formats, and error codes
  • It declares allowed-tools: Bash(agent-slack *) so Claude can run the CLI without per-command approval
  • It's marked user-invocable: false — Claude auto-activates it when Slack tasks are detected
  • The plugin manifest (.claude-plugin/plugin.json) registers the plugin with Claude Code

Token Savings

The 12 MCP Slack tools consume ~18K tokens per session from their tool descriptions alone. This plugin replaces all of them with a single skill file that Claude loads on demand, dramatically reducing per-session token overhead.

Development

Running Tests

bun test              # all tests (unit + integration)
bun test tests/unit   # unit tests only
bun test tests/integration  # integration tests only

Project Structure

agent-slack/
├── .claude-plugin/plugin.json      # Claude Code plugin manifest
├── skills/slack/SKILL.md           # Skill: teaches Claude to use the CLI
├── bin/agent-slack.ts              # CLI entry point
├── src/
│   ├── cli.ts                      # Commander program, registers subcommands
│   ├── client.ts                   # Slack WebClient factory (auth via config)
│   ├── config.ts                   # Loads/saves ~/.agent-slack/config.json
│   ├── constants.ts                # OAuth config (client ID, worker URL, scopes)
│   ├── output.ts                   # Concise / detailed / JSON formatters
│   ├── errors.ts                   # Slack API error handling
│   ├── input.ts                    # Text input resolution (inline/file/stdin)
│   ├── formatters/messages.ts      # Shared message formatting
│   └── commands/                   # 14 subcommand implementations (incl. login/logout)
├── worker/                         # Cloudflare Worker (OAuth token exchange proxy)
│   ├── src/index.ts                # Worker entry point
│   ├── wrangler.toml               # Worker config
│   └── package.json
├── tests/
│   ├── unit/                       # Mocked unit tests per module
│   ├── integration/cli.test.ts     # End-to-end CLI invocation tests
│   └── helpers/mock-slack.ts       # Shared Slack API mock factory
├── package.json
└── tsconfig.json

License

MIT