Skip to content
Open
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
16 changes: 16 additions & 0 deletions documentation/cli/00_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,19 @@ Specifies the path to Leo program root folder. Defaults to `./`.

#### `--home <HOME>`
Specifies the path to the `.aleo` program registry. This is where programs downloaded from the network will be cached. Defaults to `~/.aleo/registry`.

#### `--json-output[=<PATH>]`
Saves structured JSON output to disk.

- **Default location**: `build/json-outputs/<command>.json`
- **Custom path**: `--json-output=my-results.json`

Supported commands: `deploy`, `upgrade`, `run`, `execute`, `test`, `query`, `synthesize`.

```bash title="Examples"
# Save to default location (build/json-outputs/run.json)
leo run --json-output main 1u32 2u32

# Save to custom path
leo execute main --json-output=my-results.json
```
29 changes: 29 additions & 0 deletions documentation/cli/06_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,35 @@ Once it is deployed, it CANNOT be changed.

See the **[Deploying](./../guides/03_deploying.md)** guide for more details.

### JSON Output

Use `--json-output` to save structured JSON results to disk for programmatic use:

```bash
# Save to default location (build/json-outputs/deploy.json)
leo deploy --json-output -y

# Save to custom path
leo deploy --json-output=deployment_result.json -y
```

Example output (`build/json-outputs/deploy.json`):
```json
{
"deployments": [
{
"program_id": "my_program.aleo",
"transaction_id": "at1..."
}
]
}
```

This is useful for scripting and CI/CD pipelines:
```bash
# Deploy and extract the transaction ID
jq '.deployments[0].transaction_id' build/json-outputs/deploy.json
```

### Flags:

Expand Down