GuidesCLI guide

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 --version

2. 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_abc123

3. Create a project

Scaffold a new surface project from a template:

pwfabric create my-landing-page
 
cd my-landing-page

4. Start development

Start the local development server with hot-reload:

pwfabric dev
 
# → Local: http://localhost:3000

5. 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.0

Command reference

CommandDescription
pwfabric loginAuthenticate via OAuth2 browser flow
pwfabric logoutClear stored credentials
pwfabric whoamiShow current user and World
pwfabric create <name>Scaffold a new project
pwfabric devStart local dev server with hot-reload
pwfabric schema:validateValidate surface JSON schema
pwfabric schema:generateGenerate TypeScript types from schema
pwfabric schema:migrateRun schema migrations
pwfabric surface create / list / inspect / preview / publish / deleteSurface lifecycle from the terminal
pwfabric publish · pwfabric searchPublish / search marketplace items
pwfabric pwpack:init <dir>Scaffold a pwpack source directory
pwfabric world:list / switch / infoWorld context management

Next steps

  • Quick start — Build your first surface in 5 minutes.
  • Custom blocks — Create your own block types with defineBlock().