> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hopx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> Complete reference for HopX CLI configuration commands - show, set, get, and manage configuration profiles. Configure CLI settings, default values, and multiple profiles for different environments.

Manage CLI configuration using the `config` command. View and modify settings, manage configuration profiles, and configure default values for commands.

## Command Syntax

```bash theme={null}
hopx config <subcommand> [options]
```

## Subcommands

### `show`

Show current configuration.

**Syntax:**

```bash theme={null}
hopx config show [OPTIONS]
```

**Examples:**

```bash theme={null}
# Show current configuration
hopx config show
```

**Expected Output:**

```
┌─────────────────────┬─────────────────────────────────────┐
│ Setting             │ Value                               │
├─────────────────────┼─────────────────────────────────────┤
│ Profile             │ default                             │
│ API Key             │ hopx_live_... (configured)         │
│ Base URL            │ https://api.hopx.dev                │
│ Default Template    │ code-interpreter                    │
│ Default Timeout     │ 3600                                │
│ Output Format       │ table                               │
└─────────────────────┴─────────────────────────────────────┘
```

**Exit Codes:**

* `0` - Success

### `set`

Set a configuration value.

**Syntax:**

```bash theme={null}
hopx config set KEY VALUE [OPTIONS]
```

**Arguments:**

* `KEY` - Configuration key (required)
* `VALUE` - Configuration value (required)

**Examples:**

```bash theme={null}
# Set default template
hopx config set default_template python

# Set default timeout
hopx config set default_timeout 7200

# Set output format
hopx config set output_format json
```

**Expected Output:**

```
✓ Configuration updated: default_template = python
```

**Exit Codes:**

* `0` - Success
* `2` - Invalid key or value

### `get`

Get a configuration value.

**Syntax:**

```bash theme={null}
hopx config get KEY [OPTIONS]
```

**Arguments:**

* `KEY` - Configuration key (required)

**Examples:**

```bash theme={null}
# Get default template
hopx config get default_template

# Get output format
hopx config get output_format
```

**Expected Output:**

```
python
```

**Exit Codes:**

* `0` - Success
* `2` - Key not found

### `path`

Show configuration file path.

**Syntax:**

```bash theme={null}
hopx config path [OPTIONS]
```

**Examples:**

```bash theme={null}
# Show config file path
hopx config path
```

**Expected Output:**

```
~/.hopx/config.yaml
```

**Exit Codes:**

* `0` - Success

### `init`

Initialize configuration (interactive setup).

**Syntax:**

```bash theme={null}
hopx config init [OPTIONS]
```

**Examples:**

```bash theme={null}
# Initialize configuration
hopx config init
```

**Expected Output:**

```
Configuration setup wizard
✓ Configuration initialized
```

**Exit Codes:**

* `0` - Success

### `profiles`

Manage configuration profiles.

#### `profiles list`

List all configuration profiles.

**Syntax:**

```bash theme={null}
hopx config profiles list [OPTIONS]
```

**Examples:**

```bash theme={null}
# List profiles
hopx config profiles list
```

**Expected Output:**

```
┌───────────┬──────────────┐
│ Profile   │ Active       │
├───────────┼──────────────┤
│ default   │ ✓            │
│ production│              │
│ staging   │              │
└───────────┴──────────────┘
```

#### `profiles create`

Create a new configuration profile.

**Syntax:**

```bash theme={null}
hopx config profiles create PROFILE_NAME [OPTIONS]
```

**Arguments:**

* `PROFILE_NAME` - Profile name (required)

**Examples:**

```bash theme={null}
# Create profile
hopx config profiles create production
```

**Expected Output:**

```
✓ Profile created: production
```

#### `profiles use`

Switch to a configuration profile.

**Syntax:**

```bash theme={null}
hopx config profiles use PROFILE_NAME [OPTIONS]
```

**Arguments:**

* `PROFILE_NAME` - Profile name (required)

**Examples:**

```bash theme={null}
# Switch to profile
hopx config profiles use production
```

**Expected Output:**

```
✓ Switched to profile: production
```

#### `profiles delete`

Delete a configuration profile.

**Syntax:**

```bash theme={null}
hopx config profiles delete PROFILE_NAME [OPTIONS]
```

**Arguments:**

* `PROFILE_NAME` - Profile name (required)

**Examples:**

```bash theme={null}
# Delete profile
hopx config profiles delete staging
```

**Expected Output:**

```
✓ Profile deleted: staging
```

## Configuration Keys

Common configuration keys:

* `default_template` - Default template for sandbox creation
* `default_timeout` - Default timeout in seconds
* `output_format` - Default output format (`table`, `json`, `plain`)
* `base_url` - API base URL (default: `https://api.hopx.dev`)

## Shell Scripting Examples

### Configure for Different Environments

```bash theme={null}
#!/bin/bash

# Create production profile
hopx config profiles create production
hopx config profiles use production
hopx config set default_template python
hopx config set default_timeout 7200

# Create staging profile
hopx config profiles create staging
hopx config profiles use staging
hopx config set default_template code-interpreter
hopx config set default_timeout 3600
```

### Use Profile for Single Command

```bash theme={null}
#!/bin/bash

# Use production profile for single command
hopx --profile production sandbox create --template python
```

## Related

* **[CLI Quickstart](/cli/quickstart)** - Get started with CLI
* **[CLI Installation](/cli/installation)** - Installation and initial setup
* **[Authentication](/cli/commands/auth)** - Configure authentication

## Next Steps

* Learn about [Authentication](/cli/commands/auth) to configure API keys
* Explore [Sandbox Management](/cli/commands/sandbox) to use configured defaults
* Review [Environment Variables](/cli/commands/env) for sandbox configuration
