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

# config

> Read and write CLI, global, and project configuration.

# cirron config

Unified configuration management for the Cirron CLI. The config command manages three scopes: CLI settings (API URL, timeout, retries), global user preferences, and project-level settings. It also provides a `hardware` subcommand for ML hardware profiles.

## Usage

```bash theme={null}
cirron config [options]
cirron config --scope <scope> [options]
cirron config hardware [options]
```

## Options

| Option                  | Description                                      | Default |
| ----------------------- | ------------------------------------------------ | ------- |
| `--scope <scope>`       | Configuration scope (`cli`, `global`, `project`) | Auto    |
| `--list, -l`            | List configuration settings                      | `false` |
| `--get, -g <key>`       | Get a specific configuration value               | -       |
| `--set, -s <key=value>` | Set a configuration value                        | -       |
| `--delete, -d <key>`    | Delete a configuration value                     | -       |
| `--reset`               | Reset configuration to defaults                  | `false` |
| `--edit, -e`            | Interactive configuration editor                 | `false` |
| `--explain <key>`       | Show setting resolution chain across scopes      | -       |
| `--export <file>`       | Export configuration to file                     | -       |
| `--import <file>`       | Import configuration from file                   | -       |
| `--template, -t <name>` | Apply a settings template                        | -       |
| `--verbose`             | Verbose output                                   | `false` |
| `--json`                | Output in JSON format                            | `false` |

When no scope is specified: `--list` shows all scopes; `--get` walks the resolution chain (project > global > cli); `--set` defaults to project; `--edit` prompts for scope; `--export`, `--import`, `--reset`, `--delete` require an explicit `--scope`.

## Scopes

| Scope     | Description                             | Storage                       |
| --------- | --------------------------------------- | ----------------------------- |
| `cli`     | API URL, timeout, retries, auth token   | `~/.cirron/config.json`       |
| `global`  | User preferences shared across projects | `~/.cirron/settings.json`     |
| `project` | Project-specific behavior settings      | `cirron.yaml` in project root |

### CLI scope keys

| Key          | Description                        | Default                  | Valid Values                     |
| ------------ | ---------------------------------- | ------------------------ | -------------------------------- |
| `apiUrl`     | Cirron API URL                     | `https://app.cirron.com` | Valid URL                        |
| `defaultEnv` | Default environment for commands   | `production`             | development, staging, production |
| `timeout`    | Request timeout in milliseconds    | `30000`                  | 1000-300000                      |
| `retries`    | Retry attempts for failed requests | `3`                      | 0-10                             |

```bash theme={null}
# CLI scope
cirron config --scope cli --list
cirron config --scope cli --set apiUrl=https://app.cirron.com
cirron config --scope cli --set defaultEnv=staging
cirron config --scope cli --reset

# Global scope (user preferences)
cirron config --scope global --list
cirron config --scope global --edit
cirron config --scope global --export settings-backup.json
cirron config --scope global --import settings-backup.json

# Project scope (cirron.yaml)
cirron config --scope project --list
cirron config --scope project --set <key>=<value>
cirron config --scope project --template <name>

# Resolution chain across scopes
cirron config --explain defaultEnv
```

## Interactive Mode

Running `cirron config` with no options prompts for scope selection:

```
Which configuration scope would you like to manage?
> CLI Configuration (API URL, timeout, retries)
  Global Settings (user preferences)
  Project Settings (project behavior)
```

## Hardware Subcommand

Manage hardware profiles used during compilation and build.

```bash theme={null}
cirron config hardware [options]
```

| Option              | Description                           | Default |
| ------------------- | ------------------------------------- | ------- |
| `--detect`          | Detect current device hardware        | `false` |
| `--configure`       | Configure hardware interactively      | `false` |
| `--list`            | List available hardware profiles      | `false` |
| `--profile <name>`  | Use specific hardware profile         | -       |
| `--save [filename]` | Save hardware configuration to file   | -       |
| `--from <path>`     | Load hardware configuration from file | -       |
| `--current`         | Use current device specifications     | `false` |
| `--json`            | Output in JSON format                 | `false` |
| `--verbose`         | Show detailed information             | `false` |

Detection reports CPU, memory, GPU, CUDA availability, and framework compatibility (PyTorch, TensorFlow, scikit-learn). Configuration modes: auto-detect, preset profiles, or manual specification. When run inside a project, the command prompts to save and optionally apply the profile to the current `cirron.yaml`.

```bash theme={null}
cirron config hardware --detect
cirron config hardware --detect --save my-hardware.json
cirron config hardware --configure --from team-hardware.json
cirron config hardware --list
```

## Security and Storage

* **Token masking**: tokens display as `abc12345********`.
* **Restricted deletion**: only `token` can be deleted via `config --delete`; for auth changes use `cirron auth logout`.
* **File locations**: `~/.cirron/config.json` (CLI), `~/.cirron/settings.json` (global), `cirron.yaml` (project), `~/.cirron/hardware/` (hardware profiles).

## Environment Variables

```bash theme={null}
CIRRON_API_URL=https://custom-app.cirron.com cirron build
CIRRON_TIMEOUT=60000 cirron deploy
```

## Related Commands

* **cirron auth** - Manage authentication
* **cirron info --hardware** - Quick hardware detection (shortcut for `cirron config hardware --detect`)
* **cirron info --diagnostics** - Run diagnostic checks
* **cirron status** - Check system status
