uidudevelopers
ToolsCLI

Overview

The uidu CLI — read a workspace, scaffold an app, and provision content from your terminal or an AI coding agent.

@uidu/cli (binary: uidu) wraps @uidu/client in a command-line tool. It's built to be driven by humans and AI coding agents (e.g. Claude Code) alike: read a workspace, scaffold a new project, and provision content — all with machine-readable --json output.

uidu login                         # browser sign-in (OAuth + PKCE)
uidu stories list --json           # read
uidu events create --name "Launch" # write (needs a Bearer token)
uidu create my-app -t events       # scaffold

Reads vs writes — where each runs

The CLI and the client share one rule, because they share one engine:

OperationAuthWhere it can run
Reads (list / get)public tokenanywhere — CLI, server, and the browser
Writes (create)account Bearer tokenCLI and server-side frontend only

Never ship the account token to the browser

Authoring (create…) authenticates as your account via a Bearer token. Keep it server-side — the CLI (uidu login), a Next.js server action, a route handler, or an RSC. The same write functions live in @uidu/client, so anything you can do from the CLI you can do from your backend; just never expose the Bearer token in a client component.

Install

The CLI ships with the SDK. Run it with your package manager's dlx/npx, or install it globally:

npx @uidu/cli --help
# or
npm install -g @uidu/cli

Configuration

Every command resolves connection + auth in this order: CLI flags → environment (UIDU_*) → ~/.uidu/config.json (written by uidu login).

EnvPurpose
UIDU_WORKSPACEWorkspace slug (required)
UIDU_PUBLIC_TOKENRead-only token (safe to expose)
UIDU_API_KEYAccount Bearer token for authoring (server-only)
UIDU_PROJECT_IDDefault project for CMS reads
UIDU_ENDPOINTOverride the GraphQL endpoint

Continue with Login → or the Command reference →.

On this page