Skip to Content
CLI

CLI

Copy components and backend modules into your app as source, then merge upstream changes.

source-onlyNot on npm: run from the repo

@dapplelight/signet-cli is not on npm (npm view @dapplelight/signet-cli is a 404). Run it from a clone of the repo.

Run from source (today)

git clone https://github.com/dapplelight/signet.git
cd signet
bun install
bun run --cwd packages/cli build   # writes dist/registry.json
cd ../my-app                       # your app, next to the clone
bun ../signet/packages/cli/src/index.ts add dialog
  Added utils, button, dialog (signet-ui 0.4.0).
    wrote lib/utils.ts
    wrote components/ui/button.tsx
    wrote components/ui/dialog.tsx
    wrote lib/labels.tsx

  Install the npm packages these need:
  bun add "clsx@>=2.0.0" "tailwind-merge@>=3.0.0" "@base-ui/react@>=1.3.0" "class-variance-authority@>=0.0.0" "lucide-react@>=1.0.0" "react@>=19.0.0"

Then import from your copy:

import { Dialog } from "@/components/signet/components/ui/dialog"

Elsewhere in these docs path/to/signet stands for your clone, so bun path/to/signet/packages/cli/src/index.ts add dialog is the same command. Below, signet is short for that command.

After 1.0

Not available yet. Once the package is published:

npx @dapplelight/signet-cli add dialog   # not available yet
signet add dialog                        # after installing it; not available yet

Commands

CommandWhat it does
signet add <name...>Copy items and their dependencies into the app as source. signet add auth payments wires backend modules into an api-template app.
signet upgrade [name...]Merge upstream changes into added items (default: all), then run the codemods your installed Signet versions need.
signet diff <name>Show what changed upstream since you copied the item.
signet listEvery item, with what is added, edited or out of date.
signet theme <hex>A whole theme from one brand colour.
signet conformance <url>Check a backend against the Signet wire contract.
signet checkTypecheck, lint and check Signet conventions in this app.

Flags

FlagApplies toWhat it does
--forceaddOverwrite files you have edited.
--dry-runupgradeReport what would change; write nothing.
--no-installaddPrint the install command instead of running it.
--dir <path>addWhere copies go. Default src/components/signet; saved in signet.json.
--alias <prefix>addImport prefix for that dir. Default @/components/signet. "" keeps relative imports.
--cwd <path>allApp root. Default: current directory.
--registry <file>allUse this registry.json instead of the bundled one.
--jsonallPrint the result as JSON.

Components

Any subpath of signet-ui's exports map is an item: button, data-table, utils, behaviors, trend-chip. Run signet list for every name.

add prints the npm packages the copies need that your package.json lacks. It never overwrites a file you edited when signet-ui also changed it: it writes nothing, lists the files and points to signet upgrade. --force overwrites them.

Backend modules

Five modules wire Signet's server packages into an app made with create-signet-app --template api.

ModuleFilesWires
authsrc/server/auth.tsStored sessions: signIn, requireAuth, /api/sessions; SESSION_SECRET.
dbsrc/server/db.ts, schema.tssignet-db on D1 (binding DB): dbFor, a table, the audit log.
adminsrc/server/admin.ts/api/admin over the schema, deny by default. Adds auth and db.
paymentssrc/server/payments.tsRazorpay and Stripe, the webhook inbox at /webhooks/:gateway; their keys.
notifysrc/server/notify.tsA notifier with one template, unsubscribe and Resend webhook at /notify.

Each adds an import and a .route(...) line to src/app.ts, its keys to envSchema in src/env.ts, and entries to .env.example. Running it again adds nothing twice. Where an anchor is missing, it prints the lines to add by hand.

It then installs the npm packages with the app's package manager, read from its lockfile. --no-install prints the command instead.

Upgrade

signet diff dialog          # what changed in signet-ui since you copied it
signet upgrade --dry-run    # what an upgrade would do
signet upgrade dialog       # or no name: every added item
Your copyOn upgrade
Never editedReplaced.
Only you changed itKept.
Both changed itgit merge-file (base, upstream, yours).

Where the same lines changed on both sides, the file keeps git conflict markers: yours under <<<<<<< app, signet-ui's under =======, closed by >>>>>>> signet-ui <version>. The command exits 1 when any file has conflicts or could not be merged. Without git, edited files are reported as needs-merge and left untouched.

Codemods

