Skip to main content

Crate distributed_cli

Crate distributed_cli 

Source
Expand description

The dctl CLI for Distributed services — both a binary and a library.

It bundles two things in one crate so there is no cross-repo coordination:

  • Pure generation (the [generate]/[atlas] modules): the rules for a Distributed service project — Cargo layout, Rust source templates, manifest wiring, GitOps/Knative inference, GitHub workflows, and Atlas schema resources. These perform no I/O — generate_service_scaffold takes a ServiceScaffoldSpec and returns a GeneratedProject; render_atlas_schema wraps desired-state SQL into an AtlasSchema.
  • The command surface (the [cli] module): the clap types and run dispatcher that own the filesystem / process side effects (writing files, running gh, compiling the manifest harness).

The dctl binary parses ServiceArgs and calls run. Another CLI (e.g. hops) can depend on this crate, mount ServiceArgs under its own subcommand, and dispatch with run — re-exporting the commands rather than reimplementing them.

Structs§

AtlasSchemaSpec
Input for render_atlas_schema. Plain data — the caller maps its flags onto this and supplies the desired-state schema SQL.
DescribeArgs
EmbeddedFile
One file of an embedded skill, addressed relative to the skill’s folder.
EmbeddedSkill
A skill embedded in the binary at compile time.
GeneratedFile
A single generated file: a relative path and its contents.
GeneratedProject
The result of generating a scaffold: the files to write, advisory warnings, and side effects for the caller to perform. Filesystem-agnostic.
GithubRepo
An owner/repo GitHub identifier.
ScaffoldArgs
ScaffoldError
A scaffold generation error (bad spec value).
SchemaArgs
ServiceArgs
ServiceScaffoldSpec
What to scaffold. The pure input to generate_service_scaffold.
SkillsArgs
SkillsInitArgs
SkillsInitSpec
What to generate. The pure input to generate_skills. All paths in the output are relative to the anchor — the parent of the skills container — which is where .claude/, .agents/, and AGENTS.md belong.

Enums§

AgentHarness
Which agent harnesses to wire. codex/grok/openai/gemini/pi are aliases for agents — they all discover .agents/skills/ — and exist so users can name their tool.
AtlasDatabaseUrl
How the generated AtlasSchema reaches its target database URL.
Bus
BusTarget
Message bus backend to scaffold.
FileMode
File mode hint for a GeneratedFile.
Framework
GitopsPromote
GitopsPromoteTarget
GitOps promotion flavor.
ManifestFormat
Metrics
MetricsTarget
Metrics integration to scaffold.
PostCreateAction
A side effect the caller should perform after writing the generated files.
SchemaDialect
SchemaFormat
ServiceCommands
ServiceTransport
Runtime transport for the scaffolded service.
SkillsCommands
Store
StoreTarget
Read-model / schema storage target.
Transport

Functions§

embedded_skills
The registry of skills embedded in this binary.
generate_service_scaffold
Generate a Distributed service project from a spec. The public entry point.
generate_skills
Generate every entry skills init should write: the canonical <container>/skills/ tree, a per-skill symlink (or copy fallback) at each wired harness location, and the merged AGENTS.md. No I/O — the caller owns writes and per-file drift decisions.
package_name
Normalize a free-form service name to its kebab-case package/crate directory name — the same normalization generate_service_scaffold applies. Callers need this to compute a default output directory before generating.
render_atlas_schema
Render an AtlasSchema (db.atlasgo.io/v1alpha1) resource as YAML.
run
Dispatch a parsed service command. The dctl binary and any host CLI (e.g. hops service) both call this.