CLI setup
The PWFabric CLI lets you create, develop, validate, and publish surfaces from your terminal.
1. Install the CLI
Install the CLI globally using pnpm:
pnpm add -g @pwfabric/cli
# Verify installation
pwfabric --version2. Authenticate
Log in with your PWFabric account. This opens a browser window for OAuth2 authentication:
pwfabric login
# After authenticating, verify your identity
pwfabric whoami
# → Logged in as alice@example.com (world: my-team)3. Create a project
Scaffold a new surface project from a template:
pwfabric create my-landing-page
# Choose a starter template:
# ❯ Blank Surface
# Landing Page
# Portfolio
# Blog
# E-commerce
cd my-landing-page4. Start development
Start the local development server with hot-reload:
pwfabric dev
# → Local: http://localhost:3000
# → Studio: http://localhost:3000/studio
# → API: http://localhost:4000/health5. Validate & publish
Validate your surface schema and publish when ready:
# Validate surface JSON against the schema
pwfabric schema:validate
# Publish to your World
pwfabric publish
# → Published my-landing-page v1.0.0
# → Live at: https://my-team.phiwebs.com/my-landing-pageCommand reference
| Command | Description |
|---|---|
pwfabric login | Authenticate via OAuth2 browser flow |
pwfabric logout | Clear stored credentials |
pwfabric whoami | Show current user and World |
pwfabric create <name> | Scaffold a new project from template |
pwfabric dev | Start local dev server with hot-reload |
pwfabric schema:validate | Validate surface JSON schema |
pwfabric schema:generate | Generate TypeScript types from schema |
pwfabric schema:migrate | Run schema migrations |
pwfabric publish | Publish surface to your World |
pwfabric world:list | List available Worlds |
pwfabric world:switch <id> | Switch active World context |
Next steps
- Quick start — Build your first surface in 5 minutes.
- Custom blocks — Create your own block types with
defineBlock().