Always-On Agent in 5 Minutes
Get an always-on AI agent responding on a messaging platform with file access, shell commands, and web search. Total time: about 5 minutes.
1. Install
Section titled “1. Install”curl -fsSL https://raw.githubusercontent.com/auser/agentzero/main/scripts/install.sh | bash2. Get a Telegram bot token
Section titled “2. Get a Telegram bot token”Open Telegram, message @BotFather, send /newbot, follow the prompts. Copy the bot token it gives you.
3. Set your API key
Section titled “3. Set your API key”OpenRouter gives you access to all models with one key:
export OPENAI_API_KEY="sk-or-v1-..."Or save it permanently:
echo 'OPENAI_API_KEY=sk-or-v1-...' >> ~/.agentzero/.env4. Create the config
Section titled “4. Create the config”Save this as agentzero.toml in your working directory:
[provider]kind = "openrouter"model = "anthropic/claude-sonnet-4-6"
[security]allowed_root = "."allowed_commands = ["ls", "pwd", "cat", "echo", "grep", "find", "git", "cargo", "python3", "node"]enable_git = true
[security.write_file]enabled = true
[web_search]enabled = trueprovider = "duckduckgo"
[channels.telegram]bot_token = "YOUR_TELEGRAM_BOT_TOKEN"
[gateway]port = 42617Replace YOUR_TELEGRAM_BOT_TOKEN with the token from step 2.
5. Start the agent
Section titled “5. Start the agent”agentzero daemon startCheck it’s running:
agentzero daemon status6. Message your bot
Section titled “6. Message your bot”Open Telegram, find your bot, send a message. The agent will respond with full tool access — it can read files, run commands, search the web, and write files in your working directory.
Use Discord or Slack instead
Section titled “Use Discord or Slack instead”Replace the [channels.telegram] block with one of these:
Discord
Section titled “Discord”[channels.discord]bot_token = "YOUR_DISCORD_BOT_TOKEN"Create a bot at the Discord Developer Portal, enable the Message Content intent, and invite it to your server.
[channels.slack]bot_token = "xoxb-YOUR-SLACK-BOT-TOKEN"app_token = "xapp-YOUR-SLACK-APP-TOKEN"Create a Slack app at api.slack.com/apps with Socket Mode enabled.
Use a local model (no API key)
Section titled “Use a local model (no API key)”Swap the provider section and drop the API key:
[provider]kind = "ollama"model = "llama3.1:8b"Make sure Ollama is running locally first (ollama serve).
Enable more tools
Section titled “Enable more tools”Add any of these to your agentzero.toml:
# Browser automation[browser]enabled = true
# MCP servers (define servers in ~/.agentzero/mcp.json)[security.mcp]enabled = true
# HTTP requests[http_request]enabled = trueNext steps
Section titled “Next steps”- Run as a system service that survives reboots:
agentzero service install && agentzero service start - Add delegate agents for specialized tasks
- Set up scheduled tasks with
agentzero cron add - See the full Configuration Reference for all options