CLI Overview
The Nativeblocks CLI manages your project, syncs integrations, generates the typed DSL, and deploys frames to production.
The Nativeblocks CLI is the primary tool for working with frames. You use it to set up your project, register blocks and actions, write and deploy frames, and manage releases.
What you can do
| Task | Command |
|---|---|
| Set up a project | nativeblocks init: authenticate, select org and project, scaffold frame files |
| Sync integration | nativeblocks integration sync: push a generated schema to the server |
| Generate the typed DSL | nativeblocks code-gen: pull integrations and generate typed frame builder functions |
| Develop with hot reload | nativeblocks frame deploy --watch: re-deploy on every save, push to connected devices |
| Ship to production | nativeblocks frame deploy --tag: create a versioned release for the Dashboard |
| Automate in CI | Token auth + --id flags + --force. No interactive prompts. |
DSL languages
Frames are written in Kotlin, TypeScript, or Swift. All three languages compile to the same frame definition at deploy time.
| Kotlin | TypeScript | Swift | |
|---|---|---|---|
| File extension | .kt | .ts | .swift |
| Entry point | fun frame(): NativeblocksFrame | function frame(): NativeblocksFrame | func frame() -> any NativeblocksFrame |
| Best for | Android teams already on Kotlin | Web or cross-platform teams | iOS teams already on Swift |
Typical workflow
# 1. First-time setup
nativeblocks auth login
nativeblocks organization set
nativeblocks project set
nativeblocks init
# 2. After annotating a new block or action
nativeblocks code-gen
# 3. During development
nativeblocks frame deploy -f src/home.ts --watch
# 4. Shipping to production
nativeblocks frame deploy -f src/home.ts --tag v1.2.0 --force
Guides
| Guide | When to use |
|---|---|
| First-time Setup | Starting a new project |
| Sync integration | After annotating a new component |
| Develop with Hot Reload | During active frame development |
| Deploy to Production | Shipping a tagged release |
| CI/CD Integration | Automating deploys on push or merge |