# zCode CLI X - Quick Start Guide

## ⚡ 30-Second Setup

```bash
cd /home/uroma2/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 `/home/uroma2/zcode-cli-x/.env`:

```env
ZAI_API_KEY=your_zai_api_key
TELEGRAM_BOT_TOKEN=your_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 /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

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`
