2026-05-31 01:47:39 +00:00
# Distributor CLI
## Shortest useful command
```sh
2026-05-31 02:21:36 +00:00
go run ./cmd/distributor run --config examples/local-publish.yml
2026-05-31 01:47:39 +00:00
```
2026-05-31 04:02:09 +00:00
This discovers the example source bundle and publishes source files to `workspace/published/source-bundle` .
2026-05-31 01:47:39 +00:00
## Command overview
```sh
2026-05-31 04:02:09 +00:00
distributor [--help]
2026-05-31 01:47:39 +00:00
distributor version
2026-05-31 17:29:20 +00:00
distributor run [--config <path>] [--dry-run] [--force]
2026-05-31 04:02:09 +00:00
distributor validate <path>
distributor inspect <path>
2026-05-31 01:47:39 +00:00
```
2026-05-31 04:02:09 +00:00
- `version` : prints the application name and version. Development builds print `distributor dev` .
2026-05-31 16:53:37 +00:00
- `run` : loads a YAML config, discovers source bundles, plans each configured destination, writes selected outputs unless `--dry-run` is set, and prints a final status summary.
2026-05-31 04:02:09 +00:00
- `validate` : validates a local source bundle directory or a local tree containing source bundles.
- `inspect` : validates local source bundles and prints normalized bundle metadata.
2026-05-31 01:47:39 +00:00
2026-05-31 17:11:53 +00:00
`validate` and `inspect` accept local paths only. `run` executes `local` , `ssh` , and `s3` backends.
2026-05-31 01:47:39 +00:00
## Flag reference
2026-05-31 04:02:09 +00:00
Root command:
2026-05-31 01:47:39 +00:00
2026-05-31 04:02:09 +00:00
- `--help` , `-h` , or `help` : print root help.
2026-05-31 01:47:39 +00:00
2026-05-31 04:02:09 +00:00
All subcommands:
2026-05-31 01:47:39 +00:00
- `--help` , `-h` : print command-specific help.
2026-05-31 01:53:13 +00:00
2026-05-31 04:02:09 +00:00
`run` flags:
- `--config <path>` : config file to load. If omitted, `run` uses `/usr/local/etc/distributor/config.yml` .
2026-05-31 14:33:17 -05:00
- `--dry-run` : load config, discover bundles, inspect destination state, print planned actions and final status, and do not write output files, destination state, or SSH `known_hosts` entries.
2026-05-31 17:29:20 +00:00
- `--force` : allow explicit destructive replacement for supported conflict cases in this run only.
2026-05-31 01:53:13 +00:00
2026-05-31 04:02:09 +00:00
`run` does not accept positional arguments. `validate` and `inspect` accept at most one path; omitting the path returns a required-path error.
2026-05-31 01:53:13 +00:00
## Common workflows
2026-05-31 02:07:30 +00:00
Validate a source bundle:
```sh
go run ./cmd/distributor validate examples/source-bundle
```
Inspect a source bundle:
```sh
go run ./cmd/distributor inspect examples/source-bundle
```
2026-05-31 02:21:36 +00:00
Preview local publication without writing:
```sh
go run ./cmd/distributor run --config examples/local-publish.yml --dry-run
```
2026-05-31 04:02:09 +00:00
Publish the local source example:
2026-05-31 01:53:13 +00:00
```sh
2026-05-31 02:21:36 +00:00
go run ./cmd/distributor run --config examples/local-publish.yml
2026-05-31 01:53:13 +00:00
```
2026-05-31 02:28:48 +00:00
Publish the local HTML example:
```sh
go run ./cmd/distributor run --config examples/local-html.yml
```
2026-05-31 04:02:09 +00:00
2026-05-31 04:03:26 +00:00
Preview local fan-out publication:
```sh
go run ./cmd/distributor run --config examples/fan-out.yml --dry-run
```
2026-05-31 17:29:20 +00:00
Preview a forced replacement before publishing:
```sh
go run ./cmd/distributor run --config <config-path> --dry-run --force
```
2026-05-31 04:02:09 +00:00
## Output
2026-05-31 17:17:49 +00:00
`run` prints the number of configured pipelines, one line per pipeline, one line per planned destination action, and a final status line. Destination action lines include the bundle path, destination id, destination backend, action, outputs, and reason. Actions include:
2026-05-31 04:02:09 +00:00
- `publish_new` : destination has no managed state and is empty.
- `replace_older` : destination state is older than the source manifest.
2026-05-31 17:29:20 +00:00
- `force_replace` : `--force` requested a supported destructive replacement.
2026-05-31 04:02:09 +00:00
- `skip_same` : destination state already matches the source manifest.
- `skip_destination_newer` : destination state is newer than the source manifest.
- `error` : planning or execution failed for that destination.
The command exits non-zero if any destination fails. Independent later destinations are still attempted.
2026-05-31 17:29:20 +00:00
The final status line includes counters for `publish_new` , `replace_older` , `force_replace` , skipped destinations, failures, and whether the run was a dry run.
2026-05-31 04:02:09 +00:00
## Diagnostics
Use `validate` before publication when a producer has written a new bundle. Use `inspect` to confirm normalized ids, timestamps, digests, file paths, and file sizes.
For symptom-oriented recovery steps, see [troubleshooting ](troubleshooting.md ). For destination state and retry behavior, see [operations ](operations.md ). For config fields and defaults, see [configuration ](config.md ).