Prophet ontology tooling CLI
Project description
prophet-cli
prophet-cli is the tooling package for Prophet's ontology workflow:
- Parse DSL (path configured via
project.ontology_file) - Validate model semantics
- Build canonical IR (
.prophet/ir/current.ir.json) including versionedquery_contracts - Generate deterministic artifacts (
gen/sql,gen/openapi,gen/turtle,gen/migrations,gen/spring-boot,gen/node-express,gen/python) - Check compatibility against baseline IR
Main project repository:
Install
From PyPI:
python3 -m pip install --upgrade prophet-cli
prophet --help
From source (editable):
From repo root:
python3 -m venv .venv --system-site-packages
.venv/bin/pip install --no-build-isolation -e ./prophet-cli
Run via venv script:
.venv/bin/prophet --help
Commands
prophet init
Creates starter prophet.yaml and internal .prophet directories.
prophet init
prophet validate
Parses + validates ontology references, IDs, states/transitions, action contracts, list types, and action/event/trigger links.
prophet validate
prophet plan
Computes deterministic file changes without writing files.
prophet plan
prophet plan --show-reasons
prophet plan --json
prophet check
Runs a CI-style gate in one command:
- ontology validation
- generated output cleanliness check
- compatibility/version-bump check against baseline IR
prophet check
prophet check --show-reasons
prophet check --json
prophet check --against .prophet/baselines/main.ir.json
--json emits structured diagnostics for CI bots and automation.
prophet stacks
Lists supported stack ids, framework/ORM pairings, implementation status, and capability metadata. Entries come from a schema-validated stack manifest. Schema reference:
- user-facing: docs/reference/generation.md
- developer-facing: docs/developer/codegen-architecture.md
prophet stacks
prophet stacks --json
prophet hooks
Lists generated extension hook surfaces from gen/manifest/extension-hooks.json.
Useful for wiring user-owned implementations against generated interfaces.
Safety/reference docs:
prophet hooks
prophet hooks --json
prophet generate / prophet gen
Writes generated artifacts and current IR.
prophet generate
prophet gen
prophet gen --skip-unchanged
Also syncs generated Spring artifacts into examples/java/prophet_example_spring when present.
Stack selection is configured in prophet.yaml:
generation:
stack:
id: java_spring_jpa
Generator implementations are available for all declared stack ids:
java_spring_jpanode_express_prismanode_express_typeormnode_express_mongoosepython_fastapi_sqlalchemypython_fastapi_sqlmodelpython_flask_sqlalchemypython_flask_sqlmodelpython_django_django_ormAllowedgeneration.stackkeys are:id,language,framework,orm.
Equivalent tuple form is also supported:
generation:
stack:
language: java
framework: spring_boot
orm: jpa
Default generated targets:
sqlopenapispring_bootflywayliquibasemanifest(generated file ownership + hashes)
Optional cross-stack target:
turtle->gen/turtle/ontology.ttl
Turtle output details:
- emits
prophet.ttl-aligned triples (prophet:+std:vocabularies) - local namespace prefix is derived from ontology name
- custom type constraints are emitted as SHACL
NodeShaperesources - conformance can be checked with
pyshacl(see docs/reference/turtle.md)
When baseline IR differs from current IR, Prophet also emits delta migration artifacts:
gen/migrations/flyway/V2__prophet_delta.sqlgen/migrations/liquibase/prophet/0002-delta.sqlgen/migrations/delta/report.json
Delta SQL includes safety flags and warnings (destructive, backfill_required, manual_review) as comments.
Delta report JSON includes:
summarycounts (safe_auto_apply_count,manual_review_count,destructive_count)- structured
findingsentries with classification and optional suggestions - heuristic rename hints (
object_rename_hint,column_rename_hint) for manual migration planning
Generated ownership manifest:
gen/manifest/generated-files.json- includes stack metadata and deterministic hashes for generated outputs
Generated extension hook manifest:
gen/manifest/extension-hooks.json- lists generated extension points (for example action handler interfaces + default classes)
Spring runtime migration wiring is auto-detected from the host Gradle project:
- if Flyway dependency/plugin is present, Prophet syncs Flyway resources
- if Liquibase dependency/plugin is present, Prophet syncs Liquibase resources
- if neither is present, migration files are still generated under
gen/migrations/**but not auto-wired into Spring runtime resources
prophet gen --wire-gradle
Auto-wires the current Gradle project as a multi-module setup:
- adds
:prophet_generatedinsettings.gradle.kts/settings.gradle - maps it to
gen/spring-boot - adds app dependency
implementation(project(\":prophet_generated\"))inbuild.gradle.kts
prophet gen --wire-gradle
Wiring is idempotent (safe to run repeatedly).
prophet generate --verify-clean
CI mode. Fails if committed generated files differ from current generation.
prophet generate --verify-clean
prophet gen --skip-unchanged
Skips no-op regeneration when the current config + IR signature matches the last successful generation cache.
- cache file:
.prophet/cache/generation.json - ignored when
--wire-gradleis used - incompatible with
--verify-clean
prophet gen --skip-unchanged
prophet clean
Removes generated artifacts from current project.
Default removals:
gen/.prophet/ir/current.ir.json.prophet/cache/generation.jsonsrc/main/java/<base_package>/<ontology_name>/generatedsrc/main/resources/application-prophet.ymlsrc/main/resources/schema.sql(only if it looks generated)src/main/resources/db/migration/V1__prophet_init.sql(if generated)src/main/resources/db/migration/V2__prophet_delta.sql(if generated)src/main/resources/db/changelog/**Prophet-managed generated files, including0002-delta.sql- Gradle multi-module wiring for
:prophet_generatedinsettings.gradle(.kts)andbuild.gradle(.kts)
prophet clean
prophet clean --verbose
prophet clean --remove-baseline
prophet clean --keep-gradle-wire
prophet version check
Compares current IR against baseline and reports compatibility + required bump.
prophet version check --against .prophet/baselines/main.ir.json
Compatibility rules used by CLI are documented in:
Expected Project Files
prophet.yaml<your ontology file>(configured inproject.ontology_file).prophet/baselines/main.ir.json.prophet/ir/current.ir.json(generated)gen/(generated)
DSL Notes
- Field types support scalars, custom types, object refs (
ref(User)), lists (string[],list(string)), and reusablestructtypes. - Nested list types are supported (for example
string[][],list(list(string))). - Description metadata supports both
description "..."anddocumentation "...". - Object keys support field-level and object-level declarations:
key primarykey primary (fieldA, fieldB)(composite)key display (fieldA, fieldB)(lookup/index hint)
- SQL/Flyway/Liquibase generation emits a non-unique
idx_<table>_displayindex when an explicit display key is declared and it is not identical to the primary key columns. - Node Prisma and Mongoose generation also emits non-unique display-key indexes.
- Generated Java record component order follows DSL field declaration order.
- Actions are not auto-implemented; generated endpoints call handler beans.
- Generated action services (
generated.actions.services.*) are the API boundary used by controllers. - Default generated services delegate to handler beans; generated default handler stubs throw
UnsupportedOperationExceptionuntil user handlers are provided.
Config (prophet.yaml)
Required keys currently used by CLI:
project:
ontology_file: path/to/your-ontology.prophet
generation:
out_dir: gen
targets: [sql, openapi, turtle, spring_boot, flyway, liquibase]
spring_boot:
base_package: com.example.prophet
boot_version: 3.3
compatibility:
baseline_ir: .prophet/baselines/main.ir.json
strict_enums: false
Note: generated Spring package root is <base_package>.<ontology_name>.
Release Prep
- Release process: prophet-cli/RELEASING.md
- Changelog: prophet-cli/CHANGELOG.md
- Version sync is test-enforced between:
- prophet-cli/pyproject.toml
[project].version - prophet-cli/src/prophet_cli/cli.py
TOOLCHAIN_VERSION
- prophet-cli/pyproject.toml
Development Notes
- Entry point module:
src/prophet_cli/cli.py - Console script:
prophet - No-op benchmark script:
scripts/benchmark_noop_generation.py - Spring query APIs generated by v0.1 include:
GET /<objects>/{id}for single-field primary keysGET /<objects>/{k1}/{k2}/...for composite primary keysGET /<objects>with pagination/sort onlyPOST /<objects>/querywith typed filter DSL (eq,in,gte,lte,contains) for all filtering- list responses returned as generated
*ListResponseDTOs (no raw SpringPagepayload)
- Generated Spring query layer now uses dedicated
generated.mapping.*DomainMapperclasses for entity-to-domain mapping. - Example Spring app includes both
h2(default) andpostgresruntime profiles with context tests for both.
Contributing
- See root contribution guide: CONTRIBUTING.md
- Open contributor backlog: CONTRIBUTING.md (
Open Items)
License
Apache-2.0. See LICENSE.
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 prophet_cli-0.20.0.tar.gz.
File metadata
- Download URL: prophet_cli-0.20.0.tar.gz
- Upload date:
- Size: 156.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fb1680a342ec97d2bc0fa252daa55dd7f3795f50a8b9ef6a54b8fa55bd0558d
|
|
| MD5 |
19d487da0ce97cf55100d986a4a9e783
|
|
| BLAKE2b-256 |
b7a9c02360a0293a67e9829fdf61dc6cb2ccbf563d5cb33aa5a9a08dc8435100
|
Provenance
The following attestation bundles were made for prophet_cli-0.20.0.tar.gz:
Publisher:
publish-pypi.yml on Chainso/prophet
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prophet_cli-0.20.0.tar.gz -
Subject digest:
3fb1680a342ec97d2bc0fa252daa55dd7f3795f50a8b9ef6a54b8fa55bd0558d - Sigstore transparency entry: 958088887
- Sigstore integration time:
-
Permalink:
Chainso/prophet@16189afe8328aa9282bfab7000d7b4037072cc3c -
Branch / Tag:
refs/tags/v0.20.0 - Owner: https://github.com/Chainso
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@16189afe8328aa9282bfab7000d7b4037072cc3c -
Trigger Event:
push
-
Statement type:
File details
Details for the file prophet_cli-0.20.0-py3-none-any.whl.
File metadata
- Download URL: prophet_cli-0.20.0-py3-none-any.whl
- Upload date:
- Size: 185.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
939add0e1598ffbc4cf9f6c2af3b3576381ba29d47b68fd9e99431a591cee259
|
|
| MD5 |
6e874ca86c54560708bbf2d6578bda25
|
|
| BLAKE2b-256 |
93be0aa4fbdc62accc96305a35aa803064f7c36a88eed81ff8a9b01bafab8990
|
Provenance
The following attestation bundles were made for prophet_cli-0.20.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on Chainso/prophet
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prophet_cli-0.20.0-py3-none-any.whl -
Subject digest:
939add0e1598ffbc4cf9f6c2af3b3576381ba29d47b68fd9e99431a591cee259 - Sigstore transparency entry: 958088928
- Sigstore integration time:
-
Permalink:
Chainso/prophet@16189afe8328aa9282bfab7000d7b4037072cc3c -
Branch / Tag:
refs/tags/v0.20.0 - Owner: https://github.com/Chainso
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@16189afe8328aa9282bfab7000d7b4037072cc3c -
Trigger Event:
push
-
Statement type: