Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.d/854.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Fixed

- Make `devops docs generate` and `devops docs check` fail closed when a command module, FastMCP tool listing, or exception module fails to import, and render group-callback options, MCP array item types and enum values, all project config file candidates and `Settings` sections in `docs/CONFIGURATION.md`, and all `DevOpsCLIError` subclasses with their constructor error and exit codes in `docs/ERRORS.md` (#854).
60 changes: 60 additions & 0 deletions docs/CLI_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,19 @@ devops workspace clean [OPTIONS]

Install and manage DevOps tool binaries.

```bash
devops install-tools [OPTIONS] COMMAND [ARGS]...
```

**Options:**

| Option / Flag | Type | Default | Description |
|---|---|---|---|
| `--tool`, `-t` | `string` | - | Install a specific tool. |
| `--target-dir`, `-d` | `path` | `~/.local/bin` | Target directory path for operation. |
| `--only-missing` | `boolean` | - | Only install tools that are not linked at their locked version. |
| `--check` | `boolean` | - | Install nothing: report each tool not linked at its locked version, and exit 1 if any. |

### `devops install-tools status`

**Show each tool's locked version and where its command is installed, without a request.**
Expand Down Expand Up @@ -2532,6 +2545,22 @@ devops config audit-keys [OPTIONS]

Run tests, linting, formatting, and type-checks.

```bash
devops ci [OPTIONS] COMMAND [ARGS]...
```

**Options:**

| Option / Flag | Type | Default | Description |
|---|---|---|---|
| `--fix` / `--no-fix` | `boolean` | `True` | Auto-fix lint/format before reporting status. |
| `--check` | `boolean` | - | Run in check-only mode without automatically applying formatting or lint fixes. |
| `--cache` / `--no-cache` | `boolean` | `True` | Reuse a cached verdict when the codebase is unchanged. Results are recorded either way. |
| `--force`, `-f` | `boolean` | - | Bypass CI execution cache and force re-execution of all quality gates. |
| `--only` | `string` | - | Run only the specified check names (comma-separated or repeated). |
| `--skip` | `string` | - | Skip the specified check names (comma-separated or repeated). |
| `--dry-run` | `boolean` | - | Preview execution plan without mutating external state. |

### `devops ci test`

**Run the test suite, or only the tests covering the given source files.**
Expand Down Expand Up @@ -2877,6 +2906,17 @@ devops uv run

Security scanner suite: Trivy, Gitleaks, Semgrep, Checkov, Kubeconform.

```bash
devops scan [OPTIONS] COMMAND [ARGS]...
```

**Options:**

| Option / Flag | Type | Default | Description |
|---|---|---|---|
| `--dry-run` | `boolean` | - | Preview execution plan without mutating external state. |
| `--json` | `boolean` | - | Output findings or metrics as JSON. |

### `devops scan trivy`

**Run Aqua Trivy vulnerability, secret, and misconfiguration scan.**
Expand Down Expand Up @@ -3120,6 +3160,16 @@ devops scan sarif [OPTIONS] <document>

Configure, test, chat, analyze, and review codebases (Ollama, Claude, Copilot).

```bash
devops ai [OPTIONS] COMMAND [ARGS]...
```

**Options:**

| Option / Flag | Type | Default | Description |
|---|---|---|---|
| `--explain`, `-e` | `boolean` | - | Explain AI agent workflows, FastMCP tools, RAG terminology, and metrics. |

### `devops ai config`

**Show or update AI provider configuration.**
Expand Down Expand Up @@ -5290,6 +5340,16 @@ devops ai research analogies [OPTIONS]

AI-powered multi-persona code review and security audits.

```bash
devops review [OPTIONS] COMMAND [ARGS]...
```

**Options:**

| Option / Flag | Type | Default | Description |
|---|---|---|---|
| `--explain`, `-e` | `boolean` | - | Explain code review personas, severity levels, and terminology. |

### `devops review path`

**Review source files directly (no git required).**
Expand Down
144 changes: 135 additions & 9 deletions docs/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@ This document is automatically generated from `Settings` (`src/devops_cli/config
DevOps CLI supports hierarchical configuration resolution through:
1. **CLI Flags & Arguments** (highest precedence)
2. **Environment Variables** (`DEVOPS_CLI_*`)
3. **Local Project Configuration** (the file `DEVOPS_CLI_CONFIG` names, else the nearest `config.yaml`, `.devops/config.yaml` or `.devops.yaml` from the working directory up to its repository root)
3. **Local Project Configuration** (the file `DEVOPS_CLI_CONFIG` names, else the nearest `config.yaml`, `.devcontainer/config.yaml`, `.devops/config.yaml`, `.devops.yaml` or `.devcontainer/.devops.yaml` from the working directory up to its repository root)
4. **Global User Configuration** (`~/.config/devops-cli/config.yaml`)
5. **System Defaults**

A `devops review` command reads a tree it does not own. Started in a repository other than devops-cli's own, it looks for no project configuration, reading only the file `DEVOPS_CLI_CONFIG` names, and it resolves a relative data path under `~/.local/share/devops-cli` rather than under that repository, so its default data directory is `~/.local/share/devops-cli/.data`. What a review keeps -- its sessions, the feedback dataset, runs, samples, library contracts and AI spend -- every other command started outside devops-cli's own repository reads and writes there too. devops-cli's own repository is the one whose checkout holds the source of the devops-cli that runs, as an editable install's does; its code already runs, so a review started there, or in any worktree of it, reads its project configuration and keeps all data under its main worktree's `.data`, as every other command does. A clone nested in that checkout is another repository, and an installed devops-cli trusts no repository this way. An absolute `DEVOPS_CLI_DATA_DIR` or `data.dir` names the data directory every command uses.

---

## GitHub Configuration (`github`)

GitHub authentication, default owner, and repository settings.

| Option | Type | Default | Environment Variable | Description |
|---|---|---|---|---|
| `default_org` | `Union` | - | `DEVOPS_CLI_GITHUB_DEFAULT_ORG` | - |

## SSH Configuration (`ssh`)

SSH key generation, rotation, signing, and GitHub registration settings.
Expand All @@ -39,9 +47,82 @@ Multi-root VS Code workspace file management and data tier settings.
|---|---|---|---|---|
| `file` | `Path` | `.code-workspace` | `DEVOPS_CLI_WORKSPACE_FILE` | - |

## Grafana Configuration (`grafana`)

Grafana endpoint, authentication, and service addressing settings.

| Option | Type | Default | Environment Variable | Description |
|---|---|---|---|---|
| `url` | `Union` | - | `DEVOPS_CLI_GRAFANA_URL` | - |

## Prometheus Configuration (`prometheus`)

Prometheus query endpoint, authentication, and service addressing settings.

| Option | Type | Default | Environment Variable | Description |
|---|---|---|---|---|
| `url` | `Union` | - | `DEVOPS_CLI_PROMETHEUS_URL` | - |

## Argo CD Configuration (`argocd`)

Argo CD server endpoint, authentication, TLS, and service addressing settings.

| Option | Type | Default | Environment Variable | Description |
|---|---|---|---|---|
| `url` | `Union` | - | `DEVOPS_CLI_ARGOCD_URL` | - |

## Qdrant Vector Store (`qdrant`)

The vector store that RAG searches query and indexing writes to.

| Option | Type | Default | Environment Variable | Description |
|---|---|---|---|---|
| `url` | `Union` | `http://localhost:6333` | `DEVOPS_CLI_QDRANT_URL` | - |
| `collection_prefix` | `str` | `devops` | `DEVOPS_CLI_QDRANT_COLLECTION_PREFIX` | - |
| `api_key` | `Union` | - | `DEVOPS_CLI_QDRANT_API_KEY` | - |
| `timeout` | `float` | `300.0` | `DEVOPS_CLI_QDRANT_TIMEOUT` | Seconds each Qdrant request waits per attempt: RAG searches, and indexing's upserts and deletes, which share the client |

## Valkey Configuration (`valkey`)

Valkey caching endpoint, authentication, TLS, and service addressing settings.

| Option | Type | Default | Environment Variable | Description |
|---|---|---|---|---|
| `host` | `str` | `localhost:6379` | `DEVOPS_CLI_VALKEY_HOST` | - |
| `port` | `int` | `6379` | `DEVOPS_CLI_VALKEY_PORT` | - |
| `url` | `Union` | - | - | - |
| `password` | `Union` | - | `DEVOPS_CLI_VALKEY_PASSWORD` | - |
| `db` | `int` | `0` | `DEVOPS_CLI_VALKEY_DB` | - |
| `timeout` | `float` | `2.0` | `DEVOPS_CLI_VALKEY_TIMEOUT` | - |
| `threat_intel_ttl` | `int` | `86400` | - | - |

## Shared Run Index (`runs`)

PostgreSQL connection settings for the shared AI run index.

| Option | Type | Default | Environment Variable | Description |
|---|---|---|---|---|
| `index_url` | `Union` | - | `DEVOPS_CLI_RUNS_INDEX_URL` | - |

## Tempo Configuration (`tempo`)

Grafana Tempo distributed tracing query endpoint and service addressing settings.

| Option | Type | Default | Environment Variable | Description |
|---|---|---|---|---|
| `url` | `Union` | `http://localhost:3200` | - | - |

## Pyroscope Configuration (`pyroscope`)

Grafana Pyroscope continuous profiling endpoint and service addressing settings.

| Option | Type | Default | Environment Variable | Description |
|---|---|---|---|---|
| `url` | `Union` | `http://localhost:4040` | - | - |

## Telemetry & Metrics (`telemetry`)

OpenTelemetry distributed tracing and Prometheus metric export settings.
OpenTelemetry export and Logfire settings.

| Option | Type | Default | Environment Variable | Description |
|---|---|---|---|---|
Expand All @@ -53,7 +134,7 @@ OpenTelemetry distributed tracing and Prometheus metric export settings.

## Kubernetes Configuration (`k8s`)

Kubernetes cluster connection, Minikube, Helm, and Kustomize settings.
Kubernetes context, ingress domain, and service addressing settings.

| Option | Type | Default | Environment Variable | Description |
|---|---|---|---|---|
Expand All @@ -62,6 +143,27 @@ Kubernetes cluster connection, Minikube, Helm, and Kustomize settings.
| `addressing` | `Union` | - | - | Default addressing mode for cluster services: nodeport, proxy, or fqdn. |
| `github_account` | `Union` | - | `DEVOPS_CLI_K8S_GITHUB_ACCOUNT` | Login of the machine account whose gh token `devops k8s push-secrets` writes to the cluster as GH_TOKEN; `--github-account` overrides it |

## Cloudflare Configuration (`cloudflare`)

Cloudflare API token and zone settings.

| Option | Type | Default | Environment Variable | Description |
|---|---|---|---|---|
| `domain` | `Union` | - | `DEVOPS_CLI_CLOUDFLARE_DOMAIN` | Root or zone domain name managed in Cloudflare (e.g. example.com) |
| `tunnel` | `Union` | - | `DEVOPS_CLI_CLOUDFLARE_TUNNEL` | Cloudflare tunnel name or identifier (e.g. homelab) |
| `account_id` | `Union` | - | `DEVOPS_CLI_CLOUDFLARE_ACCOUNT_ID` | Cloudflare Account ID |
| `zone_id` | `Union` | - | `DEVOPS_CLI_CLOUDFLARE_ZONE_ID` | Cloudflare Zone ID |
| `public_ip_bypass` | `Union` | - | - | Homelab public IP address or CIDR block permitted to bypass Cloudflare Access authentication |
| `access` | `CloudflareAccessConfig` | `enabled=False allowed_emails=[] idp='google' bypass_ips=[] public_ip_bypass=None` | - | Cloudflare Zero Trust Access application and policy configuration |

## Sandbox Configuration (`sandbox`)

Isolated container sandbox runtime, resource limits, and network policy settings.

| Option | Type | Default | Environment Variable | Description |
|---|---|---|---|---|
| `exclude_home_dir` | `bool` | `True` | - | Exclude user home directory entirely from sandbox access (/home/**/* and ~/**/*) |

## AI & LLM Configuration (`ai`)

AI code review, multi-agent pipelines, RAG semantic search, and embeddings.
Expand Down Expand Up @@ -96,16 +198,13 @@ AI code review, multi-agent pipelines, RAG semantic search, and embeddings.
| `durable` | `AIDurableConfig` | `engine='sqlite' store_path=PosixPath('.data/durable_runs.db') task_queue='devops-cli-tasks' workflow_id_prefix='devops-run-'` | - | - |
| `task_name` | `Union` | - | - | - |

## Qdrant Vector Store (`qdrant`)
## Open WebUI Configuration (`open_webui`)

The vector store that RAG searches query and indexing writes to.
Open WebUI endpoint, authentication, and service addressing settings.

| Option | Type | Default | Environment Variable | Description |
|---|---|---|---|---|
| `url` | `Union` | `http://localhost:6333` | `DEVOPS_CLI_QDRANT_URL` | - |
| `collection_prefix` | `str` | `devops` | `DEVOPS_CLI_QDRANT_COLLECTION_PREFIX` | - |
| `api_key` | `Union` | - | `DEVOPS_CLI_QDRANT_API_KEY` | - |
| `timeout` | `float` | `300.0` | `DEVOPS_CLI_QDRANT_TIMEOUT` | Seconds each Qdrant request waits per attempt: RAG searches, and indexing's upserts and deletes, which share the client |
| `url` | `Union` | - | - | - |

## Data Storage Tier (`data`)

Expand All @@ -126,3 +225,30 @@ Local artifact caches, review findings, session histories, and log paths.
| `tls_dir` | `Path` | `.data/tls` | `DEVOPS_CLI_DATA_TLS_DIR` | - |
| `audit_log_path` | `Path` | `.data/logs/audit.jsonl` | `DEVOPS_CLI_DATA_AUDIT_LOG_PATH` | - |
| `feedback_dataset_path` | `Path` | `.data/feedback_dataset.jsonl` | `DEVOPS_CLI_DATA_FEEDBACK_DATASET_PATH` | - |

## Service Configuration (`service`)

In-cluster webhook receiver and background job runner settings.

| Option | Type | Default | Environment Variable | Description |
|---|---|---|---|---|
| `repos` | `list` | `[]` | `DEVOPS_CLI_SERVICE_REPOS` | - |
| `machine_account` | `Union` | - | `DEVOPS_CLI_SERVICE_MACHINE_ACCOUNT` | - |
| `poll_interval_seconds` | `int` | `300` | `DEVOPS_CLI_SERVICE_POLL_INTERVAL_SECONDS` | - |
| `drain_timeout_seconds` | `int` | `120` | `DEVOPS_CLI_SERVICE_DRAIN_TIMEOUT_SECONDS` | - |

## Tavily Search Configuration (`tavily`)

Tavily web search API authentication settings.

| Option | Type | Default | Environment Variable | Description |
|---|---|---|---|---|
| `api_key` | `Union` | - | `DEVOPS_CLI_TAVILY_API_KEY` | - |

## Top-Level Settings

Top-level workstation and environment settings.

| Option | Type | Default | Environment Variable | Description |
|---|---|---|---|---|
| `domain` | `Union` | - | - | Default domain name for the environment or workstation |
9 changes: 6 additions & 3 deletions docs/ERRORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ and domain categorization for all exceptions inheriting from `DevOpsCLIError`.
An error code may be shared by a base class and its subclasses; the exception column
names the class each row describes. One code never maps to two exit statuses.

The Exit Code column is the exception's `exit_code` attribute. Only `devops cloudflare`, `devops valkey` and `devops sandbox` exit with it today; other commands exit 1 when one of these exceptions escapes.

| Exception | Error Code | Exit Code | Domain | Description |
|---|---|---|---|---|
| `AIClientError` | `LLM_INFERENCE_ERROR` | `10` | Devops_cli.ai.client.models | Raised when an AI provider request fails with a user-actionable message. |
Expand All @@ -32,7 +34,7 @@ names the class each row describes. One code never maps to two exit statuses.
| `CallDeferred` | `CALL_DEFERRED` | `18` | Ai | Raised by a tool when execution is deferred to an external worker or async system. |
| `CapabilityDegradationError` | `CAPABILITY_DEGRADATION` | `1` | Ai | Raised when a fallback or failover model breaches minimum capability tier requirements. |
| `ChaosExecutionError` | `CHAOS_EXECUTION_ERROR` | `1` | K8s | Raised when chaos engineering injection or validation fails. |
| `ChecksumMismatchError` | `ChecksumMismatchError` | `1` | Tools | Raised when downloaded tool archive SHA-256 does not match expected checksum. |
| `ChecksumMismatchError` | `CHECKSUM_MISMATCH` | `1` | Tools | Raised when downloaded tool archive SHA-256 does not match expected checksum. |
| `CloudflareAPIError` | `CLOUDFLARE_API_ERROR` | `1` | Cloudflare | Raised when a Cloudflare API call returns an error response. |
| `CloudflareAuthError` | `CLOUDFLARE_AUTH_ERROR` | `1` | Cloudflare | Raised when Cloudflare authentication or token verification fails. |
| `CloudflareError` | `CLOUDFLARE_ERROR` | `1` | Cloudflare | Base exception for Cloudflare domain errors. |
Expand Down Expand Up @@ -80,6 +82,7 @@ names the class each row describes. One code never maps to two exit statuses.
| `LibraryIngestionError` | `LIBRARY_INGESTION_ERROR` | `1` | Ai | Base exception for package introspection and library ingestion errors. |
| `LibraryNotFoundError` | `LIBRARY_NOT_FOUND_ERROR` | `1` | Ai | Raised when target package cannot be imported or found in the environment. |
| `LogfireConfigurationError` | `LOGFIRE_CONFIG_ERROR` | `1` | Telemetry | Raised when Logfire configuration fails or credentials cannot be retrieved. |
| `MemoryOperationConflictError` | `HARNESS_EXECUTION_ERROR` | `1` | Devops_cli.ai.harness.memory | Raised when an optimistic concurrency conflict or duplicate operation occurs in memory store. |
| `MemoryProfilerError` | `PROFILER_ERROR` | `1` | Devops_cli.telemetry.memory_profiler | Domain exception raised when memory profiling target resolution or execution fails. |
| `ModelAPIError` | `MODEL_API_ERROR` | `22` | Ai | Raised when a model provider API request fails. |
| `ModelBundleError` | `MODEL_BUNDLE_ERROR` | `1` | Ai | Raised when an AI model bundle cannot be located, resolved, or loaded. |
Expand Down Expand Up @@ -110,7 +113,7 @@ names the class each row describes. One code never maps to two exit statuses.
| `SandboxNotFoundError` | `SANDBOX_NOT_FOUND_ERROR` | `1` | Sandbox | Raised when requested sandbox instance or container cannot be found. |
| `SandboxPortAllocationError` | `SANDBOX_PORT_ALLOCATION_ERROR` | `1` | Sandbox | Raised when host port allocation encounters collisions or range exhaustion. |
| `SandboxValidationError` | `SANDBOX_VALIDATION_ERROR` | `1` | Sandbox | Raised when sandbox configuration or directory mount paths violate security boundaries. |
| `SecretExposureError` | `SecretExposureError` | `1` | Security | Raised when an unmasked credential or private key is detected in uncommitted diffs. |
| `SecretExposureError` | `SECRET_EXPOSURE_DETECTED` | `4` | Security | Raised when an unmasked credential or private key is detected in uncommitted diffs. |
| `SecurityError` | `SECURITY_ERROR` | `1` | Security | Base exception for all security, policy, and egress violations. |
| `ServiceAddressError` | `K8S_ERROR` | `1` | Devops_cli.k8s.service_proxy | Raised when a cluster service address cannot be resolved. |
| `ServiceNotReachableError` | `DEVOPS_CLI_ERROR` | `1` | Devops_cli.k8s.node_port | A service cannot be reached from outside the cluster. |
Expand All @@ -121,7 +124,7 @@ names the class each row describes. One code never maps to two exit statuses.
| `SuspendedResponseExpired` | `SUSPENDED_RESPONSE_EXPIRED` | `28` | Ai | Raised when resuming a suspended response whose server-side job is no longer available. |
| `TelemetryError` | `TELEMETRY_ERROR` | `1` | Telemetry | Base exception for telemetry, tracing, and metric collection errors. |
| `TemplateRenderError` | `VALIDATION_ERROR` | `1` | Devops_cli.core.templating | Raised when a template cannot be rendered into valid output. |
| `ToolDownloadError` | `ToolDownloadError` | `1` | Tools | Raised when an external tool download fails or is rejected. |
| `ToolDownloadError` | `TOOL_DOWNLOAD_ERROR` | `1` | Tools | Raised when an external tool download fails or is rejected. |
| `ToolExecutionError` | `TOOL_EXECUTION_ERROR` | `1` | Tools | Base exception for external developer tool and binary execution failures. |
| `ToolFailed` | `TOOL_FAILED` | `16` | Ai | Raised when a tool encounters an unrecoverable runtime failure without requesting model retry. |
| `TraceValidationError` | `VALIDATION_ERROR` | `1` | Devops_cli.telemetry.context | Raised when trace metadata or flags fail validation. |
Expand Down
Loading
Loading