frameworks/motia/motia-js/MONOREPO-README.md
This directory hosts the JavaScript/TypeScript SDK for Motia — a unified backend framework that combines APIs, background jobs, queues, workflows, and AI agents into a single system powered by the iii engine.
Build production-grade backends with a single primitive.
Motia provides:
motia-js/
├── packages/
│ ├── motia/ # Main SDK + CLI (v1.0.0-rc.22)
│ │ ├── src/ # Source code
│ │ │ └── new/cli.ts # CLI entry point (motia create/dev/build/typegen)
│ │ └── package.json
│ ├── stream-client/ # Core stream client library
│ ├── stream-client-browser/ # Browser stream client
│ ├── stream-client-node/ # Node.js stream client
│ └── stream-client-react/ # React hooks for streams
├── playground/ # Dev sandbox (example Motia project)
│ ├── steps/ # Example step implementations
│ ├── config.yaml # iii engine configuration
│ ├── motia.config.ts # Motia SDK configuration
│ └── package.json
├── biome.json # Linter + formatter config
├── compose.yml # Optional Redis + RabbitMQ for production adapters
├── pnpm-workspace.yaml # Monorepo workspace config
├── package.json # Root scripts and tooling
├── CONTRIBUTING.md # Contribution guide
└── README.md # SDK documentation
[email protected])From the repo root:
cd motia-js
pnpm install
Build all packages:
pnpm build
Link the CLI for development:
pnpm setup
Reload your shell profile (source ~/.zshrc or ~/.bashrc), then:
pnpm link ./packages/motia --global
motia --version
The playground is the local dev sandbox for testing Motia changes. It requires the iii engine.
pnpm dev
This builds all packages, then starts the playground via the iii engine. The iii engine's shell module watches for file changes and re-runs motia dev automatically.
Key ports:
| Port | Service |
|---|---|
| 3111 | REST API |
| 3112 | Streams |
| 3113 | Console |
| 49134 | SDK WebSocket (iii engine) |
| Script | Description |
|---|---|
pnpm build | Build all packages (uses tsdown) |
pnpm dev | Build + run playground with iii engine |
pnpm test | Run unit tests (motia package) |
pnpm test:coverage | Run unit tests with coverage (motia package) |
pnpm test:ci | Run all tests including integration |
pnpm lint | Lint with Biome |
pnpm lint:fix | Auto-fix lint issues |
pnpm format | Format code with Biome |
pnpm format:check | Check formatting |
Create a new branch from main:
git checkout -b feature/my-change
Make your changes:
packages/motia/packages/stream-client*/playground/steps/Run checks:
pnpm build && pnpm lint && pnpm test
Coverage command:
pnpm test:coverage
Commit, push, and open a pull request.
For detailed guidelines, see CONTRIBUTING.md.
This project is licensed under the Apache License 2.0.