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 @phimajor-solutions/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
# → alice@example.com · World: wld_abc1233. Create a project
Scaffold a new surface project from a template:
pwfabric create my-landing-page
cd my-landing-page4. Start development
Start the local development server with hot-reload:
pwfabric dev
# → Local: http://localhost:30005. Validate & publish
Validate your surface schema and publish when ready:
# Validate surface JSON against the schema
pwfabric schema:validate
# Publish the surface to your World
pwfabric surface publish
# → Published my-landing-page v1.0.0Command 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 |
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 surface create / list / inspect / preview / publish / delete | Surface lifecycle from the terminal |
pwfabric publish · pwfabric search | Publish / search marketplace items |
pwfabric pwpack:init <dir> | Scaffold a pwpack source directory |
pwfabric world:list / switch / info | World context management |
Next steps
- Quick start — Build your first surface in 5 minutes.
- Custom blocks — Create your own block types with
defineBlock().