setup is the command to start with. It reads your folder, signs you in, picks or makes a design system, puts it into the app and connects your coding agent, asking only what it cannot tell. Typing npx designsource with no command runs it.
How to use it
npx designsource
npx designsource setup [--api <origin>] [--store file] [--no-rules]
npx designsource --store file
npx designsource --menuRun it in a terminal, in your app's folder. The first line says what it found, for example:
Next.js app (React 19, Tailwind 4, shadcn). No design system here yet.Then, depending on the folder:
| The folder holds | What setup does |
|---|---|
| A React app | Adds every component and the /design-system section, without the blocks, and connects your agent. npx designsource add --blocks adds the blocks later. |
| A React app already set up | Says what is there and offers Update from “<name>”, Use a different design system or Something else…. Enter updates. |
| Nothing (or only dotfiles) | Offers to create a new Next.js app here, wearing your design system. |
| Another stack | Says what it found, then stops with DS source supports React apps only for now. Vue, Svelte, Angular and plain CSS are coming later. Nothing is signed in, fetched or written. |
--menu shows the list of commands instead, as does every Something else…. --api picks another server. --store file keeps this computer's tokens in the private credentials file instead of the keychain, moving the ones saved for this folder there first: run it once when your coding agent's sandboxed shell cannot read the keychain. --no-rules leaves an existing app's AGENTS.md and CLAUDE.md alone, as add --no-rules does; a new app keeps the starter's.
setup needs a terminal. In a script, or for an agent, name the command you mean: add, connect or login.
How it works
Signing in. A folder connect set up with a project token keeps using it, with no sign-in. Otherwise setup signs in as login does: a code to enter at the signed-in origin's /device page, once per computer. A computer already signed in only adds this folder.
Your coding apps. When more than one coding app is installed and none is set up yet, setup asks which to set up, before signing in. Each app's settings file gets the designsource entry, with no token in it, so you can commit it. The settings are written right after signing in, so stopping later leaves them in place.
The design system. A folder already linked to one uses it and says Using “<name>”. Otherwise you pick one of your design systems, newest first, or Make a new one. That opens your projects page in the browser and waits, up to 30 minutes, for the one you save there; it then continues by itself. If two new design systems appear, it asks which. The choice is saved as the folder's link, so add and create use it later with no token.
Your plan. Exports need Pro. On the free plan setup says so and asks Upgrade to Pro now?. Yes opens your Credits page at your plan card, where Subscribe takes you to payment, and the terminal waits, up to 30 minutes, then adds the kit by itself once Pro is on. Not now still signs you in, links the design system and connects your agent, adding nothing to the app; run it again after upgrading.
The kit. In a React app this is add with every component and the section: files you edited are kept and files designsource did not write are asked about, as always. In an empty folder it is create in the folder itself (a folder holding dotfiles other than .git stops rather than overwrite them).
The closing lines name the apps to restart, say to commit the settings files, and, when the kit went in, suggest what to ask your agent next, such as restyling the app's existing screens with the design system.
What can go wrong
setup asks questions, so it needs a terminal. In a script, use add, connect or login.It was run from a script or an agent's shell.This is a workspace root. Run npx designsource in the app's own folder (apps/web, say).Run it in the app's folder instead.This folder is neither a repository nor an app. Run npx designsource in your app's folder.The folder has files but no.gitand nopackage.json.Still waiting? Run npx designsource again once your design system is saved.The wait for a new design system ran out. Your sign-in and agent settings are kept, and the next run picks up where this one stopped.DS source supports React apps only for now. Vue, Svelte, Angular and plain CSS are coming later.The folder holds another stack; see React only for now.- An app on React 18, or in plain JavaScript, cannot take the UI kit.
setupsays so first and connects your agent only.
Related
- Overview and install.
- Tokens and credentials: the account link, and what is never printed.
- CLI errors.