upgrade also migrates your own code when an installed package needs it, once per app (recorded in signet.json). --dry-run prints the diffs.

  • signet-ai 0.4: generateObject becomes generateText({ output: Output.object({ schema }) }), result.object becomes result.output.
  • signet-db: each setPlan( call is listed.
  • signet-server after 0.4.0: each registerIngest( without a userId resolver or trustClientUserId is listed.

Configuration

signet.json at the app root; add creates it on first use.

signet.json
{
  "dir": "src/components/signet",
  "alias": "@/components/signet",
  "items": { "dialog": { "version": "0.2.2", "hash": "…" } },
  "files": { "components/ui/dialog.tsx": "…" }
}

.signet/base/ holds the copies exactly as written; upgrades merge against them. Commit both signet.json and .signet/.

Conformance

signet conformance http://localhost:3000 --json-path /api/json

It runs the cases from Spec: Conformance against a live backend and prints one line per case, pass or fail with the reason. It exits 1 when any case fails, otherwise 0. It does not need a registry or an app directory.

FlagApplies toWhat it does
--auth-prefix <path>conformanceWhere the client-login routes are mounted. Default /api/auth.
--ingest <path>conformanceThe analytics ingest route. Default /api/analytics.
--sessions <path>conformanceWhere the session routes are mounted. Default /api/sessions.
--json-path <path>conformanceA route that parses a JSON body. Without it invalid-json-400 fails as not run.
--jsonconformancePrint the report as one line of JSON.

Check

signet check --api http://localhost:8787 --pages /dashboard

The verify loop for code an agent wrote. Run it from the app root. It runs five steps in order and prints one line for each: typecheck (tsc --noEmit), lint (Biome), conventions, conformance and pages. The last two are skipped unless you pass --api or --pages. It exits 1 when any finding is an error, otherwise 0.

conventions reads your source for three rules. env-module-scope: server code reads process.env at import time. error-handler: a Hono app has no Signet errorHandler, so errors are not the Signet envelope (a warning). raw-colour: a hex or rgb() colour, or a stock Tailwind colour such as bg-red-500, where a theme token belongs. A --name: #hex line is a token definition and is allowed.

pages opens each page at 390 and 1280 px wide, saves a screenshot to .signet/check/ and runs axe. Every axe violation is an error whose rule is axe/<id> and whose fix is axe's help text. It uses the app's own @playwright/test and axe-core, so add both as dev dependencies and run bunx playwright install chromium once. Start the app's dev server first.

FlagWhat it does
--api <url>Also run the conformance suite against this backend. It takes the conformance flags (--auth-prefix, --ingest, --sessions, --json-path).
--pages <path...>Screenshots and axe for these pages. A path like /dashboard is read from --web; a full URL is used as it is.
--web <url>The dev server that serves --pages. Default http://localhost:5173.
--jsonPrint one line of JSON instead.
--cwd <path>App root. Default: current directory.
    fail  typecheck  (1 error)
      src/types.ts:1  typecheck  TS2322: Type 'string' is not assignable to type 'number'.
        fix: Fix the type error; `tsc --noEmit` shows it in full.
    pass  lint
    fail  conventions  (1 error)
      src/server/app.ts:2  env-module-scope  Reads process.env at import time.
        fix: Declare the key in the createEnv schema (@dapplelight/signet-server/env) and read `env.KEY` inside the handler, after initRuntimeEnv(c.env).
    skip  conformance  (no --api)
    skip  pages  (no --pages)

  2 errors in 2 files.

With --json the result has the same shape as the MCP check_app tool, plus the screenshot paths:

{
  "ok": false,
  "errors": 1,
  "warnings": 0,
  "findings": [
    {
      "file": "src/server/app.ts",
      "line": 2,
      "rule": "env-module-scope",
      "level": "error",
      "message": "Reads process.env at import time.",
      "fix": "Declare the key in the createEnv schema (@dapplelight/signet-server/env) and read `env.KEY` inside the handler, after initRuntimeEnv(c.env)."
    }
  ],
  "passed": ["typecheck", "lint"],
  "screenshots": []
}

line and file are null when a finding has no place in a file. A tool that cannot run (no tsc, no browser, an API that is down) is a finding too, never a crash.

Theme

signet theme "#e11d48" --base cinematic --out src/brand.css
signet theme --import tokens.json --out src/brand.css
FlagValuesDefault
--baseeditorial, cinematic, financeeditorialShipped theme to layer over.
--modelight, dark, bothboth
--densitycompact, comfortable, spaciousnoneFor the whole app.
--formatcss, tokens, figmacsstokens is W3C Design Tokens JSON; figma is the Variables API body.
--import <file>W3C Design Tokens JSONnoneRead a token file instead of a hex colour.
--out <file>pathstdoutWrite here.

Tokens moved to meet contrast are printed to stderr, so stdout stays a clean file. See Tokens.