config.json file or via command-line arguments. This allows you to persist settings like your API key, preferred server port, and execution mode.
Configuration File
By default, xCommand looks for a configuration file at:~/.xcommand/config.json
File Structure
The configuration file is a simple JSON object. Here is the default structure:Fields
| Field | Description | Default |
|---|---|---|
api_key | Your xCommand API key for authentication. | None |
server_port | The port used when running in server mode. | 8080 |
mode | The default execution mode (safe or standard). | safe |
CLI Arguments
You can override the default configuration using command-line flags.Custom Configuration Path
If you want to use a specific configuration file instead of the default one, use the--config-file flag:
Server Port Override
When starting the server, you can specify a port that takes precedence over the configuration file:Environment Variables
For automated environments or CI/CD pipelines, you can use theXCOMMAND_API_KEY environment variable to authenticate without a configuration file.