login and logout

Docs

connect hands your agent one design system you already made. login hands it your account, so it can make one: ask it to create a design system for this app, and it reads your codebase, writes a recipe, creates the project in your account, and adds its UI kit.

setup signs in the same way, then adds the design system.

How to use it

npx designsource login [--apps claude,cursor,vscode,codex,gemini] [--yes] [--api <origin>]
npx designsource logout [--api <origin>]

You run login, not your agent, in your own terminal, once per computer and once per project folder. It prints a code, opens the page in your browser and waits:

Signing in for /Users/you/my-app
Open https://designsource.app/device and enter BCDF-GHJK
No account yet? Sign up on that page; it's free.
Waiting for you to approve it in the browser… (Ctrl+C to stop)
Signed in as you@example.com on this computer.
Saved the sign-in in the macOS keychain ✓

A line per coding app follows, saying what was written to its settings file.

In the browser, signed in with a verified email, type the code, check what the page shows (the computer's name, where the request started, how long ago, what it may do) and approve. An unverified email address is asked to verify first, with a Resend email button, and the page continues by itself once it is. Only approve a code you started yourself, just now. Then restart your coding app and ask it to create a design system for this app.

Flag Does
--apps The apps to set up, comma-separated, skipping the question.
--yes The apps found on this computer, no questions.
--api Sign in to another server. Outside a terminal only the default or a server on this computer.
--store file Keep the sign-in in the private file instead of the keychain, moving one already saved there first. For a coding agent whose sandboxed shell cannot read the keychain.

logout revokes this computer's sign-in on the server and removes it, with its trusted folders, from this computer. Settings files are left.

How it works

The sign-in is an account token that goes to this computer's private store, as connect's token does. The index beside it, account.json, holds the account's email, its trusted folders and which design system each folder uses. In the project, each app's MCP settings get the entry npx -y designsource@latest mcp: no --project, no token. Commit it: worktrees and teammates get the server only from a committed copy.

Trusted folders. The account is used only in the exact project folders you ran login in: the nearest folder holding .git, not merely somewhere inside one, so a repository cloned under a trusted one is not trusted. A git worktree of a trusted repository is trusted with it: login run inside a worktree signs in its main repository and writes the settings files in the worktree. The check reads git's own files and needs the main repository to name the worktree back, so a .git file written by hand elsewhere claims nothing. Each folder links to one design system, the one your agent last created or picked there. A folder set up earlier with connect keeps its --project entry for that app; login says so and names the file to edit.

A second login in a terminal on a computer already signed in skips the browser and only trusts the new folder, unless the saved sign-in predates screen generation, which asks for a fresh approval; outside a terminal it always asks for a fresh approval.

The agent's tools. In a trusted folder, list_design_systems, create_design_system and use_design_system act on your account; every other tool, add_ui_kit included, reads the folder's linked design system. Your client asks before create_design_system runs. generate_screen makes screens in the linked design system. Creating is free; adding the kit and reading the tokens need Pro.

Permissions. The approval page lists what the sign-in may do: create design systems, read them, and create screens (screens:create). A sign-in made before screens could be generated lacks the last one; login notices and asks for a fresh approval that replaces it, and until then generate_screen answers Your sign-in predates screen generation. Run npx designsource login again in this folder.

Revoking. logout here; from anywhere, the profile page's Coding apps card lists every approved computer and revokes one or all. A password change, unlinking a sign-in method or deleting the account ends every sign-in too, and an unused one expires after 90 days. The code itself lives 10 minutes and works once. Your account is emailed when a computer is approved.

The account token never lands in a repository file, a command line, an environment variable or a tool result. It is sent only to the server it was saved for, and used only in folders you signed in. Known limit: a repository's committed .npmrc can point npx at another registry, which swaps any package the repository starts, this one included. Only let repositories you trust start MCP servers.

What can go wrong

  • Run npx designsource login inside a project folder (one with a .git folder or a package.json). Run it inside the app's repository, in your own terminal; the nearest folder holding .git becomes the trusted project folder, and a folder with only a package.json counts too. Your home folder, its parents, a filesystem root and a bare folder are refused.
  • Sign-in was denied in the browser. or The code expired. Run npx designsource login again.
  • Could not reach the server to revoke this sign-in; revoke it on your profile page. from logout when the server is down; the local sign-in is still removed.
  • An agent that finds no sign-in says so and names the folder to run login in.

Not connected? The server runs on this computer over stdio; there is no web address for it. Run login here, commit the settings file it writes, and restart the app. For an app that is its own repository inside a workspace, see a workspace of repositories.