Wayfront CLI

The Wayfront CLI brings your whole workspace to the terminal. List and update orders, clients, and invoices, manage your portal templates, or call any API operation directly. It’s all scriptable from your local machine, and plays nicely with git.

Requirements

Node.js 18 or higher. If you’re unsure, run node -v in your terminal to check.

Installation

You can use the CLI without installing globally:

npx wayfront

Or install it globally so you can run wayfront directly:

npm install -g wayfront

Sign in with wayfront auth login. Add a workspace slug, like wayfront auth login clientco, when you want to name the saved session. Your browser opens, you log in to your workspace, and the CLI keeps the session. There’s nothing to copy or paste.

Run wayfront auth status to see which workspace you’re connected to, or wayfront auth logout to end the session.

Running it through npx? Put npx in front of every command, like npx wayfront templates pull.

Working with your workspace data

You don’t have to memorize anything. Run wayfront --help for the full list of commands, or wayfront <resource> --help to see what a specific resource supports. The examples below are just a taste.

The CLI reaches your whole workspace, not just templates. Many resources (orders, clients, invoices, services, subscriptions, team members, coupons, and more) support common operations like these:

wayfront orders list
wayfront orders get ord_123
wayfront clients create --json '{"email":"jane@example.com","name":"Jane"}'
wayfront invoices update inv_123 --json '{"status":"paid"}'
wayfront tickets delete ticket_123

Some resources add their own verbs. Invoices, for example, can be charged or marked as paid:

wayfront invoices charge inv_123 --json '{"payment_method":"manual"}'
wayfront invoices mark-paid inv_123

The raw API escape hatch

Need something the resource commands don’t cover yet? Call any API operation directly. List the available operations, then run one by its ID:

wayfront api list Orders
wayfront api call ordersUpdate order=ord_123 --json '{"status":"paid"}'

Raw API commands use your signed-in CLI session and workspace permissions. The public Integration API add-on on the pricing page is still separate.

Working with templates

Templates can be saved and modified locally.

Pulling templates

To download all templates from your workspace:

wayfront templates pull

This creates a templates/ folder in your current directory containing all your workspace templates as .twig files.

To pull a single template:

wayfront templates pull layouts.main

Editing templates

Templates use dot-notation that maps to a folder structure. For example, portal.dashboard becomes templates/portal/dashboard.twig. Open and edit these files in any code editor.

Pushing changes

To push a specific template back to your workspace:

wayfront templates push layouts.main

To push all modified templates at once:

wayfront templates push

Changes go live immediately. You can verify by logging in as a client to preview the updated template.

Resetting a template

To restore a template to its default state:

wayfront templates reset portal.dashboard

Working with multiple workspaces

You can connect more than one workspace and switch between them:

wayfront auth login clientco
wayfront workspace use acme

Visit the Wayfront CLI repository on GitHub for the latest updates.