- start.sh: use dirname instead of hardcoded path - src/zcode.js: remove hardcoded chat_id fallback - src/utils/rtk.js: use 'rtk' from PATH instead of hardcoded binary path - src/telegram-bot.ts: use process.cwd() instead of hardcoded path - TELEGRAM_SETUP.md: replace token/chat_id with placeholders - QUICKSTART.md: sanitize all references - SERVICE_MAP.md: use relative paths instead of absolute
115 lines
2.2 KiB
Markdown
115 lines
2.2 KiB
Markdown
# zCode CLI X - Quick Start Guide
|
|
|
|
## ⚡ 30-Second Setup
|
|
|
|
```bash
|
|
cd zcode-cli-x
|
|
npm install
|
|
node bin/zcode.js --bot
|
|
```
|
|
|
|
## 🔑 Get Your Telegram Bot Token
|
|
|
|
1. Open [@BotFather](https://t.me/botfather) on Telegram
|
|
2. Send `/newbot`
|
|
3. Choose a name and username
|
|
4. Copy the token
|
|
|
|
## 🆔 Get Your Telegram User ID
|
|
|
|
1. Open [@userinfobot](https://t.me/userinfobot) on Telegram
|
|
2. Send `/start`
|
|
3. Copy your user ID
|
|
|
|
## ⚙️ Configure .env
|
|
|
|
Edit `.env` in the project root:
|
|
|
|
```env
|
|
ZAI_API_KEY=***
|
|
TELEGRAM_BOT_TOKEN=***
|
|
TELEGRAM_ALLOWED_USERS=your_user_id
|
|
```
|
|
|
|
## 🚀 Run the Bot
|
|
|
|
```bash
|
|
# 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
|
|
|
|
1. Open Telegram
|
|
2. Search for your bot
|
|
3. Send `/start`
|
|
4. 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 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
|
|
|
|
1. Read full [README.md](README.md)
|
|
2. Explore skills and agents
|
|
3. Customize tools and configuration
|
|
4. Integrate with your projects
|
|
|
|
---
|
|
|
|
Need help? Check logs: `tail -f logs/zcode.log`
|