routed_cli 0.3.0
routed_cli: ^0.3.0 copied to clipboard
CLI runtime and command framework utilities for the Routed ecosystem.
routed_cli #
CLI runtime and command framework helpers for Routed.
This package provides reusable command-runner and dev-server utilities used by Routed's CLI surface, including:
CliLoggerCliVersionRoutedCommandRunnerProjectCommandsLoaderDevServerRunner
It is intended for internal ecosystem composition and advanced custom command integrations.
routed_cli is a command-line package, not an Engine provider. Install it as
a development dependency and run commands with dart run routed_cli ...; keep
runtime provider initialization in routed or the relevant adapter package.
For a Cloudflare Durable Object, pass each binding as BINDING=ClassName.
Routed generates the Dart factory registration, Wrangler binding, SQLite
migration, and named Worker class export:
routed deploy --target cloudflare \
--durable-object COUNTER=Counter \
--durable-object ROOMS=ChatRoom
For D1, pass each binding as BINDING=DATABASE_NAME:DATABASE_ID:
routed deploy --target cloudflare \
--d1 DB=app-db:00000000-0000-0000-0000-000000000000
R2 buckets, Queue producers, and Worker-to-Worker service bindings use the
same BINDING=RESOURCE_NAME form:
routed deploy --target cloudflare \
--r2 FILES=app-files \
--queue EVENTS=app-events \
--service PROFILE_API=profile-api
Containers, Workflows, and Secrets Store bindings can also be emitted in the generated Wrangler configuration:
routed deploy --target cloudflare \
--container APP=AppContainer\|./Dockerfile\|8080\|3 \
--workflow BILLING=billing-workflow:BillingWorkflow:billing-worker \
--secrets-store PAYMENTS_KEY=store-id:PAYMENTS_API_KEY
Container values are BINDING=CLASS_NAME|IMAGE|PORT|MAX_INSTANCES; the port
defaults to 8080 and the maximum instance count is optional. Routed exports a
small Durable Object wrapper that starts the container and forwards Fetch
requests to that port. A Workflow SCRIPT_NAME is optional when the Workflow
class is in the same Worker; use it when the Workflow is hosted by another
Worker. Secrets Store values are never written to the generated config.
The application entry library must export each Dart Durable Object class, and
each constructor must accept (CloudflareDurableObjectState, CloudflareEnvironment) through the CloudflareDurableObject base class.
Container classes are generated by the deploy command from the Container
descriptor and do not need to be Dart classes.