跳到主要内容

Quick Start

Get Agent Swarm x Code Evolution running in 5 minutes. Viben CLI enables AI agent swarms to continuously evolve and optimize your codebase through FileEvo, intelligent task management, and collaborative agent orchestration.

Step 1: Install Viben CLI​

npm install -g @viben/cli

Verify the installation:

viben --help

Step 2: Initialize Your First Workspace​

Navigate to your project directory and initialize Viben:

cd /path/to/your/project
viben init

Output:

Initialized Viben workspace in /path/to/your/project
Created .viben/config.yaml

Next steps:
viben provider create -t anthropic # Set up API provider
viben mcp install <name> # Install MCP server
viben skill install <name> # Install skill

Step 3: Configure API Provider​

Set up your preferred AI provider. Viben supports multiple providers including Anthropic, OpenAI, Google, Azure, and more.

Set API keys as environment variables:

# Anthropic
export ANTHROPIC_API_KEY="sk-ant-xxx"

# OpenAI
export OPENAI_API_KEY="sk-xxx"

Then create the provider:

viben provider create -t anthropic

Option B: Provide API Key Directly​

viben provider create -t anthropic --api-key "sk-ant-xxx"
提示

When providing an API key directly, it will be encrypted and securely stored in ~/.viben/models.yaml.

Verify Provider​

Check provider connectivity:

viben provider status

Output:

Provider Status:
anthropic-main anthropic ✓ connected latency: 120ms

Step 4: Create Your First Agent​

Create an AI agent instance:

viben agent create -n my-agent

Output:

Agent: my-agent
Type: claude-code
Created: 2024-01-15

Paths:
Config: ~/.viben/agents/my-agent/config.yaml
Memory: ~/.viben/agents/my-agent/memory/
Sessions: ~/.viben/agents/my-agent/.agent_sessions/

Configure Agent​

Set a model for your agent:

viben agent config -n my-agent --set model=claude-sonnet-4-20250514

Set as Default​

Set this agent as the default:

viben agent set-default -n my-agent

Step 5: Install MCP Servers​

Install commonly used MCP servers:

# Filesystem access
viben mcp add filesystem --agent my-agent --command npx --args @anthropic-ai/mcp-server-filesystem /home/user

# Git operations
viben mcp add git --agent my-agent --command npx --args @anthropic-ai/mcp-server-git

List installed MCP servers:

viben mcp list --agent my-agent

Output:

MCP Servers for Agent: my-agent
Name Command Enabled
filesystem npx @anthropic-ai/mcp-server-fs yes
git npx @anthropic-ai/mcp-server-git yes

Step 6: Verify Setup​

Check overall status:

viben agent status

Output:

Agent: my-agent (default)
Type: claude-code
Model: claude-sonnet-4-20250514 (anthropic-main)

MCP: filesystem, git (2 enabled)
Skills: none

Memory:
MEMORY.md 0 KB empty

Sessions: 0

Common Workflows​

View All Configuration​

# List all configuration (show global and workspace)
viben config list --show-origin

Edit Configuration​

# Open configuration in editor
viben config edit

# Or set specific values
viben config set settings.editor vim

Manage Multiple Agents​

# List all agents
viben agent list

# Create agent from template
viben agent create -n research-bot -f coding-assistant

# Switch default agent
viben agent set-default -n research-bot

Configure Model Aliases​

Set up convenient model aliases:

# Create aliases for quick reference
viben model alias create -n fast -m claude-3-5-haiku-latest
viben model alias create -n smart -m claude-sonnet-4-20250514
viben model alias create -n best -m claude-opus-4-20250514

Now you can use fast, smart, or best instead of full model names:

viben agent config -n my-agent --set model=smart

Set Up Model Fallback Chain​

Configure backup models in case the primary model is unavailable:

viben model set-default -n your-preferred-model

Workspace-Specific Configuration​

Override global settings for a specific project:

# In your project directory
viben config set --workspace mcp.enabled '["filesystem", "git", "browser"]'

JSON Output for Automation​

All commands support the --json flag for scripting and AI agent integration:

# Get agent list as JSON
viben agent list --json

# Get provider status as JSON
viben provider status --json

Example JSON output:

{
"success": true,
"data": {
"current": "my-agent",
"agents": [
{
"id": "my-agent",
"name": "My Agent",
"type": "claude-code",
"path": "~/.viben/agents/my-agent/"
}
]
}
}

Quick Reference​

TaskCommand
Initialize workspaceviben init
Create providerviben provider create -t <type>
Create agentviben agent create -n <name>
Configure agentviben agent config -n <name> --set <key>=<value>
Add MCPviben mcp add <name> --agent <id> --command <cmd>
Install skillviben skill install <name>
Check statusviben agent status
List agentsviben agent list
List providersviben provider list
List modelsviben model list
Start Gatewayviben gateway start
View executorsviben executor list

Next Steps​

Now that you have Viben CLI set up, you can: