CLI
Add QuiverAI creations to your React project as components.
The QuiverAI CLI turns a creation into a React component in your project. It writes one .tsx or .jsx file that exports a self-contained component, and edits no other file.
It needs Node.js 22.12 or later. There is nothing to install: run it with npx.
Add a creation from the app
-
Open the creation in the QuiverAI app and choose Export.
-
Select Add to codebase. The app copies a command like this one:
npx quiverai add "https://app.quiver.ai/creations/<CREATION_ID>?version=<VERSION_ID>" -
Run it in your codebase. The first time, the CLI opens your browser to sign in.
The CLI prints the file it wrote and the line to import it:
Added FoxLogo to src/components/quiverai/fox-logo.tsx
import { FoxLogo } from "@/components/quiverai/fox-logo";
The component takes width, height and className props:
<FoxLogo width={32} height={32} />
The command pins the version you exported, so running it again later adds the same artwork even after you keep editing the creation.
Other things you can add
# A creation by id, with your own component name
npx quiverai add <CREATION_ID> --name logo
# The newest creation in a Chat
npx quiverai add https://app.quiver.ai/chat/<CHAT_ID> --latest
# A public share link (no sign-in)
npx quiverai add https://app.quiver.ai/share/<SHARE_ID>
# Any SVG file on the web (no sign-in)
npx quiverai add https://example.com/logo.svg --name logo
Where the file goes
The CLI uses the first of these that applies:
--path <dir|file>."quiverai": { "dir": "<path>" }in yourpackage.json.- The
componentsalias incomponents.json(shadcn projects), in aquiverai/folder. src/components/quiverai/ifsrc/exists.components/quiverai/.
The file is .tsx when the project uses TypeScript and .jsx otherwise. In a monorepo, run the command in the app’s folder or pass --cwd ./apps/web.
Without --name, the component is named after the creation’s file name, or the SVG URL’s file name: fox-logo.svg becomes FoxLogo in fox-logo.tsx. In a terminal, the CLI asks for the name with that suggestion filled in.
The CLI never replaces a file silently. If the file exists with different content, it asks first; outside a terminal, pass --overwrite.
Options
| Option | Description |
|---|---|
--name <name> |
Component name, in any case (fox logo, fox-logo, FoxLogo). |
--latest |
For a Chat link, add the newest creation without asking. |
--path <dir|file> |
Write to this folder or file. |
--cwd <dir> |
Project folder. Defaults to the current folder. |
-o, --overwrite |
Replace an existing file with different content. |
--yes |
Skip prompts: use the suggested name and replace a changed file. |
--dry-run |
Show what would be written, without writing. |
Sign in
Creation and Chat links need your QuiverAI account. Share links and SVG URLs do not.
npx quiverai login # sign in through your browser
npx quiverai whoami # show the signed-in account
npx quiverai logout # sign out
On a machine without a browser, such as over SSH, press H at the sign-in prompt. Open the link on any device, approve, then paste the URL your browser lands on.
The CLI keeps your credentials in your OS keychain when one is available, and otherwise in a file only your user can read.
Scripts and CI
The CLI never prompts when it cannot. A run is non-interactive when you pass --non-interactive or --json, when CI is set to anything but empty, 0 or false, or when stdin or stderr is not a terminal. add then uses the suggested name, fails when a file differs and --overwrite is missing, and asks for --cwd or a creation id where it would have shown a picker. It never starts a sign-in; it fails and names quiverai login. login itself needs a terminal. --yes is unchanged.
Exit codes
| Code | Meaning |
|---|---|
0 |
Success. Declining the overwrite prompt and a logout with nothing to remove are successes. |
1 |
The command ran and failed: not signed in, not found, no access, a file in the way, the network, a request over 60 seconds, or an unexpected error. |
2 |
The command line is wrong or input is missing: an unknown option or command, an invalid value, a missing argument, or a choice that needs a terminal. |
130 |
A prompt was canceled with Ctrl-C. |
JSON output
--json works with whoami, add and logout. On success, stdout holds one JSON document and stderr is empty. On failure, stdout is empty and stderr holds one line:
{
"message": "Not logged in to QuiverAI. Run `quiverai login`.",
"reason": "login_required",
"status": "action_required",
"next": [{ "argv": ["quiverai", "login"], "command": "quiverai login" }]
}
reason is one of api_error, canceled, conflict, internal_error, interactive_required, invalid_arguments, login_required, missing_input, network_error, not_found, permission_denied, timeout, unknown_command or unknown_option. status is action_required when input or a step by a person would let the command run, and error otherwise. next lists a command that recovers the failure, when there is one. Warnings are a warnings list in the document, never stderr text.
| Command | Success document |
|---|---|
whoami |
{"account":{"email":"ada@example.com","organizationId":"org_1"}} |
add |
{"component":{"name":"Logo","file":"/abs/path/logo.tsx","importSpecifier":"@/components/quiverai/logo"},"outcome":"added"}; outcome is added, updated, unchanged, or planned with --dry-run, which also carries "change": add, update or none |
logout |
{"outcome":"logged_out","appUrl":"https://app.quiver.ai"}, or "unchanged"; with --all, "all":true replaces appUrl |
Color
Color is on in a terminal. NO_COLOR set to anything but empty, or --no-color, turns it off, and wins over FORCE_COLOR.
Good to know
- SVG files are checked before conversion. A file with scripts, event handlers,
foreignObject, external references ordata:URLs is refused, not changed. - Results go to stdout, and prompts and errors go to stderr. See Scripts and CI for exit codes.
- Behind a proxy, set
NODE_USE_ENV_PROXY=1together withHTTPS_PROXY. - Run
npx quiverai --helpfor every command and option.