config
Implementation Reference
Source Files:
apps/xec/src/commands/config.ts- Main config command implementationapps/xec/src/config/loader.ts- Configuration loading logicapps/xec/src/config/schema.ts- Configuration validation schemasapps/xec/src/config/types.ts- Configuration type definitionsapps/xec/src/config/defaults.ts- Default configuration values
Key Functions:
ConfigCommand.execute()- Main command entry pointConfigManager.get()- Get configuration value by pathConfigManager.set()- Set configuration valueConfigManager.unset()- Remove configuration valuevalidateConfig()- Validate configuration against schemaloadConfig()- Load configuration from file
Overview
Manage Xec configuration with interactive and command-line interfaces.
Synopsis
xec config [subcommand] [args...] [options]
xec conf [subcommand] [args...] [options] # Alias
xec cfg [subcommand] [args...] [options] # Short alias
Description
The config command provides comprehensive configuration management for Xec projects. It supports interactive configuration editing, command-line operations, and specialized management for targets, variables, tasks, and defaults.
Subcommands
Basic Configuration
get
Get configuration value by key.
xec config get <key>
Examples:
# Get top-level value
xec config get name
# Get nested value using dot notation
xec config get targets.hosts.production.host
# Get array or object values
xec config get tasks.deploy.steps
set
Set configuration value.
xec config set <key> <value> [options]
Options:
--json- Parse value as JSON
Examples:
# Set simple value
xec config set name "my-project"
# Set nested value
xec config set targets.hosts.production.port 2222
# Set JSON value
xec config set tasks.build.env '{"NODE_ENV":"production"}' --json
# Set boolean value
xec config set defaults.docker.tty true
# Set numeric value
xec config set targets.defaults.ssh.port 22
unset
Remove configuration value.
xec config unset <key>
Examples:
# Remove simple value
xec config unset description
# Remove nested value
xec config unset targets.hosts.old-server
# Remove entire section
xec config unset targets.containers
list
List all configuration values.
xec config list [options]
Options:
--json- Output as JSON--path <path>- List values under specific path
Examples:
# List all configuration
xec config list
# List as JSON
xec config list --json
# List specific section
xec config list --path targets.hosts
view
View current configuration with default value highlighting.
xec config view [options]
Options:
--defaults- Show default values in dimmer color
Examples:
# View configuration with defaults highlighted
xec config view --defaults
# View current configuration only
xec config view