Telegram Setup
Create a Telegram Bot
- Open Telegram and search for @BotFather
- Send
/newbot - Choose a name:
NIKI Server(or any name) - Choose a username:
niki_yourname_bot(must end inbot) - Copy the bot token - looks like
123456789:ABCdefGHI...
Get Your Chat ID
Your chat ID identifies where to send notifications.
Method 1: Use NIKI (easiest)
niki config init# Follow the prompts - it will help you get your chat IDMethod 2: Manual
- Message your bot on Telegram (send
/start) - Run this command (replace
YOUR_TOKEN):
curl -s "https://api.telegram.org/botYOUR_TOKEN/getUpdates" | python -c "import sys, jsondata = json.load(sys.stdin)for r in data.get('result', []): chat = r.get('message', {}).get('chat', {}) if chat: print(f'Chat ID: {chat.get(\"id\")}')"Configure NIKI
Add to ~/.niki/config.toml:
[notifications.telegram]enabled = truebot_token = "123456789:ABCdefGHI..."allowed_user_ids = [YOUR_CHAT_ID]Test It
niki daemon restartniki watch -- echo "Hello from NIKI"You should receive a notification!
Telegram Commands
Once configured, you can interact with NIKI via Telegram:
| Command | Description |
|---|---|
status | Show running tasks |
tasks | List recent tasks |
history | Query task history |
run <description> | Run a command |
rerun | Rerun last task |
ask <question> | Ask about tasks |
Security
NIKI uses multiple security layers:
- Whitelist: Only your chat ID can interact
- Rate limiting: Max 5 commands/minute
- Blocklist: Dangerous commands blocked
- Confirmation: Commands require Y/N before execution
See Security Documentation for details.