CLI Reference
The pywire CLI is your primary tool for developing, building, and serving applications. It ships as a separate pywire-cli package; installing pywire[cli] pulls it in transparently.
Global Flags
Section titled “Global Flags”--help: Show help message and exit.--version: Show the version number.
pywire dev
Section titled “pywire dev”Starts the development server.
pywire dev [APP] [OPTIONS]- APP: The application string (e.g.,
main:app). Optional ifmain.pyorapp.pyexists.
Options:
--host TEXT: Bind host (default:127.0.0.1).--port INTEGER: Bind port (default:3000).--ssl-keyfile TEXT: Path to SSL key file.--ssl-certfile TEXT: Path to SSL certificate file.--env-file TEXT: Path to .env file.--no-tui: Disable the Terminal User Interface and output standard logs.
The TUI Dashboard
Section titled “The TUI Dashboard”Running dev opens a rich dashboard:
- Logs: View live server logs.
- Keys:
l: Cycle log levels (DEBUG, INFO, ERROR).y: Copy logs to clipboard.r: Restart server.q/Ctrl+C: Quit.
pywire run
Section titled “pywire run”Starts the production server (Uvicorn wrapper). Optimizes for performance and concurrency.
pywire run [APP] [OPTIONS]Options:
--host TEXT: Bind host (default:0.0.0.0).--port INTEGER: Bind port (default:8000).--workers INTEGER: Number of worker processes (default: auto-calculated based on CPU cores).--no-access-log: Disable access logging for performance.
pywire build
Section titled “pywire build”Compiles .wire files into optimized Python bytecode and generates build artifacts.
pywire build [APP] [OPTIONS]Options:
--optimize: Compile bytecode with optimization (python-O).--out-dir TEXT: Output directory (default:.pywire/build).--pages-dir TEXT: Override pages directory.
pywire check
Section titled “pywire check”Runs static analysis on your project’s .wire files. Flags non-serializable wire() initial values, writes to wires inside a derived() body, redundant {x.value} interpolation, and more as the rule set grows.
pywire check [APP] [OPTIONS]Options:
--pages-dir TEXT: Override pages directory.--rule CODE: Only run specific rules (e.g.--rule PW001 --rule PW003). Repeatable. Default: all rules.--plain: Emit ruff-style plain text (file:line:col: severity [code] message) for CI / greppable logs.--strict: Exit 1 on any warning or info. Default exits 1 only on errors.--fix: Stub — not implemented yet.
pywire build runs the same analysis automatically and blocks on any error-severity diagnostic.
Rule codes:
PW001—wire()assigned a non-serializable initial valuePW002— wire write inside aderived()body (raisesReactivityError)PW003— redundant.valuein template interpolationPW004–PW010— stubbed for upcoming releases
pywire deploy
Section titled “pywire deploy”Generates deployment configuration files for your app.
pywire deploy [APP] [OPTIONS]The command builds your project, validates the setup, and generates platform-specific config files (Dockerfile, render.yaml, etc.).
Options:
--platform {docker,render,fly}: Target platform (default:docker).--out-dir PATH: Output directory for generated files (default:.).
Examples:
# Generate a Dockerfilepywire deploy --platform docker
# Generate a render.yaml for Render.compywire deploy --platform render
# Generate into a subdirectorypywire deploy --platform docker --out-dir deploy/See Deployment for platform-specific guides.
create-pywire-app
Section titled “create-pywire-app”(Separate command, typically run via uvx) Scaffolds a new project. See Quickstart.