/gaia-config-distribution
user-facingWhat it does
/gaia-config-distribution edits the distribution section of .gaia/config/project-config.yaml. This section defines how the project is published to a registry or marketplace -- the distribution channel, registry URL, manifest path, and optional release workflow. The editor preserves all YAML comments and formatting outside the edited section.
The distribution channel must be one of the closed 10-channel registry: claude-marketplace, npm, pypi, maven, homebrew, github-releases, mobile-app, container-registry, static-site, custom.
All writes go through a diff-preview confirmation gate before anything is written. Pre-write validation enforces schema compliance, path canonicalization, shell-metacharacter rejection, and URL-shape validation.
When to use it
- You are setting up a new project for distribution and need to add the
distributionsection. - You want to change the distribution channel, registry, manifest, or release workflow.
- You want to view or remove the current distribution configuration.
Prerequisites
- project-config.yaml must exist. Run
/gaia-initto create one if missing.
How to invoke
/gaia-config-distribution show
/gaia-config-distribution add --channel npm --registry https://registry.npmjs.org --manifest package.json --release-workflow release.yml
/gaia-config-distribution set --channel pypi --registry https://upload.pypi.org/legacy/
/gaia-config-distribution clear
What it does step by step
- Locate project-config.yaml Resolves the configuration file path via the canonical resolver.
- Dispatch subcommand
add-- add a freshdistribution:block. Refuses when one already exists (usesetinstead). Requires four fields:--channel,--registry,--manifest,--release-workflow. Some channels require additional sub-fields.show-- print the currentdistribution:block, or "(no distribution section)" when absent.set-- update one or more fields of an existing section. Refuses when no section exists (useaddinstead).clear-- remove the entiredistribution:block.
- Pre-write validation For
addandset: validates channel against the 10-channel enum, canonicalizes the manifest path, checks the registry URL shape, and rejects shell metacharacters in all string fields. If all environments are deployable and--forceis not set, refuses the write. - Diff preview and confirmation Shows a unified diff of what will change. You must confirm before anything is written.
- Atomic write Writes only the modified section through the comment-preserving YAML editor.
- Post-write verification Re-extracts the section and confirms the round-trip parses correctly.
Inputs
| Input | Source | Description |
|---|---|---|
| Project configuration | .gaia/config/project-config.yaml | The file containing the distribution section. |
--channel | Flag | One of the 10 closed-registry channels. |
--registry | Flag | HTTPS registry URL. |
--manifest | Flag | Relative path to the version manifest (e.g., package.json). |
--release-workflow | Flag | Name or relative path of the release workflow. |
--force | Flag (optional) | Override the all-deployable-environments gate. |
Outputs
| Output | Location | Description |
|---|---|---|
| Updated distribution section | .gaia/config/project-config.yaml | The modified distribution block (comment-preserving). |
Example session
> /gaia-config-distribution show
(no distribution section)
> /gaia-config-distribution add \
--channel claude-marketplace \
--registry https://marketplace.claude.ai \
--manifest plugin.json \
--release-workflow release.yml
Diff preview:
+ distribution:
+ channel: claude-marketplace
+ registry: https://marketplace.claude.ai
+ manifest: plugin.json
+ release_workflow: release.yml
Apply this edit? [y/n]
> y
distribution section added. Run /gaia-config-validate to verify.
What to run next
/gaia-config-validate-- validate the modified configuration file./gaia-publish-- the Phase 5 publish command that consumes this configuration./gaia-config-show distribution-- view the section after editing.
Troubleshooting
distribution section already exists
The add subcommand refuses when a distribution: block already exists. Use set to update individual fields instead.
no distribution section
The set and clear subcommands refuse when no distribution: block exists. Use add to create one first.
distribution typically pairs with branch-only or distribution-only environments
All your environments resolve to kind: deployable. Set at least one environment to non-deployable first, or pass --force to override this gate.
Schema validation failed
The proposed changes did not pass schema validation. Check channel-specific required sub-fields: mobile-app requires --platform, --store-id, --review-required; container-registry requires --image-name, --tag-strategy; and so on.
Shell metacharacter rejected
String fields must not contain ;, &&, ||, |, backtick, $(, >, <, or newline. Remove these characters from the value.