Synopsis
config command provides subcommands for validating and inspecting the CodexBar configuration file at ~/.codexbar/config.json.
Subcommands
validate
Validate the configuration file for errors and warnings.- Required fields are present
- Field types are correct
- Enum values are valid
- Provider IDs are recognized
- API keys and tokens are well-formed (format check only, not auth validation)
- Deprecated fields or settings
- Configuration conflicts
- Returns
0for valid config or warnings only - Returns non-zero exit code if errors are found
dump
Print the normalized configuration as JSON.- Normalized and merged configuration (defaults + user overrides)
- Secrets are included in output (use with caution)
- Useful for debugging configuration issues
- Always outputs JSON format
Parameters
Common Parameters
Output format for
validate command. Options:text- Human-readable validation messagesjson- Machine-readable JSON array of validation issues
dump always outputs JSON.Pretty-print JSON output with indentation.
Suppress non-JSON output; errors become JSON payloads.
Enable verbose logging.
Set log level:
trace, verbose, debug, info, warning, error, or critical.Emit machine-readable JSONL logs on stderr.
Disable ANSI colors in text output.
Show help message.
Response Fields
validate - JSON Output Structure
Returns an array of validation issues:Issue severity:
error or warning.error: Configuration is invalid and may cause runtime failureswarning: Configuration is valid but not recommended (deprecated fields, etc.)
Provider ID associated with the issue (e.g.,
claude, codex), or null for global config issues.Configuration field path where the issue was found (e.g.,
providers.claude.apiKey).Human-readable description of the validation issue.
dump - JSON Output Structure
Provider-specific configuration keyed by provider ID.
Global preferences.
Configuration file format version.
Examples
Validate configuration (text format)
Validate configuration (JSON format)
Dump normalized configuration
Validate and exit with code
Dump config for debugging
Machine-readable validation
Exit Codes
- 0: Success (valid configuration or warnings only for
validate) - 1: Failure (configuration errors found for
validate, or unexpected error fordump) - 3: Parse/format error (malformed JSON in config file)
Notes
Configuration File
- Location:
~/.codexbar/config.json - Created automatically on first run if not present
- JSON format with schema validation
- See
docs/configuration.mdin the repository for full schema documentation
Validation Scope
What is validated:- JSON syntax and structure
- Required fields presence
- Field type correctness (string, integer, boolean, array, object)
- Enum value validity (e.g.,
sourcemust beauto,web,cli,oauth, orapi) - Provider ID recognition
- Token/API key format (structure only, not authentication)
- Deprecated fields and settings
- API key authentication (use
codexbar --provider <id>to test) - Network connectivity
- Provider CLI binary availability
- Browser cookie access permissions
- Actual token validity (format check only)
Warnings vs Errors
Errors indicate invalid configuration that will cause runtime failures:- Missing required fields
- Invalid field types
- Unrecognized enum values
- Malformed JSON
- Deprecated fields (still functional but may be removed in future)
- Unusual settings that might indicate user error
- Missing optional recommended fields
Security Warning
- The
dumpcommand outputs sensitive secrets including API keys and session tokens - Do not share the output publicly or commit it to version control
- Use redirection to write to a secure file if needed:
codexbar config dump > /tmp/config.json - Consider using
jqto redact secrets:codexbar config dump | jq '.providers | with_entries(.value.apiKey = "[REDACTED]")'
Common Validation Issues
Missing API keys:"apiKey": "ghp_..." to the provider config or set COPILOT_API_TOKEN environment variable.
Invalid token format:
sessionKey starts with sk-ant-sid01- or accessToken starts with sk-ant-oat-.
Provider not enabled:
"enabled": true or remove the provider configuration.
Deprecated fields:
