Chronos — CLI Reference
Chronos Documentation: ← Introduction | Language Reference | ← Examples & Artifacts | CLI Reference
CLI and Workflow
The Chronos CLI (chronos) validates your specifications and executes the projections defined in chronos-build.json. It runs the same way locally, in CI, or as part of a build pipeline.
Global flags available on every command:
| Flag | Description |
|---|---|
--help, -h | Print command help |
--debug | Print debug information including stack traces |
--no-color | Disable ANSI color output |
--force-color | Force ANSI color output |
| Command | Description |
|---|---|
chronos init | Create a new project from a template |
chronos validate | Validate specs without generating artifacts |
chronos build | Validate and execute all configured projections |
chronos select | Query shapes using a selector expression |
chronos diff | Compare two specs and report changes |
chronos clean | Remove all generated artifacts |
Click any command to expand its full documentation.
chronos init — Create a new project from a template
Create a new Chronos project from a template.
chronos init -t quickstart -o ./my-requirements
Flags:
| Flag | Description |
|---|---|
-t, --template <name> | Template to use (default: quickstart) |
-o, --output <dir> | Output directory for the new project |
--list | List all available templates |
--url <repo> | Use a custom template repository |
Available templates:
| Template | Description |
|---|---|
quickstart | Single-journey starter project |
e-commerce | Multi-journey e-commerce example |
saas-onboarding | SaaS signup and onboarding flows |
api-service | API-focused journeys with Smithy integration |
compliance-heavy | Template with GDPR/PCI-DSS policy examples |
# List available templates
chronos init --list
# Create project from a template
chronos init -t e-commerce -o ./requirements
# Use a custom template repository
chronos init --url https://github.com/my-org/chronos-templates -t internal-standard -o ./requirements
chronos validate — Validate specs for syntax errors without generating artifacts
Validate .chronos files for syntax errors and semantic rule violations without generating any artifacts.
chronos validate
chronos validate requirements/checkout/
chronos validate requirements/checkout/guest-checkout.chronos
Flags:
| Flag | Description |
|---|---|
--severity <level> | Minimum severity to report: note, warning, danger, error (default: warning) |
--config <file> | Path to chronos-build.json (default: auto-discover) |
Output:
Validation events are printed to stderr with severity, rule code, file location, and message:
ERROR [CHR-001] requirements/checkout/guest-checkout.chronos:12
Journey 'GuestCheckout' does not declare an actor.
WARNING [CHR-009] requirements/checkout/guest-checkout.chronos:8
Journey 'GuestCheckout' has no @kpi trait. Consider linking to a business metric.
WARNING [CHR-004] requirements/checkout/guest-checkout.chronos:34
Expectation contains ambiguous language: "quickly". Use measurable language instead.
Exit code is 0 if no errors, 1 if any ERROR severity events are found.
chronos build — Validate and execute all configured projections
Validate your spec and execute all projections defined in chronos-build.json. This is the primary command for generating artifacts and pushing to external systems.
chronos build
chronos build --projection issues
chronos build --projection tests,diagrams
Flags:
| Flag | Description |
|---|---|
--config <file> | Path to chronos-build.json (default: auto-discover) |
--projection <name> | Run only the named projection(s), comma-separated |
--output <dir> | Override the output directory |
--dry-run | Validate and plan without executing projections |
Credentials for issue tracker plugins are read from environment variables—never stored in chronos-build.json:
CHRONOS_LINEAR_TOKEN=xxx chronos build
CHRONOS_JIRA_TOKEN=xxx chronos build
chronos select — Query shapes using a selector expression
Query shapes defined in your .chronos files using a selector expression. Useful for auditing, reporting, and scripting.
chronos select 'journey'
chronos select 'journey[trait|compliance]'
chronos select 'actor' requirements/
Flags:
| Flag | Description |
|---|---|
--selector <expr> | Selector expression (can also be passed as first positional argument) |
--config <file> | Path to chronos-build.json |
--format <fmt> | Output format: ids (default), json |
Selector syntax:
Selectors target shape types and filter by traits, namespaces, or name patterns:
| Expression | Matches |
|---|---|
* | All shapes |
journey | All journeys |
actor | All actors |
entity | All entities |
policy | All policies |
enum | All enums |
[trait|kpi] | Any shape with a @kpi trait |
[trait|compliance] | Any shape with a @compliance trait |
[id|namespace = "com.example.checkout"] | Shapes in a specific namespace |
[id|name ^= "Guest"] | Shapes whose name starts with "Guest" |
journey[trait|compliance] | Journeys with a @compliance trait |
journey:not([trait|kpi]) | Journeys missing a @kpi trait |
entity[trait|pii] | Entities marked with @pii |
Examples:
# List all journey IDs
chronos select 'journey'
# com.genairus.commerce.checkout#GuestCheckout
# com.genairus.commerce.checkout#ReturnCustomerCheckout
# com.genairus.onboarding#EmailSignup
# Find all compliance-tagged journeys
chronos select 'journey[trait|compliance]'
# Find journeys missing a KPI
chronos select 'journey:not([trait|kpi])'
# Find all PII entities
chronos select 'entity[trait|pii]'
# Output as JSON for scripting
chronos select 'journey' --format json
chronos diff — Compare two specs and report breaking changes
Compare two .chronos files, directories, or project versions and report what changed. Highlights breaking changes—removed journeys, dropped steps, changed expectations.
chronos diff --old v1/requirements/ --new v2/requirements/
chronos diff --old main --new feature/checkout-v2 --mode git
Flags:
| Flag | Description |
|---|---|
--old <path|ref> | Old model path or git ref |
--new <path|ref> | New model path or git ref |
--mode <mode> | Comparison mode: files (default), git |
--severity <level> | Minimum severity to report |
Comparison modes:
| Mode | Description |
|---|---|
files | Compare two file paths or directories directly |
git | Compare between git refs (branch, tag, commit SHA) |
Output:
BREAKING Journey 'GuestCheckout' step 'PlaceOrder' expectation changed
- "Order is created with status PAID and confirmation email is queued"
+ "Order is created with status PENDING and payment is processed asynchronously"
ADDED Journey 'ExpressCheckout' added in com.genairus.commerce.checkout
REMOVED Actor 'GuestUser' removed from com.genairus.common.actors
↳ Referenced by: GuestCheckout, ExpressCheckout
Breaking changes exit with code 1—useful for gating CI pipelines on requirement regressions.
chronos clean — Remove all generated artifacts
Remove all generated artifacts from the output directories defined in chronos-build.json.
chronos clean
chronos clean --projection issues
Flags:
| Flag | Description |
|---|---|
--config <file> | Path to chronos-build.json |
--projection <name> | Clean only the named projection(s) |
Running in CI / Build Pipelines
chronos build is designed to run unattended. Add it to any pipeline:
# .github/workflows/chronos.yml
name: Chronos Build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Chronos CLI
run: |
curl -L https://github.com/genairus/chronos/releases/latest/download/chronos-linux-x86_64.zip \
-o chronos.zip && unzip chronos.zip && sudo mv chronos /usr/local/bin/
- name: Validate
run: chronos validate
- name: Diff against main
run: chronos diff --old origin/main --new HEAD --mode git
- name: Build artifacts
run: chronos build
env:
CHRONOS_LINEAR_TOKEN: ${{ secrets.LINEAR_API_TOKEN }}
Build Configuration
chronos-build.json is the single configuration file that controls everything Chronos produces. Each entry in projections is a named plugin. You pick which ones to enable—if a projection isn't listed, it isn't run.
Issue tracker plugins (use one):
| Plugin | Tracker |
|---|---|
jira-cloud | Jira Cloud |
jira-server | Jira Data Center / Server |
linear | Linear |
asana | Asana |
github-issues | GitHub Issues |
azure-devops | Azure DevOps Work Items |
Test scaffolding plugins (use one):
| Plugin | Framework | Output |
|---|---|---|
cucumber | Cucumber / Gherkin | .feature files |
jest | Jest | .test.ts describe/it scaffolding |
playwright | Playwright | .spec.ts test scaffolding |
rspec | RSpec | _spec.rb scaffolding |
pytest | pytest | test_*.py scaffolding |
Document plugins:
| Plugin | Output |
|---|---|
prd | Product Requirements Document (Markdown or HTML) |
mermaid | State diagrams |
event-contracts | Telemetry event contracts |
{
"version": "1.0",
"sources": ["requirements/**/*.chronos"],
"projections": {
"issues": {
"plugin": "linear",
"config": {
"teamId": "PRODUCT"
}
},
"prd": {
"plugin": "prd",
"output": "./artifacts/docs",
"config": {
"format": "markdown",
"includeKpis": true,
"includeCompliance": true
}
},
"tests": {
"plugin": "cucumber",
"output": "./features",
"config": {
"language": "en",
"indentSize": 2
}
},
"diagrams": {
"plugin": "mermaid",
"output": "./artifacts/diagrams",
"config": {
"theme": "default"
}
},
"telemetry": {
"plugin": "event-contracts",
"output": "./artifacts/telemetry",
"config": {
"format": "yaml"
}
}
},
"integrations": {
"capacitor": {
"schema": "./data"
},
"smithy": {
"spec": "./api"
}
}
}
Every projection that calls an external API (issue trackers) reads its credentials from environment variables. The chronos-build.json file is safe to commit—no secrets belong in it.
Validation Rules
Chronos enforces semantic rules:
| Rule | Description |
|---|---|
| Completeness | Every journey must have actor, steps, and outcomes |
| Ambiguity | Fuzzy language ("fast", "easy") triggers warnings |
| Traceability | Journeys should link to KPIs via @kpi trait |
| Reachability | All steps must lead to a terminal outcome |
| Type Safety | All referenced shapes must be defined or imported |
Common Validation Errors
Error: Ambiguous expectation
expectations must not contain fuzzy language like "fast", "easy", "intuitive"
Fix: Use concrete, measurable language:
- ❌ "System responds quickly"
- ✅ "System responds within 500ms (p99)"
Error: Unresolved shape reference
Entity 'Order' is not defined in namespace 'com.example'
Fix: Add import or define the entity:
use com.example.entities#Order
Error: Journey lacks terminal outcome
Journey 'GuestCheckout' has paths that don't reach a terminal state
Fix: Ensure all steps and variants lead to outcomes.success or outcomes.failure.
Troubleshooting
Common Issues
Issue: "Namespace not found" error
Error: Cannot resolve shape 'Order' from namespace 'com.example.data'
Solution:
- Check that the namespace is correct in your
usestatement - Verify the file defining
Orderexists and has the correct namespace declaration - Ensure the source directory is included in
chronos-build.jsonsourcesarray
Issue: Fuzzy language warnings
Warning: Step expectation contains ambiguous language: "quickly", "easily"
Solution: Replace with concrete, measurable language:
- "responds quickly" → "responds within 500ms (p99)"
- "displays clearly" → "displays error message in red text above form"
- "handles errors gracefully" → "returns 400 status with JSON error object"
Issue: Journey doesn't validate
Error: Journey 'GuestCheckout' has unreachable terminal state
Solution: Trace all paths through your journey:
- Every step should either lead to another step or to a terminal outcome
- Every variant should specify an
outcomefield - Use
TransitionTo()orReturnToStep()to create explicit paths
Issue: Generated work items missing fields or failing to push
Solution: Check your issue tracker plugin configuration in chronos-build.json. Each plugin has its own required config keys—refer to the plugin's documentation. Example for jira-cloud:
{
"projections": {
"issues": {
"plugin": "jira-cloud",
"config": {
"projectKey": "ECOM", // Must match your Jira project key
"issueTypeEpic": "Epic", // Must match Jira issue type name exactly
"issueTypeStory": "Story",
"customFields": {
"KPI": "customfield_10001" // Map Chronos traits to custom fields
}
}
}
}
}
Getting Help
- Documentation: /docs/chronos
- Generators: /docs/chronos-generators
- GitHub Issues: github.com/genairus/chronos/issues
- Discord: Coming soon!
Chronos Documentation: ← Introduction | Language Reference | ← Examples & Artifacts | CLI Reference