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

@cli4ai/slack

v1.0.17

Published

Slack CLI tool for messages, channels, and users

Readme

@cli4ai/slack

Official @cli4ai package • https://cli4ai.com • Install cli4ai: npm i -g cli4ai

Full-featured Slack CLI. Uses channel/user names instead of IDs.

Setup

npm i -g cli4ai
cli4ai add -g slack
cli4ai secrets init slack

SLACK_BOT_TOKEN is required (xoxb-...). Create a Slack app, install it to your workspace, and grant the scopes listed below.

Commands

Channels

cli4ai run slack channels [limit]              # List channels (alias: ls)
cli4ai run slack info "#channel"               # Get channel info
cli4ai run slack unread                        # Channels with unread messages

Messages

cli4ai run slack history "#channel" [limit]    # Get messages (alias: read)
cli4ai run slack thread "#channel" <ts> [limit] # Get thread replies
cli4ai run slack post "#channel" "message"     # Post message (alias: msg, send)
cli4ai run slack postas "#ch" "msg" "Name" "icon"  # Post as custom user
cli4ai run slack reply "#ch" <ts> "msg"        # Reply to thread (use --broadcast)
cli4ai run slack edit "#channel" <ts> "text"   # Edit a message
cli4ai run slack delete "#channel" <ts>        # Delete a message

Reactions

cli4ai run slack react "#channel" <ts> emoji   # Add reaction
cli4ai run slack reactions "#channel" <ts>     # See who reacted to a message

Pins

cli4ai run slack pins "#channel"               # List pinned messages
cli4ai run slack pin "#channel" <ts>           # Pin a message
cli4ai run slack unpin "#channel" <ts>         # Unpin a message

Users

cli4ai run slack users [limit]                 # List users
cli4ai run slack user "@username"              # Get user info
cli4ai run slack dm "@username" "message"      # Send direct message
cli4ai run slack status [emoji] [text]         # Get/set status (use "clear" to clear)

Files

cli4ai run slack upload "#channel" ./file.pdf "comment"

Scheduling

cli4ai run slack schedule "#ch" "2025-12-14T09:00" "msg"  # Schedule message
cli4ai run slack scheduled [channel]                      # List scheduled
cli4ai run slack unschedule "#channel" <id>               # Delete scheduled

Monitoring

cli4ai run slack watch "#channel"              # Live watch for new messages
cli4ai run slack mentions                      # Find recent mentions of you

Output Flags

--raw, -r        # Full JSON output
--compact, -c    # One line per message
--broadcast, -b  # Broadcast thread reply to channel
--limit=N        # Override default limit
--interval=N     # Watch poll interval (seconds)

Name Resolution

Use #channel-name instead of channel IDs:

cli4ai run slack post "#claude" "Hello!"       # Instead of C093DN981RR

Use @username instead of user IDs:

cli4ai run slack dm "@adam" "Hey!"             # Instead of U02JCQC0SLB
cli4ai run slack user "@mail"                  # Lookup by name or email

Custom Bot Identity

Post messages with a custom username and avatar:

# Using emoji as icon
cli4ai run slack postas "#claude" "Breaking news!" "News Bot" "newspaper"

# Using URL as icon
cli4ai run slack postas "#claude" "Hello!" "Custom Bot" "https://example.com/avatar.png"

Slack mrkdwn Formatting

*bold*              _italic_           ~strikethrough~
`code`              ```code block```   > blockquote
<https://url|text>  <@U123>           :emoji:

Use \n for newlines:

cli4ai run slack post "#claude" "Line 1\nLine 2\n• Bullet"

Examples

# Read recent messages (compact view)
cli4ai run slack history "#claude" 10 --compact

# Post with formatting
cli4ai run slack post "#claude" "*Important*: Check <https://example.com|this link>"

# Post as a custom bot
cli4ai run slack postas "#claude" ":rotating_light: Alert!" "Alert Bot" "warning"

# Reply and broadcast to channel
cli4ai run slack reply "#claude" 1234567890.123 "On it!" --broadcast

# See who reacted to a message
cli4ai run slack reactions "#claude" 1234567890.123

# Pin an important message
cli4ai run slack pin "#claude" 1234567890.123

# Schedule a message
cli4ai run slack schedule "#general" "2025-12-25T09:00:00" ":christmas_tree: Merry Christmas!"

# Watch for new messages
cli4ai run slack watch "#claude"

# Upload a file
cli4ai run slack upload "#claude" ./report.pdf "Here's the report"

Project Structure

slack/
├── run.ts           # CLI entry point
└── lib/
    ├── api.ts       # Core API + name resolution
    ├── channels.ts  # Channel operations
    ├── messages.ts  # Messages, reactions, postAs
    ├── users.ts     # User operations
    ├── files.ts     # File uploads
    ├── pins.ts      # Pin operations
    ├── schedule.ts  # Scheduled messages
    └── watch.ts     # Watch + mentions

Required Bot Scopes

The bot needs these OAuth scopes:

  • channels:history, channels:read, channels:join, channels:manage
  • groups:history, groups:read
  • chat:write, chat:write.customize
  • reactions:read, reactions:write
  • pins:read, pins:write
  • files:read, files:write
  • users:read, users:read.email, users.profile:read
  • im:history, im:read, im:write
  • app_mentions:read
  • bookmarks:read, bookmarks:write