CLI utilities for csrd service generation and feature augmentation
Project description
csrd-utils
CLI and runtime helpers for generating csrd services and augmenting existing services with optional features.
Install
pip install "csrd-utils @ git+https://github.com/csrd-api/fastapi-common.git#subdirectory=packages/utils"
CLI
csrd --help
csrd --version
csrd new service # compact interactive mode (prompts 1-6, then advanced gate)
csrd new service --interactive --name items # pre-fills name prompt with 'items'
csrd new service --name inventory --no-interactive --output .
csrd new cluster --spec ./cluster.yaml --output .
csrd new cluster # interactive cluster builder (preset + service prompts)
csrd feature list
csrd feature plan workers --service .
csrd feature plan workers --service . --json
csrd feature add workers --service .
csrd doctor --service .
feature plan --json is useful for CI or tooling wrappers.
Interactive generation behavior
csrd new serviceruns a compact interactive flow by default (core prompts 1-6), then asks whether to show advanced options.- In compact mode, advanced options are hidden by default.
csrd new service --interactiveruns the full verbose interactive flow.- Passing
--name <value>in interactive mode uses that value as the name prompt default. - You can still overwrite the default by entering a different value at the prompt.
- Use
--no-interactivefor fully flag-driven generation. - Database default is
none. - All yes/no prompts default to
No(y/N).
Typical workflow
# 0) Generate a new service from bundled template
csrd new service --name inventory --output . --database postgres --workers
# 1) Verify service compatibility
csrd doctor --service ./inventory
# 2) Inspect available bundled features
csrd feature list
# 3) Dry-run a feature
csrd feature plan workers --service ./inventory
# 4) Apply feature files/merges
csrd feature add workers --service ./inventory
Bundled assets
features/workers/feature manifests and fragmentstemplates/cookiecutter-service/template starter
Python API
from pathlib import Path
from csrd_utils import ServiceAugmentor
from csrd_utils.resources import features_path
with features_path() as feature_lib:
augmentor = ServiceAugmentor(Path("."), feature_lib)
ok, changes = augmentor.add_feature("workers", plan=True)
Documentation
docs/CLI_REFERENCE.md- full command/flag referencedocs/FEATURES.md- bundled feature catalog and behaviordocs/AGENT_SMOKE_TESTS.md- copy/paste validation flow for clean workspacesdocs/COMMAND_MATRIX.yaml- machine-readable command matrix for automationAGENTS.md- package-local rules for autonomous agents
CLI-only agent mode
If an agent can only see the installed CLI (not source files), use this exploration sequence:
csrd --help
csrd new --help
csrd new cluster --help
csrd feature --help
csrd doctor --help
csrd feature list
Then run a clean smoke flow:
mkdir -p /tmp/csrd-smoke
cd /tmp/csrd-smoke
csrd new service --name demo-svc --output . --no-interactive
cd demo-svc
csrd doctor
csrd feature plan workers
csrd feature add workers
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file csrd_utils-0.3.9.tar.gz.
File metadata
- Download URL: csrd_utils-0.3.9.tar.gz
- Upload date:
- Size: 26.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
045ef772e5549ab52e1cba06ec6b182d201ebf0e1c5d6554cfa7a8c42bae2cff
|
|
| MD5 |
5da53eef62998304a0dec7699b0196c4
|
|
| BLAKE2b-256 |
f8d894092ee18bafc84af91d9b5325cca96eca57ff5a208caf910a6e7453dcf1
|
Provenance
The following attestation bundles were made for csrd_utils-0.3.9.tar.gz:
Publisher:
release.yml on csrd-api/fastapi-common
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
csrd_utils-0.3.9.tar.gz -
Subject digest:
045ef772e5549ab52e1cba06ec6b182d201ebf0e1c5d6554cfa7a8c42bae2cff - Sigstore transparency entry: 1421243357
- Sigstore integration time:
-
Permalink:
csrd-api/fastapi-common@80c238ee109b00f95b23c18541b7107c48fc91ed -
Branch / Tag:
refs/tags/v0.3.9 - Owner: https://github.com/csrd-api
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@80c238ee109b00f95b23c18541b7107c48fc91ed -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file csrd_utils-0.3.9-py3-none-any.whl.
File metadata
- Download URL: csrd_utils-0.3.9-py3-none-any.whl
- Upload date:
- Size: 42.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a942f4546b23e1e584e0436a3f97ac57bd93f52b25203c6461392af920bd6961
|
|
| MD5 |
5bf083e119b6f6f0c6a7ff31236c86ae
|
|
| BLAKE2b-256 |
cf9c71d162790e7a5aece8c02e46a8bf200a923350c056af5bf9b7625b90f455
|
Provenance
The following attestation bundles were made for csrd_utils-0.3.9-py3-none-any.whl:
Publisher:
release.yml on csrd-api/fastapi-common
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
csrd_utils-0.3.9-py3-none-any.whl -
Subject digest:
a942f4546b23e1e584e0436a3f97ac57bd93f52b25203c6461392af920bd6961 - Sigstore transparency entry: 1421244792
- Sigstore integration time:
-
Permalink:
csrd-api/fastapi-common@80c238ee109b00f95b23c18541b7107c48fc91ed -
Branch / Tag:
refs/tags/v0.3.9 - Owner: https://github.com/csrd-api
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@80c238ee109b00f95b23c18541b7107c48fc91ed -
Trigger Event:
workflow_dispatch
-
Statement type: