# 0G Vibekit

> AI-powered tools for the 0G ecosystem. Works with Claude Code, Cursor, Windsurf.

**Two integration modes:**
1. **MCP Mode** - Claude/Cursor uses 0G tools (storage, compute, chain)
2. **API Mode** - Use 0G Compute as your AI backend (like Ollama)

## Quick Start

### MCP Mode (Recommended)

Add to Claude Code:
```bash
claude mcp add 0g-vibe -- npx 0g-vibekit
```

Add to Cursor (`.cursor/mcp.json`):
```json
{
  "mcpServers": {
    "0g-vibe": {
      "command": "npx",
      "args": ["0g-vibekit"]
    }
  }
}
```

### API Mode (Replace Claude with 0G)

```bash
# Start the API server
npx 0g-vibekit --api

# Configure Claude Code to use 0G
export ANTHROPIC_BASE_URL=http://localhost:3033
claude --model 0g:deepseek-coder
```

## Features

### 41 Tools Available

| Category | Tools | Description |
|----------|-------|-------------|
| **Compute** | 7 | AI inference on 0G's decentralized network |
| **Storage** | 6 | Upload/download files to 0G Storage |
| **Chain** | 6 | Interact with 0G Chain (balance, deploy, faucet) |
| **Launchpad** | 10 | Launch and trade tokens on Vibecoin |
| **Docs** | 12 | Search 0G documentation and examples |

### Example Commands

```
# In Claude Code with MCP:
"Upload my-file.txt to 0G Storage"
"Launch a token called MoonCat with symbol MCAT"
"Check my 0G wallet balance"
"List AI models available on 0G Compute"
"Run inference using DeepSeek on 0G"
```

### API Mode Models

| Model | Description |
|-------|-------------|
| `0g:llama-3.1-8b` | Fast, cheap - general tasks |
| `0g:llama-3.1-70b` | Powerful - complex reasoning |
| `0g:deepseek-coder` | Coding specialist |
| `0g:mistral-7b` | Balanced performance |
| `0g:qwen-72b` | Multilingual |

## Configuration

Set environment variables for full functionality:

```bash
# Required for compute/storage/chain operations
export OG_PRIVATE_KEY=your_private_key

# Optional
export OG_NETWORK=testnet          # or mainnet
export OG_LAUNCHPAD_URL=https://vibecoin-cards.vercel.app
```

## Tool Reference

### Compute Tools
- `0g_compute_list_services` - List AI services on 0G
- `0g_chat` - Chat with AI models
- `0g_code` - Code completion/review/refactor
- `0g_compute_balance` - Check compute balance
- `0g_compute_deposit` - Add funds for inference
- `0g_compute_estimate` - Estimate costs
- `0g_models` - List available models

### Storage Tools
- `0g_storage_upload` - Upload file to 0G
- `0g_storage_download` - Download by root hash
- `0g_storage_info` - Get file metadata
- `0g_storage_nodes` - List storage nodes
- `0g_kv_set` - Set key-value pairs
- `0g_kv_get` - Get values

### Chain Tools
- `0g_chain_balance` - Check wallet balance
- `0g_chain_tx` - Get transaction details
- `0g_chain_deploy` - Deploy smart contracts
- `0g_chain_faucet` - Get testnet tokens
- `0g_chain_call` - Call contract methods
- `0g_chain_send` - Send transactions

### Launchpad Tools
- `vibecoin_launch` - Create new token
- `vibecoin_status` - Check token status
- `vibecoin_trending` - Get trending tokens
- `vibecoin_trade` - Buy/sell tokens
- `vibecoin_dashboard` - TUI dashboard
- `vibecoin_watch` - Price watch
- `vibecoin_open` - Open in browser

### Docs Tools
- `0g_docs` - Search documentation
- `0g_sdk_help` - SDK usage help
- `0g_examples` - Code examples

## Architecture

```
┌─────────────────────────────────────────────────────────────┐
│                      0G VIBEKIT                              │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│   MCP MODE (default)           API MODE (--api)             │
│   ┌─────────────────┐          ┌─────────────────┐         │
│   │ Claude/Cursor   │          │ 0G replaces     │         │
│   │ uses 0G tools   │          │ Claude entirely │         │
│   │                 │          │                 │         │
│   │ 41 tools        │          │ Anthropic API   │         │
│   └─────────────────┘          └─────────────────┘         │
│                                                              │
├─────────────────────────────────────────────────────────────┤
│                    0G INFRASTRUCTURE                         │
│                                                              │
│   0G Compute         0G Storage         0G Chain            │
│   (AI Inference)     (Files/KV)         (EVM)               │
└─────────────────────────────────────────────────────────────┘
```

## Development

```bash
# Clone and install
git clone https://github.com/0glabs/0g-vibekit
cd 0g-vibekit
npm install

# Development
npm run dev

# Build
npm run build

# Test MCP mode
node dist/index.js --help
```

## Links

- [0G Documentation](https://docs.0g.ai)
- [Vibecoin Launchpad](https://vibecoin-cards.vercel.app)
- [0G Discord](https://discord.gg/0glabs)

## License

MIT
