Skip to content

Cratis/cli

Cratis

Cratis CLI

The official command-line tool for managing and exploring Chronicle event stores.
Explore the docs »

Report a Bug  ·  Request a Feature  ·  Join the Discord

Discord NuGet


Installation

The CLI is distributed as a .NET global tool and requires .NET 10+.

dotnet tool install -g Cratis.Cli

Verify the installation:

cratis --version

Shell Completions

Install tab completions for your shell:

cratis completions install        # auto-detects bash / zsh / fish

Restart your shell or source your profile to activate completions.


Getting Started

The get-started command is your entry point. Run it right after installation — it checks your configuration, tests the server connection, and shows you the most useful commands to explore.

cratis get-started

If no context is configured yet, the command will walk you through the setup:

╭─ Getting Started ───────────────────────────────────────────────╮
│                                                                 │
│  No configuration found. Set up a context to get started:       │
│                                                                 │
│  1. Create a context pointing at your server:                   │
│     cratis context create dev \                                 │
│       --server chronicle://localhost:35000/?disableTls=true     │
│                                                                 │
│  2. Verify the connection:                                      │
│     cratis get-started                                          │
│                                                                 │
│  3. Start exploring:                                            │
│     cratis chronicle event-stores list                          │
│                                                                 │
╰─────────────────────────────────────────────────────────────────╯

Once a context is configured, get-started shows your active context, connection status, and a curated list of commands to explore and debug your event store.

Setting Up a Context

A context stores a named connection to a Chronicle server:

# Create a context for local development
cratis context create dev \
  --server chronicle://localhost:35000/?disableTls=true

# Make it the active context
cratis context set dev

# Confirm everything is wired up
cratis get-started

Common Commands

# Explore the event store
cratis chronicle event-stores list
cratis chronicle namespaces list
cratis chronicle events get

# Inspect observers and read models
cratis chronicle observers list
cratis chronicle projections list
cratis chronicle read-models instances <name>

# Diagnose problems
cratis chronicle diagnose
cratis chronicle failed-partitions list
cratis chronicle observers replay <id>

# Manage contexts
cratis context list
cratis context show

Use --help on any command or subgroup for the full option reference:

cratis --help
cratis chronicle observers --help

Output Formats

Every command supports -o / --output to control the format:

Flag Output
-o table Rich terminal table (default)
-o plain Tab-separated — great for scripting
-o json Pretty-printed JSON
-o json-compact Compact JSON — fewer tokens for AI tools
# Pipe quiet output for scripting
cratis chronicle observers list -q | xargs -I {} cratis chronicle observers replay {} -y

AI Tool Integration

Run cratis init in your project root to generate a CHRONICLE.md file that gives Claude, Copilot, and Cursor a machine-readable overview of your Chronicle setup:

cratis init

For a full machine-readable capability descriptor, run:

cratis llm-context

Support

Channel Details
💬 Discord Join the community on Discord
🐛 GitHub Issues Report bugs or request features
📚 Documentation https://cratis.io

License

Distributed under the MIT License. See LICENSE for full details.

About

The unified Cratis developer CLI

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors