@remotedraw/cli
v0.5.0
Published
Command-line tools for creating and inspecting RemoteDraw integrations.
Readme
RemoteDraw CLI
Set up RemoteDraw in a new or existing app from your terminal. The CLI guides you through choosing an integration, signs in through the RemoteDraw dashboard, creates the matching project and development API key, and writes starter code for your chosen stack.
Install
RemoteDraw requires Node.js 20 or newer. Use whichever package manager your
project already uses — the CLI reads the project's lockfile and packageManager
field, and prints its own next steps in that manager's commands.
npm install -g @remotedraw/cli # npm
pnpm add -g @remotedraw/cli # pnpm
bun add -g @remotedraw/cli # bun
remotedraw --versionYarn Berry has no global install, so run it straight from the registry — which also works everywhere else, when you would rather not install anything:
yarn dlx @remotedraw/cli # Yarn
npx @remotedraw/cli@latest # npm
pnpm dlx @remotedraw/cli # pnpm
bunx @remotedraw/cli # bunStart here
Run the guided setup:
remotedrawIn an existing project, the CLI detects local RemoteDraw configuration and
shows commands to check the integration. For an unconfigured app, it suggests
scan and init. Detection checks the current directory and ancestors up to
the repository boundary, without network requests or a recursive scan.
In an empty directory, the setup wizard helps you choose a target, sender,
SDK, and starter preset. Browser login starts only after you confirm creation.
To deliberately create a separate app and cloud project, use remotedraw new.
To see the available integration paths without starting the wizard:
remotedraw guideLanguage
The first interactive run asks which language the CLI should speak, listing each language under its own name:
? Language / Taal
❯ ◉ English en
○ Nederlands nlThe answer is stored once in your user config directory and reused by every later command, so the question is asked once per machine rather than once per run. Change it at any time:
remotedraw language # pick interactively, or list the current setting
remotedraw language nl # set it directlyNon-interactive callers never see the prompt. A run without a stored choice, a TTY, or an override speaks English. To force a language for one command or for a whole CI job:
remotedraw doctor --language nl
REMOTEDRAW_LANGUAGE=nl remotedraw doctorPrecedence is --language (or --lang), then REMOTEDRAW_LANGUAGE /
REMOTEDRAW_LANG, then the stored choice, then English. An unrecognized code
fails with the list of supported languages rather than guessing.
Machine-readable output is always English regardless of the stored
language: --format json on any command, and create-input --json. It is a
data interchange format for CI and coding agents, not chrome for the operator,
and enum values are identifiers that are never translated. Passing
--language <code> on that same invocation is a deliberate request and does
localize the human-readable label, summary, and explanation fields; a
stored choice or an environment variable does not. JSON error.code values are
declared at the point the error is raised, so they never change with language.
Localization covers CLI chrome only: prompts, help, summaries, doctor output,
and error messages. Everything the CLI writes into your project stays
English — generated code, comments, README files, package.json fields, and
API request payloads. Those artifacts are committed, reviewed, diffed, and read
by teammates and coding agents who may not share your CLI language, and they sit
next to English API identifiers and documentation.
Currently shipping English and Dutch. A language is added by dropping one
catalog file into src/locales/ and registering it in src/locales/index.ts;
no call site changes, and anything a catalog omits falls back to English.
Create a new app
Start the interactive project creator:
remotedraw newOr provide the setup choices directly:
remotedraw new \
--app-name MyApp \
--target web \
--sender remotedraw-ios \
--sdk reactAdd RemoteDraw to an existing app
Run init from the project you want to update:
cd my-existing-app
remotedraw initYou can also choose the integration explicitly:
remotedraw init \
--target web \
--sender embedded-web \
--sdk reactBefore writing, the interactive flow shows a review and asks for explicit
confirmation. Existing files are protected unless you intentionally pass
--force.
Check an integration
Use doctor after setup or when troubleshooting:
remotedraw doctorIt checks the project configuration, installed packages, environment values, the installed CLI version, and—when credentials are available—the RemoteDraw API connection.
Without an override, commands talk to https://api.remotedraw.com. Doctor
prints the API base URL it resolved and where that value came from, so a
.env.local pointing at a non-production deployment is visible rather than
silent.
Update the CLI
npm install -g pins the version it installed and never revisits it, so a
global RemoteDraw CLI stays on whatever release you first installed:
remotedraw update # install the latest published version
remotedraw update --check # report it without installingupdate detects whether the binary came from npm, pnpm, yarn, or bun — and
whether it was run through npx/pnpm dlx/yarn dlx/bunx, which fetch the
latest release every time and so have nothing to update — then runs that
manager's own command. Other commands check the registry at most once a day and
print a one-line notice when a newer version exists; that notice only appears on
an interactive terminal, and REMOTEDRAW_CLI_NO_UPDATE_CHECK=1, CI, or
NO_UPDATE_NOTIFIER disable it.
Useful account commands:
remotedraw login
remotedraw whoami
remotedraw logoutGenerated files and credentials
Depending on your selected integration, new and init create or update:
remotedraw.config.json.env.example.env.local- starter files under
src/remotedraw
The generated .env.local contains the project runtime values and should stay
gitignored. The CLI adds the .env.local rule to the project's .gitignore
before writing the key and writes the file with mode 0600. When the rule
cannot be written, or git still does not ignore the file (already tracked, or a
later rule re-includes it), the summary and the JSON warnings say so. The
.gitignore rule is listed as written only when it is in place:
REMOTEDRAW_API_BASE_URL=https://api.remotedraw.com
REMOTEDRAW_PROJECT_ID=...
REMOTEDRAW_API_KEY=rd_sk_...The account-level rd_cli_... credential is stored separately with restricted
file permissions in $XDG_CONFIG_HOME/remotedraw/config.json or
~/.config/remotedraw/config.json. It is never copied into a project. Run
remotedraw logout to revoke and remove it.
Use --offline when you only want local scaffolding and do not want to create a
RemoteDraw cloud project.
Automation and coding agents
CI and coding agents should use the machine-readable, non-interactive flow:
remotedraw options --format json
remotedraw new \
--non-interactive \
--offline \
--dry-run \
--format json \
--app-name AgentDesk \
--target web \
--sender remotedraw-ios \
--sdk react \
--preset sketch \
--package-manager npm
remotedraw doctor --format json--non-interactive prevents prompts and browser authorization. JSON dry runs
return the resolved plan, defaults, files, warnings, cloud mode, and suggested
next commands. Inspect the result before rerunning without --dry-run.
For authenticated CI provisioning, provide REMOTEDRAW_CLI_TOKEN as a secret.
The CLI can also print or install the RemoteDraw skill for coding agents:
remotedraw agent --print-skill
remotedraw agent --path .agents/skills/remotedraw --force
remotedraw agent --path .claude/skills/remotedraw --forceBefore scaffolding into an existing app, read it first. scan names the web,
server, and iOS projects in a tree, where an rd_sk_ key may live, any
RemoteDraw wiring already present, the integration options that fit, and the
product questions to settle with the user before building:
remotedraw scan --format json
remotedraw scan --path apps/customer-webWhen the integration already has its files and only needs credentials,
provision without scaffolding (and without --force):
remotedraw project create --name "Field Notes" --env server # writes server/.env.local
remotedraw project create --name "Field Notes" --format json # prints the key once--env adds .env.local to the .gitignore next to it before creating the
project, then writes the file with mode 0600 (an existing file is tightened
before the key goes in). If that rule cannot be written, the command stops
without creating a project or key. If git reports the file as tracked or
re-included by a later rule, the text output and the JSON warning field say
so.
Command reference
guide Choose an integration path and SDK.
options Print setup choices and compatibility metadata.
language Choose the language of this CLI.
login Authorize this computer through the dashboard.
logout Revoke and remove this computer's CLI credential.
whoami Show the signed-in RemoteDraw account.
new Create a new app with RemoteDraw starter code.
init Add RemoteDraw starter code to an existing project.
dev Print the local sandbox workflow for an integration.
doctor Check project config, packages, and environment variables.
create-input Create or print a test input request payload.
examples List or install example projects.
agent Print or install the RemoteDraw agent skill.
scan Read a codebase and propose where RemoteDraw fits.
project Create a dashboard project and API key without scaffolding.Run remotedraw <command> --help for command-specific options.
Links
Contributing
This section is for contributors working inside the RemoteDraw repository:
bun install
bun run cli -- --help
cd packages/cli
bun run verify:publish
npm pack --dry-run