Skip to main content

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                                  # interactive prompts
csrd new service --interactive --name items       # pre-fills name prompt with 'items'
csrd new service --name inventory --no-interactive --output .
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 service runs interactive prompts by default.
  • 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-interactive for fully flag-driven generation.

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 fragments
  • templates/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 reference
  • docs/FEATURES.md - bundled feature catalog and behavior
  • docs/AGENT_SMOKE_TESTS.md - copy/paste validation flow for clean workspaces
  • docs/COMMAND_MATRIX.yaml - machine-readable command matrix for automation
  • AGENTS.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 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

This version

0.3.6

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

csrd_utils-0.3.6.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

csrd_utils-0.3.6-py3-none-any.whl (37.6 kB view details)

Uploaded Python 3

File details

Details for the file csrd_utils-0.3.6.tar.gz.

File metadata

  • Download URL: csrd_utils-0.3.6.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for csrd_utils-0.3.6.tar.gz
Algorithm Hash digest
SHA256 aaa1c5837c48407f8d516a2f2b7526ff81ee584b1b6c6fd50ddc3de510911530
MD5 5e67249bdf03ae6f285049613735ff0d
BLAKE2b-256 e200bd4854087992636418bf188d1af36c0b58680c2802189d44cae2b6f60ae5

See more details on using hashes here.

Provenance

The following attestation bundles were made for csrd_utils-0.3.6.tar.gz:

Publisher: release.yml on csrd-api/fastapi-common

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file csrd_utils-0.3.6-py3-none-any.whl.

File metadata

  • Download URL: csrd_utils-0.3.6-py3-none-any.whl
  • Upload date:
  • Size: 37.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for csrd_utils-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5e7a7689dc0ac8466c8a00cf57f2d2137cba16450603b6e8eab69017db09e3b8
MD5 c28531327b6fff5f1af6d1423c4b6ff9
BLAKE2b-256 66f1d24f9b2fac5f541669bbea415e59e55c04cc7ce2e35590b83b9575521ff1

See more details on using hashes here.

Provenance

The following attestation bundles were made for csrd_utils-0.3.6-py3-none-any.whl:

Publisher: release.yml on csrd-api/fastapi-common

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page