Skip to main content

Creed Space CLI — validate creeds, constitutions, and VCP tokens

Project description

creed-space-cli

PyPI Python License

creed is a command-line validator for Creed Space artifacts: creeds, constitutions, and VCP tokens. It runs locally and in CI, needs no authentication, and speaks JSON for machine consumption. Think terraform validate or gh, but for values declarations.

Install

pip install creed-space-cli

# With the optional guardian passthrough (pulls in the creed-guardian runtime):
pip install creed-space-cli[guardian]

Requires Python 3.10+. Inside the Creed Space monorepo it is available as python -m creed_cli (or poetry run creed) without a separate install; from a source checkout, pip install ./vcp-sdk-python ./creed_cli.

Command surface

creed --version
creed --help
creed validate <path|dir|string>...  [--type auto|creed|constitution|vcp-lite|vcp-token|csm1]
                                      [--format text|json] [--strict] [--quiet]
creed score <creed-file>...          [--min-score N] [--format text|json]
creed vcp validate <token-or-file>   # VCP token / CSM1 code / VCP-Lite JSON (auto-detected)
creed vcp parse <token-or-csm1>      # pretty-print the parsed structure
creed constitution lint <path|dir>... [--format text|json]
creed guardian <argv...>             # passthrough to the creed-guardian runtime

validate is the umbrella command. It auto-detects artifact type:

  • *.creed.md / *.creedcreed
  • .json / .yaml matching the constitution shape, or files under a constitutions/ directory → constitution
  • vcp:-prefixed or CSM1-patterned strings, and .vcp files → VCP

Directories recurse over known extensions. An input you name explicitly on the command line that can't be classified is an error (exit 1) — you meant to validate it. An unrecognised file merely discovered while recursing a directory is skipped, so unrelated files (READMEs, configs) don't break a run. --strict promotes every unknown, discovered or not, to a failure — use it in CI when you want nothing to slip through unvalidated. Pass --type to override detection.

Exit codes

Every command uses the same convention (also printed in creed --help):

Code Meaning
0 all inputs valid
1 validation findings (at least one artifact failed)
2 usage error / missing input
3 internal error

creed guardian preserves the exit code of the underlying creed-guardian process, so guardian's own status codes propagate unchanged.

JSON output contract

--format json emits a stable, versioned document (schema version "1"):

{
  "schema_version": "1",
  "results": [
    {
      "path": "data/constitutions/_source/example.yaml",
      "artifact_type": "constitution",
      "status": "failed",
      "findings": [
        {"severity": "error", "code": "SCHEMA",
         "message": "...", "location": "$.rules[3]"}
      ]
    }
  ],
  "summary": {"checked": 12, "passed": 11, "failed": 1, "skipped": 0}
}
  • status is one of passed, failed, skipped.
  • severity is error or warning; code is a stable machine token.
  • Parse the top-level summary for a quick pass/fail count; drive gating logic off the process exit code.

Guardian passthrough

creed guardian <argv...> forwards every argument verbatim to the creed-guardian runtime:

creed guardian --help          # prints creed-guardian's help
creed guardian proxy --port 9090
creed guardian serve
creed guardian mcp

If creed-guardian is not installed, creed guardian prints an install hint (pip install creed-space-cli[guardian]) and exits 2 rather than crashing.

CI recipes

GitHub Actions

# .github/workflows/creed-validate.yml
name: creed validate
on: [push, pull_request]

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - run: pip install creed-space-cli
      - name: Validate constitutions
        run: creed constitution lint data/constitutions/_source --format json
      - name: Gate creed quality
        run: creed score creeds/*.creed.md --min-score 70

The step fails the job automatically when creed exits non-zero.

pre-commit

# .pre-commit-config.yaml
repos:
  - repo: local
    hooks:
      - id: creed-validate
        name: creed validate
        entry: creed validate
        language: python
        additional_dependencies: ["creed-space-cli"]
        files: '\.(creed\.md|creed)$|constitutions/.*\.(json|ya?ml)$'
        pass_filenames: true

pass_filenames: true hands the staged, matching files to creed validate; the commit is blocked when validation reports findings.

Related

  • docs/CREED_CLI.md — architecture and design overview.
  • Creed Guardian Quick Start — the local safety runtime behind creed guardian.

Project details


Download files

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

Source Distribution

creed_space_cli-0.1.2.tar.gz (57.5 kB view details)

Uploaded Source

Built Distribution

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

creed_space_cli-0.1.2-py3-none-any.whl (61.5 kB view details)

Uploaded Python 3

File details

Details for the file creed_space_cli-0.1.2.tar.gz.

File metadata

  • Download URL: creed_space_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 57.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for creed_space_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 fbd68611c5d1d26fb49d6a4b6db00b15e4660c721479bd8a8565e25b8f84b294
MD5 c116feab754f44d279dc256696399285
BLAKE2b-256 8226a9a18aca814d628ee1a8a6d7580b7913b7498916f3e07651c1e3c86fbfc0

See more details on using hashes here.

File details

Details for the file creed_space_cli-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for creed_space_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 00626edc41938d7cba12a7121d655dbdbb09563b7ad2166899038c2477081408
MD5 6f2c490668713a79f893253d278abac5
BLAKE2b-256 9dc5a2c701a148274c97b00dbe03d07340eb98ec9889a7b2760df4bd4f6854d1

See more details on using hashes here.

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