@mkusaka/slack-notify-cli
v0.0.1
Published
Send notifications to Slack from the command line
Maintainers
Readme
@mkusaka/slack-notify-cli
A simple command-line tool to send notifications to Slack.
Installation
npm install -g @mkusaka/slack-notify-cli
# or
pnpm install -g @mkusaka/slack-notify-cli
# or
yarn global add @mkusaka/slack-notify-cliOr install locally from source:
git clone https://github.com/mkusaka/slack-notify-cli.git
cd slack-notify-cli
pnpm install
pnpm build
pnpm linkConfiguration
Set up your Slack bot token:
export SLACK_BOT_TOKEN=xoxb-your-token-hereOptional environment variables:
export SLACK_DEFAULT_CHANNEL=#general
export SLACK_MENTIONS=U1234567890,U0987654321Usage
# Send a simple message
slack-notify "Hello from the command line!"
# Send to a specific channel
slack-notify "Important update" -c #announcements
# Send with a title
slack-notify "Deployment completed successfully" -t "Deployment Status"
# Mention specific users
slack-notify "Please review this PR" -m U1234567890,U0987654321
# Override token (not recommended, use env var instead)
slack-notify "Test message" --token xoxb-different-tokenDevelopment
# Install dependencies
pnpm install
# Run in development mode
pnpm dev "Test message"
# Build the project
pnpm build
# Type check
pnpm typecheck
# Lint
pnpm lint
# Format code
pnpm formatRequirements
- Node.js 18+
- A Slack bot token with
chat:writescope - The bot must be invited to channels where you want to send messages
