- Add full Telegram bot functionality with Z.AI API integration
- Implement 4 tools: Bash, FileEdit, WebSearch, Git
- Add 3 agents: Code Reviewer, Architect, DevOps Engineer
- Add 6 skills for common coding tasks
- Add systemd service file for 24/7 operation
- Add nginx configuration for HTTPS webhook
- Add comprehensive documentation
- Implement WebSocket server for real-time updates
- Add logging system with Winston
- Add environment validation
🤖 zCode CLI X - Agentic coder with Z.AI + Telegram integration
2.2 KiB
2.2 KiB
zCode CLI X - Quick Start Guide
⚡ 30-Second Setup
cd /home/uroma2/zcode-cli-x
npm install
node bin/zcode.js --bot
🔑 Get Your Telegram Bot Token
- Open @BotFather on Telegram
- Send
/newbot - Choose a name and username
- Copy the token
🆔 Get Your Telegram User ID
- Open @userinfobot on Telegram
- Send
/start - Copy your user ID
⚙️ Configure .env
Edit /home/uroma2/zcode-cli-x/.env:
ZAI_API_KEY=your_zai_api_key
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_ALLOWED_USERS=your_user_id
🚀 Run the Bot
# Option 1: Direct run
node bin/zcode.js --bot
# Option 2: Using startup script
./start.sh
# Option 3: As systemd service
sudo systemctl start zcode
sudo systemctl enable zcode
💬 Start Using
- Open Telegram
- Search for your bot
- Send
/start - Start chatting!
📚 Available Commands
/start- Start the bot/help- Show help/status- Check system status/agents- List available agents/skills- List available skills
🛠️ Tools
- Bash: Execute shell commands
- FileEdit: Edit files
- WebSearch: Search the web
- Git: Git operations
🧠 Agents
- Code Reviewer: Review code
- System Architect: Design systems
- DevOps Engineer: Deploy and manage
📝 Example Interactions
You: Create a simple Node.js API with Express
Bot: ✅ I'll create a Node.js API with Express...
You: Review this code
Bot: 📋 Code review complete...
You: Fix the bug in app.js
Bot: 🔧 Bug fixed in app.js...
🐛 Troubleshooting
Bot not responding
- Check logs:
tail -f /home/uroma2/zcode-cli-x/logs/zcode.log - Verify Telegram token in .env
- Check bot is enabled:
grep TELEGRAM_BOT_TOKEN .env
API errors
- Verify Z.AI API key is correct
- Check GLM_BASE_URL is set
- Test API connection:
curl https://api.z.ai/api/coding/paas/v4/models
Bot not reachable
- Set ZCODE_WEBHOOK_URL to your public URL
- Use ngrok for local development:
ngrok http 3000
📖 Next Steps
- Read full README.md
- Explore skills and agents
- Customize tools and configuration
- Integrate with your projects
Need help? Check logs: tail -f logs/zcode.log