# CLI Usage

The `orxaq` command-line interface provides access to all Orxaq operations.

## Global Flags

| Flag | Description |
|------|-------------|
| `--json` | Output machine-readable JSON instead of human-readable text |

## Commands

### Status

```bash
orxaq status
```

Shows DAG summary (entity count, edge count), recent audit entries, and system health.

### Credit Risk

```bash
# Show the 19-variable credit ontology
orxaq credit ontology --show

# Compute CECL expected credit loss
orxaq credit ecl

# Fair lending analysis for a protected attribute
orxaq credit fairness --protected age
```

### Causal Discovery

```bash
# Discover structure using PC algorithm
orxaq discover --variables unemployment_rate,income,credit_score

# Use multi-algorithm consensus
orxaq discover --consensus --variables unemployment_rate,income,credit_score
```

### Validation

```bash
orxaq validate
```

Runs d-separation tests against the World DAG and reports violations.

### Data Fabric

```bash
orxaq fabric quality
```

Runs quality gates on synthetic data and reports pass/fail for each gate.

### Audit

```bash
# Show all audit entries
orxaq audit

# Show last 5 entries
orxaq audit --last 5
```

### Dashboard

```bash
# Launch on default port (8741)
orxaq serve

# Launch on custom port
orxaq serve --port 9000
```

## JSON Mode

Add `--json` before the subcommand for structured output:

```bash
orxaq --json status
orxaq --json credit ecl
orxaq --json validate
orxaq --json audit
```

JSON output is the data contract between the CLI and the Gamma Observatory dashboard (ADR-023).
