open-index/open-npm huggingface dataset:
npm package: @quochuydev/ccx
Description: Claude Code bridge server with HTTP API, Telegram, and Discord integrations
Latest version: 1.0.1

# ccx

Claude Code bridge server with HTTP API, Telegram, and Discord integrations.

## Quick Start

```bash
# Run directly
npx @quochuydev/ccx

# Or install globally
npm i -g @quochuydev/ccx
ccx
```

### From source

```bash
npm run setup
# Edit .env
claude auth login
npm start
```

## Environment Variables

| Variable             | Required | Description                                          |
| -------------------- | -------- | ---------------------------------------------------- |
| `PROJECT_DIR`        | No       | Project directory for Claude (default: `.`)          |
| `PORT`               | No       | Server port (default: `3111`)                        |
| `TELEGRAM_BOT_TOKEN` | No       | Telegram bot token from @BotFather                   |
| `TELEGRAM_CHAT_ID`   | No       | Telegram chat ID for broadcast notifications         |
| `DISCORD_BOT_TOKEN`  | No       | Discord bot token (not yet implemented)              |
| `DISCORD_CHAT_ID`    | No       | Discord channel ID for broadcast notifications       |
| `CRON_TARGETS`       | No       | Comma-separated folder paths to scan for suggestions |
| `CRON_INTERVAL`      | No       | Cron interval in minutes (default: `5`)              |

## API

### Chat

```bash
# Non-streaming
curl -X POST http://localhost:3111/chat \
  -H "Content-Type: application/json" \
  -d '{"prompt": "what files are in this project?"}'

# Streaming (SSE)
curl -X POST http://localhost:3111/chat/stream \
  -H "Content-Type: application/json" \
  -d '{"prompt": "what files are in this project?"}'

# Session (maintains conversation)
curl -X POST http://localhost:3111/chat/session \
  -H "Content-Type: application/json" \
  -d '{"prompt": "what files are in this project?", "channel": "my-channel"}'
```

### Prompts

```bash
# Get all saved prompts
curl http://localhost:3111/prompts

# Generate a new suggestion (broadcasts to chat services)
curl -X POST http://localhost:3111/prompts/generate \
  -H "Content-Type: application/json" \
  -d '{"folder": "/path/to/project"}'
```

### Other

```bash
# Health check
curl http://localhost:3111/health

# List active sessions
curl http://localhost:3111/sessions
```

## Telegram Bot Commands

| Command     | Description                                            |
| ----------- | ------------------------------------------------------ |
| `/start`    | Show welcome message                                   |
| `/chatid`   | Show current chat ID (use this for `TELEGRAM_CHAT_ID`) |
| Any message | Send to Claude and get a response                      |