Command-line interface for the Oridecon Framework.
Overview
Section titled “Overview”The oridecon CLI provides project scaffolding, code generation, development tooling, and administrative commands for every stage of the application lifecycle. It uses a contributor-based plugin system so other packages can extend the CLI with new commands and generators.
Full documentation: oridecon.dev
Install
Section titled “Install”uv add oridecon-cli# or, as a standalone tool:uv tool install oridecon-cliQuick Start
Section titled “Quick Start”from oridecon import Applicationfrom oridecon.di.module import Module, module
from oridecon.cli import CLIModulefrom oridecon.cli.config import CLIConfig
@module(imports=[CLIModule.configure(CLIConfig())])class AppModule(Module): pass
async with Application.boot(modules=[AppModule]) as app: # use app.container to resolve services ...Or use the CLI directly:
# Create a new web API projectoridecon new project my-api --template web-api
# Scaffold a new extension packageoridecon new package my-feature
# Generate a provider (providers and tests are the built-in generators)oridecon gen provider MyProvider
# Add the database package to an existing projectoridecon add database
# Start the dev server with hot-reloadoridecon dev startConfiguration
Section titled “Configuration”Zero-config usage: Call
CLIModule.configure()with no arguments to use all defaults.
Option 1 — YAML file
Section titled “Option 1 — YAML file”cli: default_template: "web-api" default_database: "postgres" color: true verbose: falseOption 2 — Profiles + Environment Variables (recommended)
Section titled “Option 2 — Profiles + Environment Variables (recommended)”export ORI_CLI__DEFAULT_TEMPLATE=web-apiexport ORI_CLI__COLOR=trueexport ORI_CLI__VERBOSE=falseOption 3 — Python
Section titled “Option 3 — Python”from oridecon.cli.config import CLIConfigfrom oridecon.cli import CLIModule
config = CLIConfig.from_env_profile()CLIModule.configure(config)Config reference
Section titled “Config reference”| Field | Default | Env var | Description |
|---|---|---|---|
default_template | "web-api" | ORI_CLI__DEFAULT_TEMPLATE | Template used by oridecon new |
default_database | "postgres" | ORI_CLI__DEFAULT_DATABASE | Database driver used by scaffolding |
color | true | ORI_CLI__COLOR | Enable coloured terminal output |
verbose | false | ORI_CLI__VERBOSE | Print verbose/debug output |
Module Factory Methods
Section titled “Module Factory Methods”| Method | Description |
|---|---|
CLIModule.configure(config) | Register the CLI module and its contributor-based commands |
CLIModule.stub() | Minimal module for tests |
Key Features
Section titled “Key Features”- Project scaffolding —
web-api,api, andfulltemplates - Package generation — scaffold new
oridecon-*extension packages - Code generators —
providerandtestgenerators built in; more generators ship as CLI contributors from ecosystem packages (e.g. controllers viaoridecon-web) - Contributor system — extensible plugin architecture for new commands
- Shell completion — bash, zsh, and fish completion scripts
Testing
Section titled “Testing”from oridecon import Applicationfrom oridecon.cli import CLIModule
async def test_cli_module(): async with Application.boot(modules=[CLIModule.stub()]) as app: # No-op CLI module for tests ...Key Source Files
Section titled “Key Source Files”| File | What it contains |
|---|---|
src/oridecon/cli/config.py | CLIConfig configuration dataclass |
src/oridecon/cli/module.py | CLI module assembly |
src/oridecon/cli/commands/ | All CLI command implementations |
src/oridecon/cli/generators/ | Code generation logic |
src/oridecon/cli/registry/ | Registry subsystems |
src/oridecon/cli/contributors/ | Plugin contributor system |