Console and task scheduling
Orionis console exposes application operations as commands with typed arguments, help, interactive output and dependency injection. Reactor executes them. The scheduler decides when to execute scheduled commands through the public Schedule facade.
Scheduler is the conventional name of the application class extending BaseScheduler; it is not the exported facade name. Its configuration belongs in config/scheduler.py. config/queue.py configures Queues, whose job storage and workers have a different lifecycle.
Run the CLI
Section titled “Run the CLI”From the project root, use either alternative with the project’s dependencies available:
orionis listpython -B reactor listIf you use uv to select the project environment:
uv run orionis listuv run python -B reactor listThe orionis executable imports bootstrap.app from the current directory and calls the application without requiring a reactor file. The second alternative uses that local file. Both access the same registry and execution lifecycle; the direct command also disables bytecode writing in its process and sets this preference for child interpreters.
Syntax, help and exit codes
Section titled “Syntax, help and exit codes”orionis <signature> [arguments] [options]python -B reactor <signature> [arguments] [options]With no signature, or with -h / --help in its position, the command list is displayed. For an operation’s help, append --help after its signature:
orionis make:console-command --helppython -B reactor make:console-command --helpPositional arguments follow declaration order; options use each command’s flags. Long-option abbreviation is disabled. There is no universal set of flags such as --quiet or --force: inspect the specific command’s help.
Status 0 normally means execution completed successfully; a command can return another integer for a business outcome. Parser errors normally produce 2; an exception handled by Reactor produces 1. Some built-in commands catch their errors without returning a nonzero code; these differences are documented in the catalog.
Create and run your first command
Section titled “Create and run your first command”Generate the file and open app/console/commands/greet_command.py:
orionis make:console-command greet --signature app:greetpython -B reactor make:console-command greet --signature app:greetReplace the unimplemented body with this complete module:
from typing import ClassVarfrom orionis.console import Argumentfrom orionis.console.base import BaseCommand
class GreetCommand(BaseCommand): signature = "app:greet" description = "Print a greeting." timestamps = False arguments: ClassVar[list[Argument]] = [ Argument(name_or_flags="name", type_=str), ]
async def handle(self) -> int: self.writeLine(f"Hello, {self.getArgument('name')}!") return 0orionis app:greet Adapython -B reactor app:greet AdaThe loader discovers the class through its configured path. The parser supplies name, Reactor constructs the command and handle() writes Hello, Ada!. See creation and injection for constructors, services, conventions and error handling.
From commands to scheduling
Section titled “From commands to scheduling”flowchart TD
accTitle: Manual commands and scheduled tasks
A[Terminal or async component] --> R[Reactor]
B[Application Scheduler class] --> S[Schedule: register calendar and listeners]
S --> P[Active schedule:work process]
P --> R
R --> L[Loader and parser]
L --> D[Scope and container]
D --> H[Command handler]
H --> O[Exit code and diagnostics]A command can run manually, through await Reactor.call(...) or from a scheduled task. Configuring a calendar does not start a consumer process. The native schedule:work command keeps the scheduler active; schedule:list inspects it. There is no native schedule:run command.
Task events belong to the scheduler: manual Reactor calls do not automatically trigger those listeners. Differences between nonzero returns, exceptions, missed execution and instance limits are explained under events.
Guide map
Section titled “Guide map”| Need | Documentation |
|---|---|
| Generate and organize commands | Create commands and inject services |
| Declare and read CLI input | Arguments and options |
| Register a class/method through routes | Console routes |
| Write messages and tables | Text, tables and output |
| Ask the operator for input | Questions and interactive input |
| Show progress and manage delays | Progress |
| Run and inspect commands from code | Reactor facade |
| Configure discovery and invalidation | Command caching |
| Create the application scheduler | Schedule tasks |
| Schedule a command with arguments | Schedule.command() |
| Persist schedules | Scheduler configuration |
| Choose any supported frequency | Frequencies and calendars |
| React to outcomes and errors | Listeners and events |
| Control Schedule through its API | Scheduler execution and API |
| Inspect all built-in operations | Command catalog |
| Review integration contracts and tools | Technical reference |