The FastStream CLI allows you to publish test messages directly to your broker. This is especially useful during development for debugging and testing without needing to write custom publisher code.
The primary command to launch a FastStream application faststream run. This command supports a variety of options to customize your application runtime:
FastStream allows you to scale application right from the command line by running you application in multiple instances. Just set the --workers option to scale your application:
2025-08-20 17:35:03,932 INFO - Started parent process [95606]2025-08-20 17:35:03,940 INFO - Started child process 0 [95608]2025-08-20 17:35:03,942 INFO - Started child process 1 [95609]2025-08-20 17:35:03,944 INFO - Started child process 2 [95610]Worker 0 startedWorker 1 startedWorker 2 started
You can pass any custom flags or configuration options to the CLI without predefining them in your application. These values will be available in your application's environment.
For example, we will pass the .env file to the context of our application:
FastStream is built on anyio and supports using any event loop implementation (for example, asyncio, uvloop, winloop, and rloop). By default, FastStream uses behavior from anyio: use uvloop (on Unix) if it exists, with fallback to asyncio.
You can set the event loop factory explicitly via the --loop option in the CLI:
faststreamrunmain:app--loop=uvloop:new_event_loop
Alternatively, you can specify the event loop implementation using the FASTSTREAM_LOOP environment variable. For example:
This lets you control the event loop used by FastStream either via command-line flags or by setting an environment variable, according to your deployment or development needs.
FastStream CLI uses Typer rich formatting for its help and error messages. You can control this behavior with the FASTSTREAM_CLI_RICH_MODE environment variable:
# available values: rich, markdown, or noneFASTSTREAM_CLI_RICH_MODE=nonefaststreamrunmain:app
rich(default) – use Typer's rich markup styling.
markdown – render CLI output using markdown-compatible formatting.
none – disable rich formatting and use plain-text output.
This is useful when working in terminals that do not support ANSI styling or when copying CLI output into plain-text environments.