跳到主要内容

Commands Overview

Viben CLI (viben) is the command-line interface for Agent Swarm x Code Evolution. It enables orchestration of AI agent swarms for continuous code improvement and intelligent task management.

Command Structure

viben <command> [subcommand] [options]

Core Commands (Agent Swarm x Code Evolution)

These commands represent the primary workflow for code evolution:

CommandDescription
taskXState-powered task management with state machine workflows
swarmOrchestrate multiple agents working in parallel
ideaAI-driven ideation for features and improvements
queueBackground command execution with concurrency control
evoFileEvo - File-based Self-Evolution for code optimization

Agent & Configuration Commands

CommandDescription
agentManage agent instances and templates
agent chatNon-interactive conversation with Agent
executorDiscover and view executors (Claude Code, Cursor, etc.)
executor chatNon-interactive invocation of AI coding agents
providerManage API providers (OpenAI, Anthropic, etc.)
modelManage models, aliases, and fallback chains
mcpManage MCP servers
skillManage skills

Workspace & Service Commands

CommandDescription
initInitialize workspace in current directory
configConfiguration management (git-style)
serviceManage background services
gatewayStart Gateway (message bus + agent loop)
channelManage chat channels (Telegram, Discord, etc.)
cronManage scheduled tasks
workspaceWorkspace operations
versionShow version information
helpShow help

Global Options

These options apply to all commands:

OptionShortDescription
--jsonOutput JSON (for agent parsing)
--global-gUse global configuration
--workspaceUse workspace configuration (current directory)
--name <id>-nSpecify agent name/ID (default: current or 'main')
--verbose-vVerbose output
--quiet-qSuppress non-essential output
--help-hShow help

JSON Output Format

All commands support the --json flag for structured output, useful for AI agents and scripts.

Response Structure

interface CLIResponse {
success: boolean;
data?: any;
error?: {
code: string;
message: string;
};
}

Success Response

{
"success": true,
"data": {
"task": {
"id": "implement-auth",
"state": "in_progress",
"swarm": ["architect", "implementer"]
}
}
}

Error Response

{
"success": false,
"error": {
"code": "TASK_NOT_FOUND",
"message": "Task 'unknown-task' not found in workspace"
}
}

Scope Resolution

CLI automatically detects scope (global or workspace) based on current directory:

PrioritySourceDescription
1Command line flag--global or --workspace
2Environment variableVIBEN_SCOPE
3Auto-detectIf .viben/ exists in current or parent directory: workspace; otherwise: global

Environment Variables

VariableDescriptionDefault
VIBEN_STATE_DIRState directory~/.viben
VIBEN_CONFIG_PATHConfiguration file path~/.viben/config.yaml
VIBEN_AGENTCurrent agent IDmain
VIBEN_SCOPEConfiguration scopeAuto-detect

Configuration Files

Global Configuration

Located at ~/.viben/config.yaml:

version: 1

settings:
editor: code
pager: less
color: auto

# Swarm configuration
swarm:
default_roles:
- architect
- implementer
- reviewer
max_parallel_agents: 4

# FileEvo settings
evo:
enabled: true
metrics:
- code_quality
- test_coverage
- complexity

mcp:
enabled:
- filesystem
- git

skills:
enabled:
- code-review
- commit

Workspace Configuration

Located at <project>/.viben/config.yaml, overrides global settings for the workspace.

Agent Integration

AI agents can use CLI through Bash tools:

# Task workflow (primary use case)
viben task create "implement-auth" --json
viben task enqueue implement-auth --json
viben task start implement-auth --json

# Swarm orchestration
viben swarm start --task implement-auth --json
viben swarm status --json

# Idea generation
viben idea generate --context "improve auth" --json

# Configuration
viben config list --json
viben agent sync claude-code --json

Next Steps