Command Line Interface (CLI)
Learn how to use the Motia CLI for project creation and deployment
Command Line Interface (CLI)
The Motia CLI handles project scaffolding and deployment. It is installed with the motia package.
During development, npm run dev starts the iii runtime which orchestrates building and running your Motia application. The commands below are either run directly by you or internally by iii's Shell Exec module.
Project Creation
npx motia@latest create
Scaffold a new Motia project.
Arguments:
[project-name](optional): The name for your project folder. Use.or./for the current directory.
Options:
--template <template-name>(optional): Template to use. If not provided, you'll be prompted interactively.
Available Templates:
| Template | Description | Use Case |
|---|---|---|
motia-tutorial-typescript | Tutorial (TypeScript only) | Interactive tutorial project in TypeScript |
motia-tutorial-python | Tutorial (Python only) | Interactive tutorial project in Python |
starter-multilang | Starter (All languages; TS/JS + Python) | Polyglot project with TypeScript API, Python event processing, and JavaScript logging |
starter-typescript | Starter (TypeScript only) | Minimal TypeScript project with basic examples |
starter-javascript | Starter (JavaScript only) | Minimal JavaScript project with basic examples |
starter-python | Starter (Python only) | Minimal Python project with basic examples |
Examples:
Build
motia build
Build your project, compiling all Steps and generating deployment artifacts.
During development, iii's Shell Exec module runs this automatically when your Step files change. You typically only run this manually for deployment.
Deployment
motia cloud deploy
Deploy to Motia Cloud.
Options:
-k, --api-key <key>(required): Your API key for authentication-v, --version-name <version>(required): The version to deploy-n, --project-name <name>: Project name (used when creating a new project)-s, --environment-id <id>: Environment ID (can also be set viaMOTIA_ENVIRONMENT_IDenv var)--environment-name <name>: Environment name (used when creating a new environment)-d, --version-description <description>: The description of the version-e, --env-file <path>: Path to environment file
Docker
Tools for containerizing your Motia project.
Utility Commands
motia generate step
Create a new Step with interactive prompts.
motia enqueue
Manually enqueue a message for testing.
motia state list
List current file state.
Next Steps
- Explore the Core Concepts to learn more about Steps, Flows, and Topics.
- Check out the Examples for common patterns and use cases.