Command line
Every knighn command, what it does and how to run it.
The knighn command imports websites, code projects and files as designs, exports designs, keeps designs in a code project and looks inside a design. Install it from the Mac app. Run knighn <command> --help for the same details in Terminal. Most commands take --json for output an agent or a script can read.
Your account and designs
| Command | What it does |
|---|---|
knighn login |
Sign the knighn command in to your Knighn account, in the browser. |
knighn logout |
Sign the knighn command out of your Knighn account. |
knighn ls |
List your designs on Knighn, newest first. |
knighn zed |
Open a folder, a file or a design on Knighn in Zed, on this Mac or over SSH. |
knighn run |
Run an execute snippet (the TSX API agents use) on a design on Knighn. |
knighn search |
Search a design, the design skill, templates, icons, fonts and your files. |
knighn logs |
Follow the changes to your designs on Knighn, and errors with --errors. |
Code projects
| Command | What it does |
|---|---|
knighn dev |
Sign in, set up knighn/ and pick designs on the first run, then sync design folders with Knighn both ways. |
knighn init |
Make knighn.json and the knighn/ folder of designs in a code project. |
knighn pull |
Write a design on Knighn to knighn/<design>/ as React source. |
knighn push |
Send design folders in knighn/ to Knighn (each to its linked design, or a new one) |
knighn open |
Open a code project in a project tab of the Knighn app, on this Mac or another. |
knighn screens |
Draw every route of a code project (Next.js, Vite, TanStack Start, Expo web) as PNG files. |
knighn drift |
Compare a project's frames with their visual test baselines (*.knighn.spec.ts) |
knighn edit |
Edit JSX in project files with the project tab edit engine: select elements with a query, then change classes, text or props. |
Import, export, and look inside .fig and .pen files
| Command | What it does |
|---|---|
knighn import |
Import a code project (every route), a site, a design file or HTML into Knighn. |
knighn export |
Export a Knighn design (.html) to PNG, JPG, PDF, .fig, .pen, SVG or Expo SwiftUI code, or a document to PNG, JPG, WEBP, SVG, PDF, PPTX, JSX, HTML or .fig. |
knighn convert |
Convert a document to another writable format. |
knighn formats |
List supported document and export formats. |
knighn simulator |
Capture booted iOS Simulator screens as editable designs. |
knighn launch-assets |
Launch assets: pull a launch into a repo. |
knighn info |
Show document info (pages, node counts, fonts) |
knighn pages |
List pages in a document. |
knighn tree |
Print the node tree. |
knighn find |
Find nodes by name or type. |
knighn node |
Show detailed node properties by ID. |
knighn query |
Query nodes using XPath selectors. |
knighn variables |
List design variables and collections. |
knighn libraries |
Manage component library catalogs. |
knighn analyze |
Analyze design tokens and patterns. |
knighn lint |
Lint design documents for consistency, structure, and accessibility issues. |