Typed Milo adapters for Chirp-owned CLI handlers.
This module is imported only after Milo selects a command. The functions keep the public typed contract separate from the existing handler modules while the handlers continue to own domain behavior and terminal output.
cli._milo_handlers
| Name | Type | Default | Description |
|---|---|---|---|
type
|
|
— | |
qualified_name
|
|
— | |
element_type
|
|
— | |
description
|
|
— | |
source_file
|
|
— | |
line_number
|
|
— | |
is_autodoc
|
|
— | |
autodoc_element
|
|
— | |
_autodoc_template
|
|
— | |
_autodoc_url_path
|
|
— | |
_autodoc_page_type
|
|
— | |
title
|
|
— | |
doc_content_hash
|
|
— |
Symbols on this page
Create a new project.
Start a Chirp server.
Start a Chirp development server with browser reload.
Validate an application's hypermedia contracts.
Diff an application's hypermedia contracts.
List registered routes.
Audit an application's security configuration.
Render routes to static HTML files.
Generate a schema migration from a SQL diff.
Apply pending schema migrations.
Suggest @shape decorators and audit Shape drift.
Run the skill publish gate (check + freeze + smoke) and emit a receipt.
new_command
function
def new_command(name: Annotated[str, Positional('name')], minimal: bool = False, stream: bool = False, sse: bool = False, shell: bool = False, ai: bool = False, skill: bool = False, with_chirpui: bool = False) -> None
Create a new project.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
name
|
Annotated[str, Positional('name')]
|
— | Project directory name. |
minimal
|
bool
|
False
|
Generate a minimal single-file project. |
stream
|
bool
|
False
|
Include the simulated token-streaming demo. |
sse
|
bool
|
False
|
Include SSE boilerplate. |
shell
|
bool
|
False
|
Generate a project with a persistent app shell. |
ai
|
bool
|
False
|
Scaffold AI chat and its secure supporting stack. |
skill
|
bool
|
False
|
Scaffold a signed skill app (skill.tool + secure stack). |
with_chirpui
|
bool
|
False
|
Require ChirpUI templates. |
run_command
function
def run_command(app: Annotated[str, Positional('app')], host: str | None = None, port: int | None = None, production: bool = False, workers: int | None = None, metrics: bool = False, rate_limit: bool = False, queue: bool = False, sentry_dsn: str | None = None) -> None
Start a Chirp server.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
app
|
Annotated[str, Positional('app')]
|
— | Application import string, for example myapp:app. |
host
|
str | None
|
None
|
Bind host address. |
port
|
int | None
|
None
|
Bind port number. |
production
|
bool
|
False
|
Run in production mode. |
workers
|
int | None
|
None
|
Worker count; zero selects automatically. |
metrics
|
bool
|
False
|
Enable the Prometheus metrics endpoint. |
rate_limit
|
bool
|
False
|
Enable per-IP rate limiting. |
queue
|
bool
|
False
|
Enable request queueing. |
sentry_dsn
|
str | None
|
None
|
Sentry DSN for error tracking. |
dev_command
function
def dev_command(app: Annotated[str, Positional('app')], host: str | None = None, port: int | None = None, production: bool = False, workers: int | None = None, metrics: bool = False, rate_limit: bool = False, queue: bool = False, sentry_dsn: str | None = None) -> None
Start a Chirp development server with browser reload.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
app
|
Annotated[str, Positional('app')]
|
— | Application import string, for example myapp:app. |
host
|
str | None
|
None
|
Bind host address. |
port
|
int | None
|
None
|
Bind port number. |
production
|
bool
|
False
|
Run in production mode. |
workers
|
int | None
|
None
|
Worker count; zero selects automatically. |
metrics
|
bool
|
False
|
Enable the Prometheus metrics endpoint. |
rate_limit
|
bool
|
False
|
Enable per-IP rate limiting. |
queue
|
bool
|
False
|
Enable request queueing. |
sentry_dsn
|
str | None
|
None
|
Sentry DSN for error tracking. |
check_command
function
def check_command(app: Annotated[str, Positional('app')], warnings_as_errors: bool = False, coverage: bool = False, deploy: bool = False, json: bool = False, baseline: Annotated[str | None, Option(metavar='PATH')] = None, include_info: bool = False) -> dict[str, Any]
Validate an application's hypermedia contracts.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
app
|
Annotated[str, Positional('app')]
|
— | Application import string, for example myapp:app. |
warnings_as_errors
|
bool
|
False
|
Fail when contract warnings are present. |
coverage
|
bool
|
False
|
Show route and template coverage counters. |
deploy
|
bool
|
False
|
Use production-posture severity and strict warnings. |
json
|
bool
|
False
|
Emit the stable JSON contract report. |
baseline
|
Annotated[str | None, Option(metavar='PATH')]
|
None
|
Compare with a prior JSON baseline at this path. |
include_info
|
bool
|
False
|
Include informational findings in structured output. |
diff_command
function
def diff_command(app: Annotated[str, Positional('app')], base: Annotated[str, Option(metavar='REF')], json: bool = False, warnings_as_errors: bool = False, deploy: bool = False, include_info: bool = False) -> dict[str, Any]
Diff an application's hypermedia contracts.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
app
|
Annotated[str, Positional('app')]
|
— | Application import string, for example myapp:app. |
base
|
Annotated[str, Option(metavar='REF')]
|
— | Git ref to compare against. |
json
|
bool
|
False
|
Emit a stable JSON diff payload. |
warnings_as_errors
|
bool
|
False
|
Fail when new warnings appear. |
deploy
|
bool
|
False
|
Use production-posture severity and strict warnings. |
include_info
|
bool
|
False
|
Include informational findings in the diff. |
routes_command
function
def routes_command(app: Annotated[str, Positional('app')]) -> dict[str, Any]
List registered routes.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
app
|
Annotated[str, Positional('app')]
|
— | Application import string, for example myapp:app. |
security_check_command
function
def security_check_command(app: Annotated[str, Positional('app')]) -> None
Audit an application's security configuration.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
app
|
Annotated[str, Positional('app')]
|
— | Application import string, for example myapp:app. |
freeze_command
function
def freeze_command(app: Annotated[str, Positional('app')], output: Annotated[str, Positional('output')], exclude: Annotated[list[str] | None, Option(metavar='EXCLUDE'), MinLen(1)] = None) -> None
Render routes to static HTML files.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
app
|
Annotated[str, Positional('app')]
|
— | Application import string, for example myapp:app. |
output
|
Annotated[str, Positional('output')]
|
— | Output directory for frozen HTML files. |
exclude
|
Annotated[list[str] | None, Option(metavar='EXCLUDE'), MinLen(1)]
|
None
|
One or more URL prefixes to exclude. |
makemigrations_command
function
def makemigrations_command(db: Annotated[str, Option(metavar='DB')], schema: Annotated[str, Option(metavar='SCHEMA')], migrations_dir: Annotated[str, Option(metavar='MIGRATIONS_DIR')] = 'migrations') -> None
Generate a schema migration from a SQL diff.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
db
|
Annotated[str, Option(metavar='DB')]
|
— | Database URL. |
schema
|
Annotated[str, Option(metavar='SCHEMA')]
|
— | SQL schema file or Python module containing SCHEMA. |
migrations_dir
|
Annotated[str, Option(metavar='MIGRATIONS_DIR')]
|
'migrations'
|
Output directory for migration files. |
migrate_command
function
def migrate_command(db: Annotated[str, Option(metavar='DB')], migrations_dir: Annotated[str, Option(metavar='MIGRATIONS_DIR')] = 'migrations') -> None
Apply pending schema migrations.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
db
|
Annotated[str, Option(metavar='DB')]
|
— | Database URL. |
migrations_dir
|
Annotated[str, Option(metavar='MIGRATIONS_DIR')]
|
'migrations'
|
Directory containing migration files. |
shapes_codegen_command
function
def shapes_codegen_command(path: Annotated[str, Positional('path')] = '.', dry_run: bool = False, audit: bool = False, migrations: Annotated[str, Option(metavar='MIGRATIONS_DIR')] = 'migrations') -> None
Suggest @shape decorators and audit Shape drift.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
path
|
Annotated[str, Positional('path')]
|
'.'
|
File or directory to scan; with --audit, an app import string. |
dry_run
|
bool
|
False
|
Print suggestions without writing files. |
audit
|
bool
|
False
|
Audit surface contracts for missing Shapes. |
migrations
|
Annotated[str, Option(metavar='MIGRATIONS_DIR')]
|
'migrations'
|
Reserved migration directory for future incremental output. |
skill_publish_command
function
def skill_publish_command(app: Annotated[str, Positional('app')], corpus: Annotated[str | None, Option(metavar='PATH')] = None, fixture: bool = False, warnings_as_errors: bool = False, json: bool = False) -> dict[str, Any]
Run the skill publish gate (check + freeze + smoke) and emit a receipt.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
app
|
Annotated[str, Positional('app')]
|
— | Application import string, for example myapp:app. |
corpus
|
Annotated[str | None, Option(metavar='PATH')]
|
None
|
JSON path to a golden NL smoke corpus (array of CorpusPrompt). |
fixture
|
bool
|
False
|
Use the built-in fixture-echo corpus from chirp.skill.smoke. |
warnings_as_errors
|
bool
|
False
|
Fail the check stage when contract warnings exist. |
json
|
bool
|
False
|
Emit the stable JSON publish receipt. |
View source · /home/runner/work/chirp/chirp/site/../src/chirp/cli/_milo_handlers.py:1