Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@polyhedral/cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@polyhedral/cli
CLI for building custom character sheet templates on Polyhedral. Edit locally in your own editor, push to the server, and preview changes live.
Install
npm install -g @polyhedral/cliRequires Node.js 20+. Or use npx @polyhedral/cli without installing.
Quick Start
# Log in with your API key (get one from Connected Apps in your account settings)
polyhedral login
# Scaffold a new template project
polyhedral init my-sheet
cd my-sheet
# Start the live preview loop — edit, save, see it update
polyhedral devCommands
| Command | Description |
|---|---|
polyhedral login |
Authenticate with your API key |
polyhedral logout |
Remove stored credentials |
polyhedral whoami |
Show current login status |
polyhedral init |
Scaffold a new template project |
polyhedral dev |
Watch file, auto-push on save, open live preview |
polyhedral push |
Validate, upload, and publish a new version |
polyhedral pull |
Download a template to a local file |
polyhedral delete |
Delete a template |
polyhedral list |
List all your custom sheet templates |
polyhedral versions |
List version history for a template |
polyhedral validate |
Check a template file for syntax errors (offline) |
Push Options
polyhedral push # Patch bump (default)
polyhedral push --minor # Minor version bump
polyhedral push --major --changelog "breaking changes description"
polyhedral push -f # Skip confirmation promptGlobal Options
| Flag | Description |
|---|---|
--json |
Output structured JSON (skips prompts, useful for CI) |
--version |
Show CLI version |
--help |
Show help |
Commands that modify data (push, pull, delete) prompt for confirmation. Use --force / -f to skip, or --json which implies --force.
Build Types
The CLI supports two build types, chosen during polyhedral init:
In-App (default)
Templates are JSX files using the Polyhedral component library (Sheet, Section, EditableText, etc.). The platform compiles and renders them for you. Validation runs offline via Babel before each push.
polyhedral init my-sheet # select "In-App"External
For pre-built templates — plain HTML/JS, or output from a bundler like Vite or webpack. You control the full HTML document; the Polyhedral SDK scripts are automatically injected into <head> at render time.
JSX validation is skipped for external builds since the file isn't JSX. You'll see a "Skipping JSX validation (external build)" message during push, dev, and validate.
polyhedral init my-sheet # select "External"Use external when you want to:
- Use a framework like React, Vue, or Svelte with your own build step
- Write plain HTML/CSS/JS without JSX
- Bundle with Vite, webpack, or another tool
- Have full control over the document structure
How It Works
Templates are JSX files (in-app) or HTML files (external) using the Polyhedral SDK. The CLI wraps the REST API to manage templates from the terminal.
The dev command is the main workflow: it pushes your template, opens the preview page, and watches for file changes (including polyhedral.json). When you save, it validates locally and pushes automatically. The preview page uses realtime subscriptions, so it updates without a manual refresh.
Validation runs offline using Babel — no network connection or login required.
Docs
Full documentation at polyhedral.co/developers/cli.
License
MIT