Skip to content

CLI

When you install Protean, you also get a handy command line interface - the protean script - in your virtualenv. Driven by Typer, the script gives access to commands that can help you scaffold projects, generate new code, and run background servers. The --help option will give more information about any commands and options.

Most commands accept a domain instance to load and initialize, prepping it for shell access. The --domain option is used to specify how to load the domain.

Command
protean new Creating a domain
protean shell Working with the shell
protean server Running an async background server
protean observatory Running the observability dashboard
protean ir show Display the domain's IR as JSON or summary
protean db setup Create all database tables
protean db drop Drop all database tables
protean db truncate Delete all data, preserve schema
protean db setup-outbox Create only outbox tables
protean snapshot create Create snapshots for ES aggregates
protean projection rebuild Rebuild projections from events
protean events read Read and display events from a stream
protean events stats Show stream statistics across the domain
protean events search Search for events by type
protean events history Display aggregate event timeline
protean dlq list List failed DLQ messages
protean dlq inspect Inspect a specific DLQ message
protean dlq replay Replay a DLQ message to its original stream
protean dlq replay-all Replay all DLQ messages for a subscription
protean dlq purge Purge DLQ messages for a subscription
protean schema generate Generate JSON Schema files for all data-carrying elements
protean schema show Display the JSON Schema for a specific element

Note

Developing Protean: There are a few additional commands to help you if you want to contribute to Protean.

Command
protean docs Documentation helpers
protean test Framework test runner