🚀 Getting Started with ChaozCode

Your complete guide to setting up ChaozCode and building your first AI-powered project. Follow these steps to unlock the full potential of intelligent development.

⏱️ 15-20 minutes to complete
1 Account
2 Install
3 Configure
4 Connect
5 Build

📋 Prerequisites

Before you begin, ensure you have the following requirements met:

💻 System Requirements

  • OS: Windows 10+, macOS 10.15+, or Linux (Ubuntu 18.04+)
  • RAM: 8GB minimum (16GB recommended)
  • Disk: 2GB free space
  • Network: Stable internet connection

🔧 Development Tools

  • Node.js: v18.0+ or v20.0+ (LTS recommended)
  • Python: 3.9+ (for SDK)
  • Git: 2.30+ for version control
  • Editor: VS Code recommended
💡 New to development? We recommend starting with the VS Code editor and installing Node.js from nodejs.org before continuing.

1️⃣ Create Your Account

Sign Up Process

  1. Navigate to chaozcode.com/auth/signup
  2. Enter your email address and create a secure password
  3. Complete email verification by clicking the link sent to your inbox
  4. Fill out your profile information (optional but recommended)

Choose Your Plan

PlanFeaturesBest For
Free100 API calls/day, 1 project, basic featuresExploration & learning
Pro10,000 API calls/day, unlimited projects, Memory SpineIndividual developers
Team100,000 API calls/day, team collaboration, priority supportDevelopment teams
EnterpriseUnlimited, dedicated infrastructure, SLAOrganizations

Get Your API Key

  1. Log in to your dashboard at chaozcode.com/app/dashboard
  2. Navigate to Settings → API Keys
  3. Click "Generate New Key"
  4. Name your key (e.g., "development-key")
  5. Copy and securely store your key - it won't be shown again!
⚠️ Keep Your API Key Secure Never commit your API key to version control or share it publicly. Use environment variables or a secrets manager.

2️⃣ Install ChaozCode Tools

CLI Installation

Install the ChaozCode CLI globally using npm:

# Install globally
npm install -g @chaozcode/cli

# Verify installation
chaozcode --version
# Output: ChaozCode CLI v2.4.0

# View available commands
chaozcode --help

SDK Installation

JavaScript/TypeScript

# Using npm
npm install @chaozcode/sdk

# Using yarn
yarn add @chaozcode/sdk

# Using pnpm
pnpm add @chaozcode/sdk

Python

# Using pip
pip install chaozcode

# Using poetry
poetry add chaozcode

# Verify installation
python -c "import chaozcode; print(chaozcode.__version__)"

VS Code Extension

  1. Open VS Code
  2. Press Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (Mac)
  3. Search for "ChaozCode"
  4. Click Install on "ChaozCode AI Assistant"
  5. Reload VS Code when prompted
✅ Installation Complete You now have the CLI, SDK, and VS Code extension ready to use.

3️⃣ Configure Your Environment

CLI Authentication

# Authenticate with your API key
chaozcode auth login

# Or set directly via environment variable
export CHAOZCODE_API_KEY="your-api-key-here"

# Verify authentication
chaozcode auth status
# Output: ✓ Authenticated as: your@email.com

Project Configuration

Create a chaozcode.config.js file in your project root:

// chaozcode.config.js
module.exports = {
  // Project identification
  projectId: "my-awesome-project",
  
  // Memory Spine settings
  memory: {
    enabled: true,
    autoSync: true,
    maxContextTokens: 4000
  },
  
  // AI model preferences
  model: {
    default: "gpt-4",
    fallback: "claude-3-sonnet",
    temperature: 0.7
  },
  
  // Code analysis
  codebase: {
    include: ["src/**/*.ts", "src/**/*.tsx"],
    exclude: ["node_modules", "dist", "*.test.*"],
    maxFileSize: 100000 // bytes
  },
  
  // Agent configuration
  agents: {
    defaultTimeout: 30000,
    maxConcurrent: 3
  }
};

Environment Variables

Create a .env file (add to .gitignore):

# .env
CHAOZCODE_API_KEY=your-api-key-here
CHAOZCODE_PROJECT_ID=my-awesome-project
CHAOZCODE_ENVIRONMENT=development
CHAOZCODE_LOG_LEVEL=info

# Optional: Memory Spine custom endpoint
# CHAOZCODE_MEMORY_ENDPOINT=https://custom.endpoint.com

# Optional: Model overrides
# CHAOZCODE_DEFAULT_MODEL=gpt-4-turbo

VS Code Settings

Configure the extension in VS Code settings (Ctrl+,):

{
  "chaozcode.enabled": true,
  "chaozcode.autoComplete": true,
  "chaozcode.inlineHints": true,
  "chaozcode.memorySpine.enabled": true,
  "chaozcode.codeReview.autoTrigger": true,
  "chaozcode.model": "gpt-4",
  "chaozcode.telemetry": false
}

4️⃣ Connect to Services

Verify Connection

# Test API connection
chaozcode ping
# Output: ✓ Connected to ChaozCode API (latency: 45ms)

# Check service status
chaozcode status
# Output:
# ✓ API: healthy
# ✓ Memory Spine: healthy (5,234 vectors)
# ✓ Zearch: healthy
# ✓ Authentication: valid

Initialize Memory Spine

# Initialize Memory Spine for your project
chaozcode memory init

# Check memory stats
chaozcode memory stats
# Output:
# Vectors: 0
# Storage: 0 MB
# Last sync: Never

# Store your first memory
chaozcode memory store --id "project-init" --content "Project initialized with ChaozCode" --tags "setup"

Connect GitHub (Optional)

# Link your GitHub account for enhanced features
chaozcode integrations connect github

# This enables:
# - PR code reviews
# - Issue analysis
# - Commit context
# - Repository insights

Test the SDK

JavaScript

// test-connection.js
const { ChaozCode } = require('@chaozcode/sdk');

const client = new ChaozCode({
  apiKey: process.env.CHAOZCODE_API_KEY
});

async function testConnection() {
  // Test basic query
  const response = await client.query({
    prompt: "What is 2 + 2?",
    model: "gpt-4"
  });
  console.log("Response:", response.text);
  
  // Test Memory Spine
  const stats = await client.memory.stats();
  console.log("Memory vectors:", stats.vectorCount);
  
  // Test code analysis
  const analysis = await client.codebase.analyze({
    path: "./src"
  });
  console.log("Files analyzed:", analysis.fileCount);
}

testConnection().catch(console.error);

Python

# test_connection.py
import os
from chaozcode import ChaozCode

client = ChaozCode(api_key=os.environ["CHAOZCODE_API_KEY"])

# Test basic query
response = client.query(
    prompt="What is 2 + 2?",
    model="gpt-4"
)
print(f"Response: {response.text}")

# Test Memory Spine
stats = client.memory.stats()
print(f"Memory vectors: {stats['vector_count']}")

# Test code analysis
analysis = client.codebase.analyze(path="./src")
print(f"Files analyzed: {analysis['file_count']}")

5️⃣ Build Your First Project

Project: AI-Powered Task Manager

Let's build a simple task manager that uses ChaozCode for intelligent features.

Step 5.1: Project Setup

# Create project directory
mkdir chaozcode-task-manager
cd chaozcode-task-manager

# Initialize npm project
npm init -y

# Install dependencies
npm install @chaozcode/sdk express dotenv

# Create project structure
mkdir src
touch src/index.js src/tasks.js .env

Step 5.2: Configure Environment

# .env
CHAOZCODE_API_KEY=your-api-key-here
PORT=3000

Step 5.3: Task Manager Code

// src/tasks.js
const { ChaozCode } = require('@chaozcode/sdk');

const client = new ChaozCode({
  apiKey: process.env.CHAOZCODE_API_KEY
});

class TaskManager {
  constructor() {
    this.tasks = [];
  }
  
  async addTask(description) {
    // Use AI to analyze and categorize the task
    const analysis = await client.query({
      prompt: `Analyze this task and return JSON with: category, priority (1-5), estimatedMinutes
      Task: "${description}"`,
      model: "gpt-4"
    });
    
    const taskData = JSON.parse(analysis.text);
    const task = {
      id: Date.now(),
      description,
      ...taskData,
      status: 'pending',
      createdAt: new Date()
    };
    
    this.tasks.push(task);
    
    // Store in Memory Spine for context
    await client.memory.store({
      id: `task-${task.id}`,
      content: JSON.stringify(task),
      tags: ['task', taskData.category]
    });
    
    return task;
  }
  
  async suggestNextTask() {
    // Use Memory Spine to find patterns
    const recentTasks = await client.memory.search({
      query: 'completed tasks this week',
      tags: ['task'],
      limit: 10
    });
    
    const pendingTasks = this.tasks.filter(t => t.status === 'pending');
    
    const suggestion = await client.query({
      prompt: `Based on recently completed tasks and current pending tasks, suggest which task to work on next and why.
      
      Recent completed: ${JSON.stringify(recentTasks)}
      Pending: ${JSON.stringify(pendingTasks)}`,
      model: "gpt-4"
    });
    
    return suggestion.text;
  }
  
  async completeTask(taskId) {
    const task = this.tasks.find(t => t.id === taskId);
    if (!task) throw new Error('Task not found');
    
    task.status = 'completed';
    task.completedAt = new Date();
    
    // Update Memory Spine
    await client.memory.update({
      id: `task-${task.id}`,
      content: JSON.stringify(task),
      tags: ['task', 'completed']
    });
    
    return task;
  }
}

module.exports = TaskManager;

Step 5.4: Express Server

// src/index.js
require('dotenv').config();
const express = require('express');
const TaskManager = require('./tasks');

const app = express();
const taskManager = new TaskManager();

app.use(express.json());

// Add a task
app.post('/tasks', async (req, res) => {
  try {
    const task = await taskManager.addTask(req.body.description);
    res.json({ success: true, task });
  } catch (error) {
    res.status(500).json({ error: error.message });
  }
});

// Get task suggestions
app.get('/tasks/suggest', async (req, res) => {
  try {
    const suggestion = await taskManager.suggestNextTask();
    res.json({ suggestion });
  } catch (error) {
    res.status(500).json({ error: error.message });
  }
});

// Complete a task
app.post('/tasks/:id/complete', async (req, res) => {
  try {
    const task = await taskManager.completeTask(parseInt(req.params.id));
    res.json({ success: true, task });
  } catch (error) {
    res.status(500).json({ error: error.message });
  }
});

const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
  console.log(`Task Manager running on port ${PORT}`);
});

Step 5.5: Run and Test

# Start the server
node src/index.js

# In another terminal, test the API:

# Add a task
curl -X POST http://localhost:3000/tasks \
  -H "Content-Type: application/json" \
  -d '{"description": "Write documentation for the new API endpoint"}'

# Get suggestions
curl http://localhost:3000/tasks/suggest

# Complete a task (use the ID from the add response)
curl -X POST http://localhost:3000/tasks/1234567890/complete
🎉 Congratulations! You've built your first AI-powered application with ChaozCode. The task manager uses intelligent categorization, Memory Spine for context persistence, and AI suggestions.

🎯 Next Steps

📚 Explore Documentation

🔗 Integrate More

💬 Get Help

🔧 Common Setup Issues

❌ "API key invalid" error

  • Ensure your API key is correctly copied (no extra spaces)
  • Check if the key is active in your dashboard
  • Verify environment variable is set: echo $CHAOZCODE_API_KEY

❌ "Connection refused" error

  • Check your internet connection
  • Verify no firewall is blocking outbound HTTPS
  • Try: curl https://api.chaozcode.com/health

❌ "Rate limit exceeded" error

  • Free tier: 100 calls/day, upgrade for more
  • Check usage: chaozcode usage
  • Implement retry logic with exponential backoff

❌ CLI not found after installation

  • Restart your terminal
  • Check npm global bin: npm bin -g
  • Add to PATH: export PATH="$(npm bin -g):$PATH"