cli reference to help with the development of constructor fabric gears framework. It helps with the development of the framework from its initialization, adding/removing gears, modifying configuration files, build and/or run project, lint the project and managing applications through its manifest. Always load this skill whenever you detect Gears.toml or you locate a reference to gears, cargo-gears, gears-toolkit, gears, plugins or packages that include the prefix cf- in its name.
cargo add, do not edit Cargo.toml manuallyThe crate exposes a single entrypoint:
cargo gears] Cargo subcommand form via the cargo-gears binaryExample:
cargo gears generate workspace /tmp/my-appThis CLI is a tool for automating gears development, a Rust framework. You can get more information about it in:
Clone(shallow) the repo to .gears folder (create it if it doesn't exist), and use it as a reference. If so, prefer to use the ssh version instead of https to avoid authentication issues.
cargo gears
├── generate
│ ├── workspace
│ ├── gear
│ └── config
├── new
├── config
│ ├── mod
│ │ ├── add
│ │ ├── db
│ │ │ ├── add
│ │ │ ├── edit
│ │ │ └── rm
│ │ └── rm
│ └── db
│ ├── add
│ ├── edit
│ └── rm
├── src
├── help
│ ├── schema
│ ├── src
│ └── topic
├── lint
├── ls
│ ├── gears
│ ├── templates
│ ├── features
│ ├── deps
│ ├── packages
│ └── targets
├── manifest
│ ├── validate
│ └── ls
├── test
├── tools
│ └── check-version
├── run
├── build
├── clean
└── deploy-p, --path <PATH>] Optional workspace path. When provided to config ..., build, run, deploy, lint,
and test, relative config paths, manifest paths, generated project locations, and workspace-scoped lint/test resolution use
that directory as the workspace root. When omitted, the current working directory is used as the workspace root.-c, --config <PATH>] Config file path. This is required for config ... and deploy commands because there is
no default. build and run no longer accept --config; they compose their generation inputs from Gears.toml
and forward the manifest-declared runtime config path through the GEARS_CONFIG environment variable.--manifest <PATH>] Gears manifest path, defaulting to Gears.toml, for manifest, build, run,
lint, and test.
For manifest, you can combine this with -p/--path to resolve relative manifest paths from a selected workspace.--app <APP> --env <ENV>] Selects a manifest app/environment for manifest-driven build, run, lint, and test.
When omitted, inferred from the manifest: a single app is used automatically; with multiple apps the command
fails listing available names. For environments, dev is selected by default if it exists; otherwise the
command fails listing available names.--name <NAME>] For build and run, overrides the generated server project and binary name that would
otherwise default to the config filename stem.-v, --verbose] Usually enables more logging or richer output.-, and _.From the current implementation, the CLI is mainly for:
workspace.generated-dir directory
(default .gears/<name>/)Gears.toml to separate generation metadata from runtime YAML configrustup, cargofmt, and clippygenerateGenerate workspace, module, and config scaffolding from built-in templates or explicit local/Git template sources.
generate workspaceSynopsis:
cargo gears generate workspace [<path>] [--template <TEMPLATE>] [--list] [--verbose] [--name <NAME>] [--local-path <PATH>] [--git <URL>] [--subfolder <NAME>] [--branch <NAME>] [--override]Arguments:
<path>] Target directory to initialize; not required with --list-t, --template <TEMPLATE>] Workspace template name, defaults to basic-init; default is accepted as a compatibility alias-l, --list] List built-in workspace templates plus manifest templates.workspace entries when a Gears.toml exists at the selected path-v, --verbose] Verbose output from cargo-generate-n, --name <NAME>] Override the generated project name; inferred from the final path segment by default--local-path <PATH>] Use a local template directory instead of the default Git template--git <URL>] Override the Git URL for the template--subfolder <NAME>] Override the template subfolder--branch <NAME>] Override the template branch--override] Allow generated files to overwrite existing filesBehavior:
<path> already exists and is not a directory--name is
providedExamples:
cargo gears generate workspace /tmp/cf-democargo gears generate workspace /tmp/cf-demo --git https://github.com/constructorfabric/cf-template-rust --branch main --subfolder Initcargo gears generate workspace /tmp/cf-demo --local-path ~/dev/cf-template-rustcargo gears generate workspace --listgenerate gearGenerate a gear template inside an existing workspace's gears/ directory and wire Cargo workspace dependencies.
Synopsis:
cargo gears generate gear [--template <TEMPLATE>] [--list] [--name <NAME>] [--path <PATH>] [--verbose] [--local-path <PATH>] [--git <URL>] [--subfolder <NAME>] [--branch <NAME>]Available built-in templates:
background-worker] Background worker module templateapi-db-handler] API/database handler module templateapi-gateway] API gateway module template. Unless the user instruct to implement its own api-gateway, prefer the system module cf-api-gatewayArguments:
-t, --template <TEMPLATE>] Gear template name; not required with --list-l, --list] List built-in gear templates plus manifest templates.gear entries when a Gears.toml exists at the selected path-n, --name <NAME>] Generated gear folder/crate name; defaults to the template name. Prefer passing this when
the generated gear should use the user's chosen name.-p, --path <PATH>] Workspace root, defaults to .-v, --verbose] Verbose template generation output--local-path <PATH>] Use a local template directory instead of the default Git template--git <URL>] Override the Git URL for the template--subfolder <NAME>] Override the template subfolder--branch <NAME>] Override the template branchBehavior:
gears/] Fails unless <workspace>/gears already existsgears/<name>] Uses --name when provided, otherwise the template nameworkspace.membersworkspace.dependenciesworkspace = truelints.workspace = true to generated modules if neededsdk/, it is also added as a workspace memberExamples:
cargo gears generate gear --template background-worker -p /tmp/cf-democargo gears generate gear --template background-worker --name jobs -p /tmp/cf-democargo gears generate gear --template rest-api -p /tmp/cf-democargo gears generate gear --list -p /tmp/cf-demogenerate configGenerate a runtime YAML config file from a built-in template.
Synopsis:
cargo gears generate config --template <dev|prod|db> [--app <APP>] [--env <ENV>] [--name <NAME>] [--path <PATH>]Built-in templates:
dev] Development-friendly runtime configprod] Production-oriented runtime configdb] Development config with a database.servers.main sectionArguments:
-t, --template <TEMPLATE>] Config template name--app <APP>] Application name used for output filename--env <ENV>] Environment name used for output filename--name <NAME>] Custom output filename; .yml is appended when no YAML extension is provided-p, --path <PATH>] Workspace root, defaults to .Behavior:
config/] Output path is <workspace>/config/<filename>--name wins; otherwise <app>-<env>.yml, <app>.yml, <env>.yml, or <template>.ymlExamples:
cargo gears generate config --template dev --app app1 --env dev -p /tmp/cf-democargo gears generate config --template db --name local-db -p /tmp/cf-demonewAlias for generate workspace.
Synopsis:
cargo gears new <path> [--template <TEMPLATE>] [--verbose] [--name <NAME>] [--local-path <PATH>] [--git <URL>] [--subfolder <NAME>] [--branch <NAME>] [--override]configManages the YAML application config file used by build and run.
There are two branches:
config mod ...] Module configurationconfig db ...] Global database server configurationconfig modManage the modules section in the app config.
config mod addAdd or update a module entry in the config file's modules section.
Synopsis:
cargo gears config mod add -c <CONFIG> [-p <PATH>] [--package <NAME>] [--module-version <VER>] [--default-features <BOOL>] [-F, --feature <FEATURES>]... [--dep <NAME>]... <module>Arguments:
<module>] Module name in the config-c, --config <CONFIG>] Required config file path-p, --path <PATH>] Optional workspace directory--package <NAME>] Override metadata package name--module-version <VER>] Override metadata version--default-features <BOOL>] Persist Cargo default_features-F, --feature <FEATURES>] Feature list; accepts comma-separated values and can be repeated--dep <NAME>] Metadata dependency name; repeat to add moreBehavior:
modules.<module>-p/--path is provided, Clap changes the current working directory while parsing that value,
before -c/--config is resolved--package and --module-versionExamples:
cargo gears config mod add background-worker -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.ymlcargo gears config mod add api-gateway -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml -F json,metrics -F tracing --dep authn-resolver --dep tenant-resolvercargo gears config mod add credstore -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml --package cf-credstore --module-version 0.4.2cargo gears config mod add api-db-handler -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml --default-features falseconfig mod rmRemove a module from the config file's modules section.
Synopsis:
cargo gears config mod rm -c <CONFIG> [-p <PATH>] <module>Behavior:
-p/--path is provided, Clap changes the current working directory while parsing that value,
before -c/--config is resolvedExample:
cargo gears config mod rm background-worker -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.ymlconfig mod dbManage module-level database config under modules.<module>.database.
Subcommands:
add] Add or patch a module DB configedit] Edit an existing module DB configrm] Remove a module DB configShared DB flags:
--engine <postgres|mysql|sqlite>]--dsn <DSN>]--host <HOST>]--port <PORT>]--user <USER>]--password <PASSWORD>]--dbname <NAME>]--params <K=V,...>]--sqlite-file <FILE>]--sqlite-path <PATH>]--pool-max-conns <N>]--pool-min-conns <N>]--pool-acquire-timeout-secs <SECS>]--pool-idle-timeout-secs <SECS>]--pool-max-lifetime-secs <SECS>]--pool-test-before-acquire <BOOL>]--server <NAME>] Reference a named global DB serverRules:
-p/--path is provided, each subcommand changes the current working directory while Clap is
parsing that value, before -c/--config is resolvedadd and edit require at least one DB-related fieldadd requires the module already exist in config and recommends config mod add firstedit fails if no module DB config exists yetadd and edit patch only the fields you provideExamples:
cargo gears config mod db add background-worker -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml --server primarycargo gears config mod db add api-db-handler -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml --engine postgres --host localhost --port 5432 --user app --password '${DB_PASSWORD}' --dbname appdb --pool-max-conns 20cargo gears config mod db edit api-db-handler -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml --pool-acquire-timeout-secs 30 --pool-test-before-acquire truecargo gears config mod db rm api-db-handler -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.ymlconfig dbManage global database server config under database.servers.
Subcommands:
add] Add or upsert a named global DB serveredit] Edit an existing global DB serverrm] Remove an existing global DB serverSynopsis:
cargo gears config db add -c <CONFIG> [-p <PATH>] <name> <db-flags...>
cargo gears config db edit -c <CONFIG> [-p <PATH>] <name> <db-flags...>
cargo gears config db rm -c <CONFIG> [-p <PATH>] <name>Behavior:
-p/--path is provided, each subcommand changes the current working directory while Clap is
parsing that value, before -c/--config is resolveddatabase.servers.<name>add creates or patches an existing server entryedit requires the server to already existadd and edit require at least one DB-related fieldrm removes the top-level database section if it becomes empty and auto_provision is unsetExamples:
cargo gears config db add primary -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml --engine postgres --host localhost --port 5432 --user app --password '${DB_PASSWORD}' --dbname appdbcargo gears config db edit primary -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml --pool-max-conns 30 --pool-idle-timeout-secs 120cargo gears config db add local-sqlite -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml --engine sqlite --sqlite-path /tmp/cf-demo/dev.dbcargo gears config db rm primary -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.ymlsrcResolve Rust source for a crate/module/item query from local workspace metadata, the local source cache, or crates.io.
Synopsis:
cargo gears src [--path <PATH>] [--registry <REGISTRY>] [--verbose] [--libs] [--version <VERSION>] [--clean] [<query>]Arguments:
-p, --path <PATH>] Workspace or crate to inspect, defaults to .--registry <REGISTRY>] Registry fallback, defaults to crates.io-v, --verbose] Print resolution metadata before the source-l, --libs] Print library_name -> package_name mappings for a package query instead of source--version <VERSION>] Resolve a specific crate version after metadata/cache lookup misses--clean] Remove the source cache for the selected registry before resolving[<query>]] Rust path to resolve, starting with the package name; omitted only when --clean is used by itselfSupported query examples:
cf-gears-toolkit]tokio::sync]cf-gears-toolkit::gts::plugin::BaseGearsPluginV1]cf-gears-toolkit::gts::schemas::get_core_gts_schemas]Behavior:
--clean is passed by itself--libs requires a package-only query such as cf-gears-toolkit--version pins the registry/cache fallback to that exact crate versioncrate, self, super, and dependency boundaries
until it reaches the final source--libs prints the Rust source-code library name on the left and the Cargo package
name on the right, including renamed dependencies like gears_toolkit_macros -> cf-gears-toolkit-macrosgears-docs-cache/<registry>/ (legacy name)--clean removes the selected registry cache before resolutioncrates.io is supported todayExamples:
cargo gears src -p /tmp/cf-demo cf-gears-toolkitcargo gears src cf-gears-toolkit::modulecargo gears src --verbose tokio::synccargo gears src --libs cf-gears-toolkitcargo gears src --version 1.0.217 serde::de::Deserializecargo gears src --cleancargo gears src --clean -p /tmp/cf-demo tokio::synchelpSchema, topic, and source-code help for developers and LLMs. Groups three subcommands under a single discoverable entry point.
help schemaPrint the schema for manifest, config, or module formats.
Synopsis:
cargo gears help schema <manifest|config|module> [--section <SECTION>]Arguments:
<target>] Schema target: manifest, config, or module--section <SECTION>] Drill into a specific section of the schemaBehavior:
--section, prints a top-level overview of the schema--section, prints detailed field documentation for that sectionworkspace, apps, templatesserver, database, logging, opentelemetry, modulesExamples:
cargo gears help schema manifestcargo gears help schema config --section databasecargo gears help schema modulehelp srcAlias for the top-level src command. Resolves Rust source code from a crate.
Synopsis:
cargo gears help src [--path <PATH>] [--registry <REGISTRY>] [--verbose] [--libs] [--version <VERSION>] [--clean] [<query>]Behavior identical to src; see the src section above.
help topicPrint operational documentation for a named topic.
Synopsis:
cargo gears help topic <TOPIC>Available topics:
architecture] Framework architecture, three-tier hierarchy, and principlescli] CLI reference, guidelines, and command overviewclienthub] Typed ClientHub, plugins, and GTSdatabase] SecureConn, transactions, migrations, and repository patternerrors] RFC-9457 Problem error handlingfips] FIPS mode activation and usagegear-layout] Gear directory structure and SDK patterngear-refs] How local and remote gears are referencedgears-catalog] Gear categories and dependency rulesgenerated-server] How the ephemeral generated server project workslifecycle] Gear lifecycle, cancellation, and background tasksmanifest] Overview of Gears.toml and manifest-driven workflowsotel] OpenTelemetry activation and runtime configurationrest-api] OperationBuilder, OpenAPI, SSE, and ODatasecurity] AuthN, AuthZ, SecureConn, and AccessScopeExamples:
cargo gears help topic architecturecargo gears help topic gear-layoutcargo gears help topic generated-servercargo gears help topic oteltoolsInstall or upgrade a small set of Rust tooling dependencies.
Known tool names:
rustup]cargofmt] Installs the rustfmt rustup componentclippy]Synopsis:
cargo gears tools (--all | --install <tool,...>) [--upgrade] [--yolo] [--verbose]Arguments:
-a, --all] Select all known tools--install <tool,...>] Comma-separated tool names-u, --upgrade] Upgrade instead of initial install-y, --yolo] Skip confirmation prompts-v, --verbose] Show subprocess outputBehavior:
--all or --install--yolo, the command prompts before installing/upgradingrustup is missing, the CLI can attempt to install itcargofmt and clippy are installed through rustup component addrustup upgrades via rustup self update; selected components upgrade via
rustup updateExamples:
cargo gears tools --allcargo gears tools --install clippy,cargofmt --yolocargo gears tools --install rustup,clippy --upgrade --verbosetools check-versionCheck that an external tool satisfies a semver version requirement by running <tool> --version,
parsing the version from the output, and comparing it against the requirement. Exits 0 (printing
the version) if satisfied, or 1 if not.
Synopsis:
cargo gears tools check-version <TOOL> <REQUIREMENT>Arguments:
<TOOL>] Tool binary name (e.g. cargo-deny, cargo-nextest)<REQUIREMENT>] Semver requirement (e.g. >=0.20.0, ^0.9.130)Behavior:
<tool> --version and parses the first semver token from stdoutExamples:
cargo gears tools check-version cargo-deny '>=0.20.0'cargo gears tools check-version cargo-nextest '^0.9.130'runGenerate a server project under the manifest <workspace.generated-dir>/<name> and run it.
Synopsis:
cargo gears run [--app <APP>] [--env <ENV>] [--manifest <Gears.toml>] [-p <PATH>] [--name <NAME>] [--watch|--no-watch] [--otel|--no-otel] [--fips|--no-fips] [--release|--no-release] [--locked] [--clean|--no-clean] [--dry-run]Arguments:
--manifest <PATH>] Manifest file, defaults to Gears.toml--app <APP> --env <ENV>] Manifest app/environment selection (inferred from manifest if omitted)-p, --path <PATH>] Optional workspace directory--name <NAME>] Override the generated server project and binary name; defaults to the config filename stem-w, --watch / --no-watch] Override manifest watch policy on or off--otel / --no-otel] Override manifest OpenTelemetry policy on or off--fips / --no-fips] Override manifest FIPS policy on or off-r, --release / --no-release] Override manifest build profile to release or non-release--locked] Require Cargo.lock is up to date; passed as --locked to cargo run--clean / --no-clean] Override manifest clean policy on or off--dry-run] Generate the project structure and print the generated files without building or runningBehavior:
<app>-<env>-p/--path is provided, Clap changes the current working directory while parsing that value,
before Gears.toml is resolved and the generated project directory is created<generated-dir>/<name>/Cargo.toml,
<generated-dir>/<name>/.cargo/config.toml, and <generated-dir>/<name>/src/main.rs; generated-dir comes from
manifest workspace.generated-dir and defaults to .gearssrc/main.rs reads the config path from GEARS_CONFIG, and
cargo gears run sets that environment variable automatically before invoking cargo run--dry-run writes the generated project structure under <generated-dir>/<name>/ and prints JSON with the
generated project directory plus each generated file path and contents; it does not invoke Cargo build/runGears.toml; runtime YAML
stays focused on server configuration--otel --no-otel is rejected. When neither side is present, the manifest policy is used.cargo run in <generated-dir>/<name>/Cargo.toml or the selected Gears.toml changesrun.watch.include replaces the default watch set; run.watch.exclude removes matching
paths from either the default set or an explicit include setcargo gears run, you must set GEARS_CONFIG manuallyExamples:
cargo gears run -p /tmp/cf-demo --app app1 --env devcargo gears run -p /tmp/cf-demo --app app1 --env dev --watchcargo gears run -p /tmp/cf-demo --app app1 --env dev --otel --fips --release --cleancargo gears run -p /tmp/cf-demo --app app1 --env dev --name demo-servercargo gears run -p /tmp/cf-demo --app app1 --env dev --dry-runcargo gears run -p /tmp/cf-demo --app app1 --env dev --manifest /tmp/cf-demo/Gears.tomlmanifestInspect and validate Gears manifest files.
Synopsis:
cargo gears manifest [-p <PATH>] [--manifest <Gears.toml>] validate [--format table|json]
cargo gears manifest [-p <PATH>] [--manifest <Gears.toml>] ls [--format table|json]Behavior:
-p/--path is provided, relative manifest paths are resolved from that workspace directory.gears key.build --dry-run or run --dry-run to write and print the generated project structure.buildGenerate a server project under the manifest <workspace.generated-dir>/<name> and build it.
Synopsis:
cargo gears build [--app <APP>] [--env <ENV>] [--manifest <Gears.toml>] [-p <PATH>] [--name <NAME>] [--otel|--no-otel] [--fips|--no-fips] [--release|--no-release] [--locked] [--clean|--no-clean] [--dry-run]Arguments:
--manifest <PATH>] Manifest file, defaults to Gears.toml--app <APP> --env <ENV>] Manifest app/environment selection (inferred from manifest if omitted)-p, --path <PATH>] Optional workspace directory--name <NAME>] Override the generated server project and binary name; defaults to the config filename stem--otel / --no-otel] Override manifest OpenTelemetry policy on or off--fips / --no-fips] Override manifest FIPS policy on or off-r, --release / --no-release] Override manifest build profile to release or non-release--locked] Require Cargo.lock is up to date; passed as --locked to cargo build--clean / --no-clean] Override manifest clean policy on or off--dry-run] Generate the project structure and print the generated files without buildingBehavior:
<app>-<env>-p/--path is provided, Clap changes the current working directory while parsing that value,
before Gears.toml is resolved and the generated project directory is created--clean --no-clean is rejected. When neither side is present, the manifest policy is used.Gears.toml
instead of runtime YAML module metadatacargo build in <generated-dir>/<name>/GEARS_CONFIG when you execute it--dry-run writes the generated project structure under <generated-dir>/<name>/ and prints JSON with the
generated project directory plus each generated file path and contents; it does not invoke Cargo buildGEARS_CONFIG yourselfExamples:
cargo gears build -p /tmp/cf-demo --app app1 --env devcargo gears build -p /tmp/cf-demo --app app1 --env dev --releasecargo gears build -p /tmp/cf-demo --app app1 --env dev --otel --fips --cleancargo gears build -p /tmp/cf-demo --app app1 --env dev --name demo-servercargo gears build -p /tmp/cf-demo --app app1 --env prodcargo gears build -p /tmp/cf-demo --app app1 --env prod --dry-runcleanSuperset of cargo clean: removes build artifacts, the generated server project, and its workspace member entry
from the root Cargo.toml.
Synopsis:
cargo gears clean [--app <APP>] [--env <ENV>] [--manifest <Gears.toml>] [-p <PATH>]Arguments:
--manifest <PATH>] Manifest file, defaults to Gears.toml--app <APP> --env <ENV>] Manifest app/environment selection (inferred from manifest if omitted)-p, --path <PATH>] Optional workspace directoryBehavior:
cargo clean first] Removes build artifacts from the workspace target/ directory. If this fails due to
a broken workspace (e.g. missing generated member), the error is ignored and cleanup continues -- fixing such
broken state is the purpose of this command. Other cargo clean failures (permissions, disk errors, etc.) are
propagated as errors.Gears.toml to determine the generated project directory and name
without resolving module dependencies or running cargo metadata<generated-dir>/<name>/ (e.g. .gears/products-dev/)workspace.members array in the root
Cargo.toml.gears/) is empty after removal, it is also
deletedcargo clean last] After fixing the workspace, runs cargo clean to remove build artifacts from the
target/ directory. By running last, the workspace is guaranteed to be consistent so cargo clean succeeds
even when the generated member was previously missing or broken.clean when the generated project does not exist is a no-opExamples:
cargo gears cleancargo gears clean --app app1 --env devcargo gears clean -p /tmp/cf-demodeployBuild a Docker image for the generated or provided server manifest.
Synopsis:
cargo gears deploy [--app <APP>] [--env <ENV>] [--manifest <Gears.toml>] [-p <PATH>] [-t <TAG>] [-m <Cargo.toml>] [-c <CONFIG>] [--debug] [--dockerfile <PATH>] [--args <KEY=VALUE>]...Arguments:
-p, --path <PATH>] Optional workspace directory used to resolve relative manifest paths--manifest <PATH>] Gears manifest file, defaults to Gears.toml--app <APP> --env <ENV>] Manifest app/environment selection (inferred from manifest if omitted)-t, --tag <TAG>] Tag for the Docker image; defaults to gears:<version>-m, --manifest <Cargo.toml>] Optional Cargo manifest override; when omitted, uses the auto-resolved
generated project's Cargo.toml from the selected app/env-c, --config <CONFIG>] Optional config file override; when omitted, uses the config resolved from
the Gears.toml manifest--debug] Docker build mode; defaults to release mode. Use this flag to build in debug mode.--dockerfile <PATH>] Dockerfile path to use instead of the default (Dockerfile from workspace root)--args <KEY=VALUE>] Dockerfile ARG override passed as docker build --build-arg; repeat for multiple
overridesBehavior:
Gears.toml, auto-selecting when there is
only one app/env. The generated project's Cargo.toml and config path are derived automatically.-m/--manifest, uses the provided Cargo.toml instead of the auto-resolved one;
its package.name is used as the artifact name-c/--config, uses the provided config path instead of the manifest-resolved oneDockerfile is missing from the selected workspace root, writes the shared CLI
Dockerfile there before running DockerBUILDER_MANIFEST, BUILD_MODE, ARTIFACT_NAME, LOCAL_CONFIG_PATH, and
CONFIG_EXT; repeated --args values are appended afterward so they can override Dockerfile argumentsExamples:
# Deploy using Gears.toml auto-selection (single app/env)
cargo gears deploy -p /tmp/cf-demo# Deploy a specific app/env
cargo gears deploy --app myapp --env dev -t my-app:latest# Deploy in debug mode
cargo gears deploy --app myapp --env dev --debug# Deploy with an explicit Cargo manifest override
cargo gears deploy --app myapp --env dev -m .gears/custom-server/Cargo.toml# Deploy with extra Docker build args
cargo gears deploy --app myapp --env dev --args BUILDER_FLAGS="--features metrics"lintRun workspace linting helpers from the selected workspace directory.
Synopsis:
cargo gears lint [--app <APP>] [--env <ENV>] [--manifest <Gears.toml>] [-p <PATH>] [--all] [--fmt] [--clippy] [--strict] [--dylint] [-P <SPEC>]... [--gear <NAME>]... [--include-dependents] [-F <FEATURES>]... [--all-features | --no-default-features] [--locked] [--list]Arguments:
-p, --path <PATH>] Optional workspace directory used to resolve relative manifest paths--manifest <PATH>] Manifest file, defaults to Gears.toml--app <APP> --env <ENV>] Manifest app/environment selection (inferred from manifest if omitted)--all] Runs all available lint suites instead of the selected manifest lint policy--fmt] Runs cargo fmt --check for the selected package scope; with no -P/--package or --gear, it uses
--all. If passed by itself, it runs only formatting checks.--clippy] Runs workspace Clippy checks; if passed by itself, it runs only Clippy--strict] Turns Clippy warnings into errors; valid only when Clippy is selected explicitly or through --all--dylint] Runs the embedded cargo-gears-lints Dylint rules against the workspace rooted at the current or selected
directory-P, --package <SPEC>] Restricts formatting, Clippy, and Dylint to the given workspace package(s); repeatable.
Supports Cargo package ID specifications and package-name globs such as cf-gears-*. When omitted together with
--gear, the whole workspace is linted.--gear <NAME>] Restricts formatting, Clippy, and Dylint to the local workspace package(s) belonging to a
discovered gear; repeatable. Includes the conventional nested gear SDK package. Use cargo gears ls gears --local to
list valid names. Can be combined with -P/--package.--include-dependents] Expands the -P/--package and --gear selection to also include every workspace crate
that (transitively) depends on the selected package(s) — the reverse-dependency closure. Requires at least one package
or gear selection; otherwise the command fails.-F, --features <FEATURES>] Enables Cargo features for Clippy and Dylint. Accepts comma-separated values and is
repeatable. Default features remain enabled unless --no-default-features is also passed.--all-features] Enables every Cargo feature. Conflicts with --features and --no-default-features.--no-default-features] Disables Cargo default features. May be combined with --features.--locked] Requires Cargo.lock to be up to date; passed to Clippy and Dylint's cargo check.--list] Lists available lint rules instead of running them. When combined with --dylint, lists only the
embedded dylint rules. Does not require a manifest or workspace path.Behavior:
-p/--path is provided, relative manifest paths are resolved from that workspace directoryGears.toml app/environment and runs from the resolved
manifest workspace rootlint runs the selected manifest lint policy--fmt, --clippy, and/or --dylint opts into just those
requested lint suites unless --all is also provided--fmt runs cargo fmt --check --all when no package or gear is selected. With an
explicit package/gear scope, it passes each effective package as --package <SPEC>. --include-dependents expands
this scope before formatting, matching Clippy and Dylint.cargo clippy --workspace --all-targets, or as
cargo clippy --package <SPEC> ... --all-targets when one or more -P/--package flags are supplied. Cargo feature
flags are appended when selected. Without feature flags, each package's default features are used. Manifest
feature-set-test remains reserved for future feature-matrix linting and is not currently applied.--strict is rejected unless Clippy is active through --clippy or --all-p/--path is the way to lint
another workspace without manually changing directories-P/--package <SPEC> flags restricts formatting, Clippy, and Dylint
to those packages instead of the whole workspace; the flag is repeatable and supports Cargo package ID specifications
plus package-name globs. A bare * intentionally selects every workspace package while remaining an explicit scope.--gear <NAME> is resolved through local workspace gear discovery to its annotated
package and conventional nested SDK workspace package, when present. Gear-derived packages are merged and
de-duplicated with explicit -P/--package selections. System registry gears that are not local workspace members
cannot be selected.--include-dependents, the selected packages are expanded to their reverse-dependency
closure (the seed packages plus every workspace crate that depends on them) before formatting, Clippy, and Dylint run,
so a change to a crate can be linted together with everything it may break. Unknown package names are rejected.--features, --all-features, and --no-default-features use Cargo's standard feature
semantics and apply to both Clippy and Dylint. Package-qualified features such as crate-name/feature-name can be used
when linting multiple workspace packages.lint.dylint.skip entries are passed to Dylint as allowed rustc lints, so
listed rules are ignored for that lint run--list prints available lints grouped by category and exits without running any checks.
--list --dylint prints only the embedded dylint rules. --list alone prints all lint suites plus the dylint rules.Examples:
cargo gears lint --app app1 --env devcargo gears lint --app app1 --env dev --clippy --strictcargo gears lint --app app1 --env dev --fmtcargo gears lint --app app1 --env dev --fmt --gear file-parsercargo gears lint --app app1 --env dev --dylintcargo gears lint -p /tmp/cf-demo --app app1 --env dev --dylintcargo gears lint --app app1 --env dev --clippy --package cf-gears-file-parsercargo gears lint --app app1 --env dev --dylint -P cf-gears-file-parser -P cf-gears-file-parser-sdkcargo gears lint --app app1 --env dev --dylint --gear file-parsercargo gears lint --app app1 --env dev --clippy --gear file-parser --include-dependentscargo gears lint --app app1 --env dev --clippy -P shared-utils --gear file-parsercargo gears lint --app app1 --env dev --clippy -P cf-gears-file-parser --include-dependentscargo gears lint --app app1 --env dev --clippy -P cf-gears-file-parser --features json,otelcargo gears lint --app app1 --env dev --dylint -P cf-gears-file-parser --no-default-features -F sqlitecargo gears lint --app app1 --env dev --clippy -P cf-gears-file-parser --all-featurescargo gears lint --list --dylintcargo gears lint --listManifest Dylint skip example:
[apps.app1.dev.lint]
dylint = { enabled = true, skip = ["de0301_no_infra_in_domain"] }lsInspect workspace gears, system gears, templates, features, dependencies, and packages.
ls gearsList all gears — both system-registry and workspace-discovered — in a single unified view.
Synopsis:
cargo gears ls gears [-p <PATH>] [--system] [--local] [--verbose] [--registry crates.io] [--format table|json|list|cargo-flags] [--filter <REGEX>] [--dirs <DIR,...>] [--include-rdeps]Arguments:
-p, --path <PATH>] Optional workspace directory used for local gear discovery--system] Only print built-in system registry gears--local] Only print workspace-discovered gears-v, --verbose] Show full metadata for both system and local gears (fetches registry metadata for system
gears)--registry <REGISTRY>] Registry to query for system-crate metadata; defaults to crates.io-f, --format <FORMAT>] Output format; defaults to json. Supported values: table, json, list,
cargo-flags--filter <REGEX>] Filter gear names by regex pattern. Applied before --include-rdeps--dirs <DIR,...>] Comma-separated directory paths (relative to workspace root) to restrict results
to gears whose crate directory is under one of the given directories. Applied before --include-rdeps--include-rdeps] After filtering/scoping, expand the result set with every workspace crate that
transitively depends on the matched gears (reverse-dependency closure)Behavior:
--system prints only system gears; --local prints only workspace gears; passing both is
equivalent to the default combined output--format json prints a modules array with each gear's source (system or local), static
metadata, and verbose metadata when --verbose is enabledused: yes/no in table output and used: true/false in JSON output,
based on whether Gears.toml references the system gear as a remote module or the workspace has a discovered gear
with the same name-c/--config filecargo metadata --no-deps and discovers crates with a gears annotation
(#[toolkit::gear(...)]) in any src/**/*.rs file--verbose fetches crate metadata from the
selected registry--format cargo-flags prints -p <package> flags suitable for passing to Cargo commands--include-rdeps then expands that set with reverse dependentsExamples:
cargo gears ls gearscargo gears ls gears -p /tmp/cf-demo --verbosecargo gears ls gears --localcargo gears ls gears --system --verbosecargo gears ls gears --local --filter 'api-.*' --include-rdepscargo gears ls gears --local --dirs gears/api -f cargo-flagsls templatesList all available generation templates.
Synopsis:
cargo gears ls templates [-p <PATH>]Arguments:
-p, --path <PATH>] Optional workspace directory used to find Gears.toml; defaults to .Behavior:
templates.workspace and templates.gear entries when Gears.toml
exists at the selected path-c/--config fileExamples:
cargo gears ls templatescargo gears ls templates -p /tmp/cf-demols featuresList all feature names defined in a Cargo.toml's [features] section.
Synopsis:
cargo gears ls features --manifest <PATH> [-f <FORMAT>]Arguments:
--manifest <PATH>] Path to the Cargo.toml to inspect-f, --format <FORMAT>] Output format; defaults to list. Supported values: list, table, json,
cargo-flagsBehavior:
--format cargo-flags prints features as a comma-separated list suitable for
--features <LIST>Examples:
cargo gears ls features --manifest gears/api-gateway/Cargo.tomlcargo gears ls features --manifest Cargo.toml -f jsonls depsList dependency names from a Cargo.toml's [dependencies] section.
Synopsis:
cargo gears ls deps --manifest <PATH> [--non-optional] [-f <FORMAT>]Arguments:
--manifest <PATH>] Path to the Cargo.toml to inspect--non-optional] Only list non-optional (always-linked) dependencies-f, --format <FORMAT>] Output format; defaults to list. Supported values: list, table, json,
cargo-flagsBehavior:
package field from the dependency table when present, otherwise uses the key name--format cargo-flags prints -p <package> flagsExamples:
cargo gears ls deps --manifest gears/api-gateway/Cargo.tomlcargo gears ls deps --manifest Cargo.toml --non-optional -f jsonls packagesList all Cargo packages (crates) in the workspace or under specific directories, with optional filtering and reverse-dependency expansion.
Synopsis:
cargo gears ls packages [-p <PATH>] [--dirs <DIR,...>] [--filter <REGEX>] [--include-rdeps] [-f <FORMAT>]Arguments:
-p, --path <PATH>] Optional workspace directory--dirs <DIR,...>] Comma-separated directory paths to restrict discovery to crates under those directories
(relative to workspace root)--filter <REGEX>] Filter package names by regex pattern. Applied before --include-rdeps--include-rdeps] After filtering/scoping, expand the result set with every workspace crate that transitively
depends on the matched packages (reverse-dependency closure)-f, --format <FORMAT>] Output format; defaults to list. Supported values: list, table, json,
cargo-flagsBehavior:
--dirs, lists all workspace packages--dirs, only packages whose manifest path is inside one of the given directories
are included--include-rdeps expands
the filtered set--format cargo-flags prints -p <package> flagsExamples:
cargo gears ls packages -p /tmp/cf-democargo gears ls packages -p /tmp/cf-demo --dirs gears/apicargo gears ls packages --filter 'cf-gears-.*' --include-rdepscargo gears ls packages --filter 'api' --include-rdeps -f cargo-flagstestOrchestrates manifest-driven Rust tests with either cargo test or the in-process nextest runner.
Synopsis:
cargo gears test [-p <PATH>] [--manifest <PATH>] [--app <APP>] [--env <ENV>] [--runner <cargo|nextest>] [--module <NAME>] [--include-dependents] [--coverage] [--locked]Arguments:
--runner <cargo|nextest>] Overrides the manifest test.runner; defaults to nextest that it's integrated in the tool--module <NAME>] Limits tests to a module/package. When manifest test.feature-set contains that module, its feature matrix is used.--include-dependents] Also tests every workspace crate that (transitively) depends on --module — the reverse-dependency closure. Requires --module; has no effect on its own.--coverage] Runs coverage with cargo llvm-cov using the selected or manifest test runner--locked] Require Cargo.lock is up to date; passed as --locked to cargo test, nextest build, and cargo llvm-covBehavior:
GEARS_CONFIGcargo test with --workspace by default, or -p <package> for module-specific runscargo-nextestcargo, runs each selected module/feature-set through cargo llvm-cov --no-report --no-clean, then reports once with cargo llvm-cov reportnextest, uses cargo llvm-cov show-env, runs the embedded nextest runner under the coverage environment for every selected module/feature-set, then reports once with cargo llvm-cov reporttest.feature-set module entries by mode: all-features uses --all-features, no-default-features uses --no-default-features, default-features uses Cargo defaults, and features uses --no-default-features --features <LIST>--module <NAME> --include-dependents, the resolved package is expanded to its reverse-dependency closure and each additional dependent crate is added as a default-feature test run (de-duplicated against runs already produced by the feature-set policy)cargo gears {new|generate workspace} /tmp/cf-demo
cargo gears generate module --template background-worker -p /tmp/cf-demo
cargo gears generate config --template dev --app app1 --env dev -p /tmp/cf-demo
cargo gears config mod add background-worker -p /tmp/cf-demo -c /tmp/cf-demo/config/app1-dev.yml
cargo gears run -p /tmp/cf-demo --app app1 --env devcargo gears generate module --template api-db-handler -p /tmp/cf-demo
cargo gears config db add primary -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml --engine postgres --host localhost --port 5432 --user app --password '${DB_PASSWORD}' --dbname appdb
cargo gears config mod add api-db-handler -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml
cargo gears config mod db add api-db-handler -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml --server primary
cargo gears run -p /tmp/cf-demo --app app1 --env dev --watchcargo gears src --verbose tokio::sync-c/--config is mandatory] For config ... and deploy; build and run use Gears.toml insteadGEARS_CONFIG] cargo gears run sets it for you, but manual execution of
generated project directory or its compiled binary must provide it explicitlylint --dylint needs the feature build] Without the dylint-rules feature enabled, it currently reaches
an errorlint --strict depends on Clippy] Use it together with --clippy or --alltest is not ready] It is part of the CLI surface but currently panics at runtimetools can mutate your system] It may install rustup or rustup componentssrc --registry] Only crates.io is supportedsrc] Accepts a single query, and that query is only optional when --clean is used by itselfconfig mod add] Remote modules require both --package and --module-versionconfig mod db add] The module must already exist in configcargo gears {new|generate workspace} <path> [--template <template>] [--name <name>]
cargo gears generate module --template <background-worker|api-db-handler|api-gateway> [--name <name>] [-p <workspace>]
cargo gears generate config --template <dev|prod|db> [--app <app>] [--env <env>] [--name <name>] [-p <workspace>]
cargo gears config mod add <module> [-p <workspace>] -c <config>
cargo gears config mod rm <module> [-p <workspace>] -c <config>
cargo gears config mod db add <module> [-p <workspace>] -c <config> ...
cargo gears config mod db edit <module> [-p <workspace>] -c <config> ...
cargo gears config mod db rm <module> [-p <workspace>] -c <config>
cargo gears config db add <name> [-p <workspace>] -c <config> ...
cargo gears config db edit <name> [-p <workspace>] -c <config> ...
cargo gears config db rm <name> [-p <workspace>] -c <config>
cargo gears ls gears [-p <workspace>] [--system] [--local] [--verbose] [--registry crates.io] [-f table|json|list|cargo-flags] [--filter <regex>] [--dirs <dirs>] [--include-rdeps]
cargo gears ls templates [-p <workspace>]
cargo gears ls features --manifest <Cargo.toml> [-f list|json|cargo-flags]
cargo gears ls deps --manifest <Cargo.toml> [--non-optional] [--dev] [--build] [-f list|json|cargo-flags]
cargo gears ls packages [-p <workspace>] [--dirs <dirs>] [--filter <regex>] [--include-rdeps] [-f list|json|cargo-flags]
cargo gears ls targets --manifest <Cargo.toml> [-f list|json|cargo-flags]
cargo gears src [-p <path>] [--version <version>] [--clean] [<query>]
cargo gears lint [-p <workspace>] [--app <app>] [--env <env>] [--manifest <Gears.toml>] [--all] [--fmt] [--clippy] [--strict] [--dylint] [-P <spec>]... [--gear <name>]... [--include-dependents] [-F <features>]... [--all-features | --no-default-features] [--locked] [--list]
cargo gears tools --all
cargo gears tools check-version <tool> '<requirement>'
cargo gears run [-p <workspace>] [--app <app>] [--env <env>] [--manifest <Gears.toml>] [--name <name>] [--watch] [--locked]
cargo gears build [-p <workspace>] [--app <app>] [--env <env>] [--manifest <Gears.toml>] [--name <name>] [--locked]
cargo gears deploy [--app <app>] [--env <env>] [-p <workspace>] [-t <tag>] [-m <Cargo.toml>] [-c <config>] [--debug] [--args <KEY=VALUE>]...038e74f
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.