Skip to main content
The @widgetic/cli package (current release 0.1.17) is the whole of Widgetic in one command, widgetic, with two halves:
  • widgetic api <group> <command> runs one operation of the public REST API: 159 of them today.
  • widgetic mcp <command> runs one AI build tool of the MCP server: 56 today, at tool contract 1.26.0.
Nobody writes the commands by hand. Each one is generated from the contracts that the API and the MCP server publish, so the CLI knows an operation or a tool the day it is released, and every command takes --json and --dry-run. Prefer to let your agent set it up? Copy the setup prompt from the Command line tab: it installs the CLI, adds a short Widgetic section to AGENTS.md and checks the setup with widgetic doctor.

Install and sign in

1

Install the CLI

The CLI needs Node 22.12 or later.
2

Make an API key

In the dashboard, open Settings → API keys, name the key and choose what it may do. Choose Full access if you want to use widgetic mcp: the MCP server refuses a key that is limited. API keys explains which key you need.
3

Save the key

The CLI asks for the key without showing it, checks it with the server and saves it. A script or a CI job skips this step and sets WIDGETIC_API_KEY instead; see Configuration.
4

Check the setup

It checks the CLI, the key, the REST API and the MCP server, and says which workspace the key works in. When something is wrong it says what to do about it.

Make your first calls

widgetic on its own prints the menu: the commands, the first steps and a few examples. --help works at every level: widgetic api --help lists the groups of the REST API, and widgetic api widgets --help the commands of one group. To see everything one command takes, with the JSON Schema its input is checked against, print its schema:
Not sure what a call would do? Add --dry-run. It prints the exact request, with the key left out, and sends nothing. It needs no key.

Build a widget

A build takes a few minutes. Without --wait the command answers at once with the widget_id and the build goes on in the background. With it, the CLI asks again every few seconds and prints the finished widget, for up to 15 minutes. Scripts and CI has the details. What the CLI builds stays a draft until you say otherwise: it sends publish: false unless you pass --publish. Look at the preview first, then publish and embed:
publish-widget answers with the composition_id that get-embed-code takes, and --format is html (the standard JavaScript embed code, and the default) or iframe (for a page that cannot run a script).
Each create-widget and revise-widget call uses a credit, charged when the build starts. If a build command fails or times out, run widgetic mcp list-widgets before you run it again: the build may have started.

Where to go next

Configuration

The key, profiles, environment variables, the files the CLI keeps and how it updates itself.

Keys and workspaces

Which commands need a partner key, which workspace a change goes to and what a plan changes.

Scripts and CI

Exit codes, retries, waiting for a build and a recipe for GitHub Actions.

Find a command

How a command maps to an endpoint of the API reference, and how to look one up in the terminal.