CLI Tool¶
The Notifer CLI provides a simple command-line interface for publishing and subscribing to topics.
Installation¶
Install via pip:
Or install from source:
Verify installation:
Quick Start¶
Publish a Message¶
Subscribe to a Topic¶
Configuration¶
Initialize Config File¶
Create a config file at ~/.notifer.yaml:
View Configuration¶
Set Configuration Values¶
# Set server URL
notifer config set server https://app.notifer.io
# Set API key
notifer config set api-key noti_your_key_here
Get Configuration Value¶
Publishing Messages¶
Basic Publishing¶
With Title¶
With Priority¶
With Tags¶
Combined Options¶
notifer publish deployments "Build #123 completed" \
--title "Build Success" \
--priority 3 \
--tags "ci,build,success"
Using API Key¶
Custom Server¶
Subscribing to Topics¶
Basic Subscription¶
Output:
๐ Subscribed to: my-topic
Listening for messages... (Press Ctrl+C to stop)
[2025-11-02 10:30:00] Hello from CLI!
Priority: 3 | Tags: []
[2025-11-02 10:31:15] ๐ข Deploy Success
Deployment completed successfully
Priority: 3 | Tags: [ci, deploy]
Subscribe to Multiple Topics¶
Save to File¶
Output format (JSON Lines):
{"id":"msg_abc123","topic":"my-topic","message":"Hello","timestamp":"2025-11-02T10:30:00Z"}
{"id":"msg_def456","topic":"my-topic","message":"World","timestamp":"2025-11-02T10:31:00Z"}
Raw JSON Output¶
Useful for piping to other tools:
Messages Since Timestamp¶
Authentication¶
Login¶
You'll be prompted for your password (hidden input).
Login with Email Prompt¶
Logout¶
API Key Management¶
List API Keys¶
Output:
โโโโโโโโโโโโโโณโโโโโโโโโโโโโณโโโโโโโโโณโโโโโโโโโโโณโโโโโโโโโณโโโโโโโโโโโโโโโโโโโ
โ Name โ Prefix โ Scopes โ Requests โ Status โ Created โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ ci-deploy โ noti_abc โ * โ 1234 โ active โ 2025-11-01 10:00 โ
โ monitoring โ noti_def โ * โ 567 โ active โ 2025-11-02 15:30 โ
โโโโโโโโโโโโโโดโโโโโโโโโโโโโดโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโดโโโโโโโโโโโโโโโโโโโ
Create API Key¶
Options:
--description- Key description--scopes- Comma-separated scopes (default:*for all)--expires- Expiration date (ISO 8601 format)
The key will be displayed once - save it securely!
You'll be prompted to save it to your config file.
Revoke API Key¶
Revoked keys can be re-enabled.
Delete API Key¶
Permanently deletes the key (cannot be undone).
Topic Management¶
List Topics¶
# List all public topics
notifer topics list
# List only your topics
notifer topics list --mine
# Limit results
notifer topics list --limit 10
Get Topic Details¶
Create Topic¶
# Public topic
notifer topics create my-new-topic \
--description "My new topic"
# Private topic
notifer topics create private-topic \
--description "Private notifications" \
--private
# Hidden from discovery
notifer topics create hidden-topic \
--description "Not listed in browse" \
--no-discover
Delete Topic¶
You'll be prompted for confirmation.
Configuration File Format¶
The config file (~/.notifer.yaml) stores your settings:
server: https://app.notifer.io
api_key: noti_your_key_here
email: user@example.com
access_token: eyJhbGc...
refresh_token: eyJhbGc...
defaults:
priority: 3
tags: []
Environment Variables¶
Override config with environment variables:
export NOTIFER_SERVER=https://app.notifer.io
export NOTIFER_API_KEY=noti_your_key_here
notifer publish my-topic "Message"
Shell Integration¶
Bash Alias¶
Add to ~/.bashrc:
Usage:
Command Success/Failure¶
# Notify on command completion
long-running-command && notify "Success!" || notify "Failed!" --priority 5
Background Job Notification¶
# Start job in background
long-running-command &
JOB_PID=$!
# Notify when complete
wait $JOB_PID
notifer publish jobs "Job $JOB_PID completed" --tags "background,complete"
CI/CD Integration¶
GitHub Actions¶
name: Deploy
on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Install Notifer CLI
run: pip install notifer-cli
- name: Deploy
run: ./deploy.sh
- name: Notify Success
if: success()
run: |
notifer publish deployments "Deploy succeeded" \
--title "Deploy Success" \
--tags "ci,deploy,success" \
--api-key ${{ secrets.NOTIFER_API_KEY }}
- name: Notify Failure
if: failure()
run: |
notifer publish deployments "Deploy failed!" \
--title "Deploy Failed" \
--priority 5 \
--tags "ci,deploy,error" \
--api-key ${{ secrets.NOTIFER_API_KEY }}
GitLab CI¶
deploy:
script:
- pip install notifer-cli
- ./deploy.sh
after_script:
- |
if [ $CI_JOB_STATUS == "success" ]; then
notifer publish deployments "Deploy succeeded" \
--api-key $NOTIFER_API_KEY
else
notifer publish deployments "Deploy failed!" \
--priority 5 \
--api-key $NOTIFER_API_KEY
fi
Troubleshooting¶
Connection Issues¶
# Test server connectivity
curl https://app.notifer.io/health
# Use custom server
notifer publish my-topic "Test" --server http://localhost:8080
Authentication Issues¶
# Check current config
notifer config show
# Re-login
notifer logout
notifer login
# Or set API key
notifer config set api-key noti_your_new_key
Debug Mode¶
Next Steps¶
- HTTP Publishing - Direct cURL examples
- Python SDK - Publish from Python code
- API Keys - Learn about API authentication
- Subscribe via SSE - Technical details on subscriptions