Skip to main content

Agent Configuration

This guide covers all aspects of agent configuration, including the main configuration file, MCP servers, skills, and startup configuration.

Configuration Files Overview

Each agent has several configuration files:

FilePurpose
config.yamlMain agent configuration
mcp_servers.jsonMCP servers configuration
.agentrcStartup configuration (environment, defaults)
skills/Agent-specific skills directory

Main Configuration (config.yaml)

File Location

~/.viben/agents/<agent-id>/config.yaml

Structure

# ~/.viben/agents/my-agent/config.yaml
version: 1

# Agent metadata
id: my-agent
name: "My Coding Assistant"
description: "A helpful coding assistant"
created: 2024-01-15T10:30:00Z

# Agent type (determines runtime behavior)
type: claude-code # claude-code | cursor | gemini | codex | ...

# Type-specific configuration
type_config:
plan: true
dangerously_skip_permissions: false
append_prompt: "You are a helpful coding assistant."

# MCP configuration (can also be in mcp_servers.json)
mcp:
enabled:
- filesystem
- git
disabled:
- browser

# Skills configuration
skills:
enabled:
- code-review
- commit

Configuration Fields

FieldTypeDescription
versionnumberConfiguration version (always 1)
idstringAgent ID (must match directory name)
namestringHuman-readable agent name
descriptionstringAgent description
createdstringCreation timestamp (ISO 8601)
typestringAgent type (see supported types)
type_configobjectType-specific configuration
mcpobjectMCP servers configuration
skillsobjectSkills configuration

Type-Specific Configuration

Each agent type has its own configuration options:

Claude Code (claude-code):

type_config:
plan: true # Enable planning mode
dangerously_skip_permissions: false # Skip permission checks
append_prompt: "Custom instructions" # Additional system prompt

Cursor (cursor):

type_config:
composer: true # Enable composer mode
rules_file: ".cursorrules"

Gemini (gemini):

type_config:
safety_settings: default
generation_config:
temperature: 0.7
max_output_tokens: 8192

Configuring via CLI

View Configuration

viben agent config -n <agent-id>

Example:

viben agent config -n my-agent

Output:

version: 1
id: my-agent
name: "My Coding Assistant"
type: claude-code
type_config:
plan: true
mcp:
enabled:
- filesystem
- git
skills:
enabled:
- code-review

Set Configuration Values

viben agent config -n <agent-id> set <key> <value>

Examples:

# Set model
viben agent config -n my-agent set model gpt-4

# Enable planning
viben agent config -n my-agent set plan true

# Set agent name
viben agent config -n my-agent set name "My Custom Agent"

# Configure MCP servers (JSON array)
viben agent config -n my-agent set mcp.enabled '["filesystem","git"]'

# Set nested values using dot notation
viben agent config -n my-agent set type_config.temperature 0.8

Get Specific Value

viben agent config -n <agent-id> get <key>

Example:

viben agent config -n my-agent get type_config.plan

Output:

true

MCP Servers Configuration

File Location

~/.viben/agents/<agent-id>/mcp_servers.json

Structure

{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-server-filesystem"],
"env": {
"ROOT": "/path/to/workspace"
}
},
"git": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-server-git"]
},
"custom-mcp": {
"command": "python",
"args": ["-m", "my_mcp_server"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}

MCP Server Entry Fields

FieldTypeDescription
commandstringCommand to run (e.g., npx, python)
argsarrayCommand arguments
envobjectEnvironment variables for the server

Managing MCP via CLI

# Enable an MCP server
viben mcp enable filesystem -n my-agent

# Disable an MCP server
viben mcp disable browser -n my-agent

# List MCP servers for agent
viben mcp list -n my-agent

# Configure MCP server
viben mcp config filesystem set root /path/to/dir -n my-agent

Skills Configuration

Skills are configured in the agent's config.yaml and stored in the skills/ directory:

Directory Structure

~/.viben/agents/<agent-id>/skills/
|-- code-review/
| |-- config.yaml
| +-- prompts/
+-- commit/
|-- config.yaml
+-- templates/

Skills in config.yaml

skills:
enabled:
- code-review
- commit
- test-runner
disabled:
- documentation

Managing Skills via CLI

# Install a skill to agent
viben skill install code-review -n my-agent

# List skills for agent
viben skill list -n my-agent

# Enable/disable skills
viben skill enable code-review -n my-agent
viben skill disable documentation -n my-agent

Agent RC File (.agentrc)

The .agentrc file contains startup configuration that runs when the agent starts.

File Location

~/.viben/agents/<agent-id>/.agentrc

Structure

# ~/.viben/agents/my-agent/.agentrc
# Agent startup configuration

# Environment variables
export ANTHROPIC_API_KEY="sk-ant-xxx"
export OPENAI_API_KEY="sk-xxx"

# Default session
DEFAULT_SESSION="main"

# Memory configuration
MEMORY_FILES="MEMORY.md"
DAILY_LOG_DAYS=2 # Read today + yesterday

# Custom settings
CUSTOM_VAR="custom-value"

RC File Variables

VariableDescriptionDefault
DEFAULT_SESSIONDefault session to usemain
MEMORY_FILESMemory files to loadMEMORY.md
DAILY_LOG_DAYSNumber of daily logs to read2

Configuration Precedence

Configuration is merged in the following order (later overrides earlier):

  1. Agent base config (~/.viben/agents/<id>/config.yaml)
  2. Workspace config (<project>/.viben/config.yaml)
  3. Agent type workspace config (<project>/.claude/, .cursor/, etc.)
  4. Environment variables
  5. Command line arguments

Example

# Agent config sets model to claude-sonnet-4
# Workspace config sets model to gpt-4
# Command line overrides to gpt-4-turbo

viben agent run -n my-agent --model gpt-4-turbo
# Result: uses gpt-4-turbo

Environment Variables

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

Best Practices

Security

  1. Never commit API keys to version control
  2. Use environment variables for sensitive values
  3. Use encrypted: prefix for stored credentials

Organization

  1. Keep configuration minimal - use defaults when possible
  2. Document custom settings with comments
  3. Use templates for common configurations

Debugging

# View effective configuration with all merges applied
viben agent config -n my-agent --effective

# Show configuration sources
viben agent config -n my-agent --show-origin

Next Steps