跳到主要内容

viben config

Git-style configuration management.

Usage

viben config <subcommand> [options]

Subcommands

SubcommandDescription
get <key>Get a configuration value
set <key> <value>Set a configuration value
listList all configurations
editOpen configuration in editor
unset <key>Remove a configuration value

Key Format

Configuration keys use dot notation:

  • settings.editor - Editor setting
  • settings.pager - Pager setting
  • mcp.enabled[0] - First enabled MCP
  • skills.enabled - List of enabled skills

Commands

Get Configuration

Get a configuration value:

# Get editor setting
viben config get settings.editor

# Get from global configuration
viben config get --global mcp.enabled

# Get from workspace configuration
viben config get --workspace settings.color

Output:

code

JSON Output:

viben config get settings.editor --json
{
"success": true,
"data": {
"key": "settings.editor",
"value": "code"
}
}

Set Configuration

Set a configuration value:

# Set editor
viben config set settings.editor vim

# Set global pager
viben config set --global settings.pager less

# Set workspace color mode
viben config set --workspace settings.color auto

# Set list value
viben config set mcp.enabled '["filesystem", "git"]'

Output:

Set settings.editor = vim

JSON Output:

{
"success": true,
"data": {
"key": "settings.editor",
"value": "vim"
}
}

List Configuration

List all configuration values:

# List merged configuration
viben config list

# List global configuration only
viben config list --global

# List workspace configuration only
viben config list --workspace

# Show configuration origin
viben config list --show-origin

Output:

settings.editor=code
settings.pager=less
settings.color=auto
mcp.enabled=["filesystem", "git"]
mcp.disabled=["browser"]
skills.enabled=["code-review", "commit"]

With --show-origin:

global settings.editor=code
global settings.pager=less
local settings.color=auto
global mcp.enabled=["filesystem", "git"]

JSON Output:

{
"success": true,
"data": {
"config": {
"settings": {
"editor": "code",
"pager": "less",
"color": "auto"
},
"mcp": {
"enabled": ["filesystem", "git"],
"disabled": ["browser"]
},
"skills": {
"enabled": ["code-review", "commit"]
}
}
}
}

Edit Configuration

Open the configuration file in an editor:

# Edit merged/default configuration
viben config edit

# Edit global configuration
viben config edit --global

# Edit workspace configuration
viben config edit --workspace

Opens the configuration file using the editor specified in settings.editor or the EDITOR environment variable.

Unset Configuration

Remove a configuration value:

# Remove a key
viben config unset settings.pager

# Remove from global configuration
viben config unset --global mcp.disabled

Output:

Removed settings.pager

JSON Output:

{
"success": true,
"data": {
"key": "settings.pager",
"removed": true
}
}

Configuration Scopes

Configuration is resolved in the following priority (highest to lowest):

  1. Workspace configuration (.viben/config.yaml)
  2. Global configuration (~/.viben/config.yaml)
  3. Default values

Examples

# Set editor globally
viben config set --global settings.editor vim

# Override editor in workspace
viben config set --workspace settings.editor code

# Now this workspace uses 'code', other workspaces use 'vim'

Common Configuration Keys

KeyTypeDescriptionDefault
settings.editorstringText editor commandcode
settings.pagerstringPager commandless
settings.colorstringColor output modeauto
mcp.enabledstring[]Enabled MCP servers[]
mcp.disabledstring[]Disabled MCP servers[]
skills.enabledstring[]Enabled skills[]

Error Handling

Key Not Found

viben config get nonexistent.key
{
"success": false,
"error": {
"code": "KEY_NOT_FOUND",
"message": "Configuration key 'nonexistent.key' not found"
}
}

Invalid Value

viben config set settings.color invalid
{
"success": false,
"error": {
"code": "INVALID_VALUE",
"message": "Invalid value 'invalid' for key 'settings.color'. Expected: auto, always, never"
}
}