@remotedraw/cli 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +189 -49
- package/dist/cli.d.ts +4 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +247 -65
- package/dist/index.js +19 -2
- package/dist/setup-wizard.d.ts +9 -1
- package/dist/setup-wizard.d.ts.map +1 -1
- package/dist/setup-wizard.js +554 -77
- package/dist/update.d.ts +53 -0
- package/dist/update.d.ts.map +1 -0
- package/dist/update.js +235 -0
- package/package.json +3 -8
package/README.md
CHANGED
|
@@ -1,53 +1,136 @@
|
|
|
1
|
-
#
|
|
1
|
+
# RemoteDraw CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Set up RemoteDraw in a new or existing app from your terminal. The CLI guides
|
|
4
|
+
you through choosing an integration, signs in through the RemoteDraw dashboard,
|
|
5
|
+
creates the matching project and development API key, and writes starter code
|
|
6
|
+
for your chosen stack.
|
|
4
7
|
|
|
5
|
-
##
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
RemoteDraw requires Node.js 20 or newer.
|
|
6
11
|
|
|
7
12
|
```sh
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
bun run cli -- login
|
|
11
|
-
bun run cli -- whoami
|
|
12
|
-
bun run cli
|
|
13
|
-
bun run cli -- new
|
|
14
|
-
bun run cli -- new --app-name MijnApp --target web --sender remotedraw-ios --sdk react
|
|
15
|
-
bun run cli -- init --target web --sender embedded-web --sdk react
|
|
16
|
-
bun run cli -- doctor
|
|
17
|
-
bun run cli -- agent --print-skill
|
|
13
|
+
npm install --global @remotedraw/cli
|
|
14
|
+
remotedraw --version
|
|
18
15
|
```
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
binary, for example `npx @remotedraw/cli@latest guide`.
|
|
17
|
+
You can also run it without installing globally:
|
|
22
18
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
same deterministic help as `remotedraw --help` and never waits for input.
|
|
19
|
+
```sh
|
|
20
|
+
npx @remotedraw/cli@latest
|
|
21
|
+
```
|
|
27
22
|
|
|
28
|
-
|
|
29
|
-
interactive prompts. Both routes use the same project validation, templates,
|
|
30
|
-
and file writer.
|
|
23
|
+
## Start here
|
|
31
24
|
|
|
32
|
-
|
|
33
|
-
the wizard:
|
|
25
|
+
Run the guided setup:
|
|
34
26
|
|
|
35
27
|
```sh
|
|
36
|
-
remotedraw
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
remotedraw
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
On the first run, the CLI opens `dashboard.remotedraw.com` and displays a
|
|
32
|
+
short confirmation code. Approve that code in the browser, then return to the
|
|
33
|
+
terminal. The setup wizard will help you choose a target, sender experience,
|
|
34
|
+
SDK, and starter preset before it writes anything.
|
|
35
|
+
|
|
36
|
+
To see the available integration paths without starting the wizard:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
remotedraw guide
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Create a new app
|
|
43
|
+
|
|
44
|
+
Start the interactive project creator:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
remotedraw new
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Or provide the setup choices directly:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
remotedraw new \
|
|
54
|
+
--app-name MyApp \
|
|
55
|
+
--target web \
|
|
56
|
+
--sender remotedraw-ios \
|
|
57
|
+
--sdk react
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Add RemoteDraw to an existing app
|
|
61
|
+
|
|
62
|
+
Run `init` from the project you want to update:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
cd my-existing-app
|
|
66
|
+
remotedraw init
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
You can also choose the integration explicitly:
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
remotedraw init \
|
|
73
|
+
--target web \
|
|
74
|
+
--sender embedded-web \
|
|
75
|
+
--sdk react
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Before writing, the interactive flow shows a review and asks for explicit
|
|
79
|
+
confirmation. Existing files are protected unless you intentionally pass
|
|
80
|
+
`--force`.
|
|
81
|
+
|
|
82
|
+
## Check an integration
|
|
83
|
+
|
|
84
|
+
Use `doctor` after setup or when troubleshooting:
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
remotedraw doctor
|
|
41
88
|
```
|
|
42
89
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
inspecting that result; `--force` remains an explicit overwrite decision.
|
|
90
|
+
It checks the project configuration, installed packages, environment values,
|
|
91
|
+
the installed CLI version, and—when credentials are available—the RemoteDraw
|
|
92
|
+
API connection.
|
|
47
93
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
94
|
+
Without an override, commands talk to `https://api.remotedraw.com`. Doctor
|
|
95
|
+
prints the API base URL it resolved and where that value came from, so a
|
|
96
|
+
`.env.local` pointing at a non-production deployment is visible rather than
|
|
97
|
+
silent.
|
|
98
|
+
|
|
99
|
+
## Update the CLI
|
|
100
|
+
|
|
101
|
+
`npm install -g` pins the version it installed and never revisits it, so a
|
|
102
|
+
global RemoteDraw CLI stays on whatever release you first installed:
|
|
103
|
+
|
|
104
|
+
```sh
|
|
105
|
+
remotedraw update # install the latest published version
|
|
106
|
+
remotedraw update --check # report it without installing
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
`update` detects whether the binary came from npm, pnpm, yarn, or bun and runs
|
|
110
|
+
that package manager. Other commands check the registry at most once a day and
|
|
111
|
+
print a one-line notice when a newer version exists; that notice only appears on
|
|
112
|
+
an interactive terminal, and `REMOTEDRAW_CLI_NO_UPDATE_CHECK=1`, `CI`, or
|
|
113
|
+
`NO_UPDATE_NOTIFIER` disable it.
|
|
114
|
+
|
|
115
|
+
Useful account commands:
|
|
116
|
+
|
|
117
|
+
```sh
|
|
118
|
+
remotedraw login
|
|
119
|
+
remotedraw whoami
|
|
120
|
+
remotedraw logout
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Generated files and credentials
|
|
124
|
+
|
|
125
|
+
Depending on your selected integration, `new` and `init` create or update:
|
|
126
|
+
|
|
127
|
+
- `remotedraw.config.json`
|
|
128
|
+
- `.env.example`
|
|
129
|
+
- `.env.local`
|
|
130
|
+
- starter files under `src/remotedraw`
|
|
131
|
+
|
|
132
|
+
The generated `.env.local` contains the project runtime values and should stay
|
|
133
|
+
gitignored:
|
|
51
134
|
|
|
52
135
|
```dotenv
|
|
53
136
|
REMOTEDRAW_API_BASE_URL=https://api.remotedraw.com
|
|
@@ -55,25 +138,82 @@ REMOTEDRAW_PROJECT_ID=...
|
|
|
55
138
|
REMOTEDRAW_API_KEY=rd_sk_...
|
|
56
139
|
```
|
|
57
140
|
|
|
58
|
-
The account-level `rd_cli_...` credential is
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
`remotedraw logout` to revoke it.
|
|
62
|
-
secret. Use `--offline` when only local scaffolding is wanted.
|
|
141
|
+
The account-level `rd_cli_...` credential is stored separately with restricted
|
|
142
|
+
file permissions in `$XDG_CONFIG_HOME/remotedraw/config.json` or
|
|
143
|
+
`~/.config/remotedraw/config.json`. It is never copied into a project. Run
|
|
144
|
+
`remotedraw logout` to revoke and remove it.
|
|
63
145
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
work without manually exporting them in the shell.
|
|
146
|
+
Use `--offline` when you only want local scaffolding and do not want to create a
|
|
147
|
+
RemoteDraw cloud project.
|
|
67
148
|
|
|
68
|
-
##
|
|
149
|
+
## Automation and coding agents
|
|
69
150
|
|
|
70
|
-
|
|
151
|
+
CI and coding agents should use the machine-readable, non-interactive flow:
|
|
152
|
+
|
|
153
|
+
```sh
|
|
154
|
+
remotedraw options --format json
|
|
155
|
+
|
|
156
|
+
remotedraw new \
|
|
157
|
+
--non-interactive \
|
|
158
|
+
--offline \
|
|
159
|
+
--dry-run \
|
|
160
|
+
--format json \
|
|
161
|
+
--app-name AgentDesk \
|
|
162
|
+
--target web \
|
|
163
|
+
--sender remotedraw-ios \
|
|
164
|
+
--sdk react \
|
|
165
|
+
--preset sketch \
|
|
166
|
+
--package-manager npm
|
|
167
|
+
|
|
168
|
+
remotedraw doctor --format json
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
`--non-interactive` prevents prompts and browser authorization. JSON dry runs
|
|
172
|
+
return the resolved plan, defaults, files, warnings, cloud mode, and suggested
|
|
173
|
+
next commands. Inspect the result before rerunning without `--dry-run`.
|
|
174
|
+
|
|
175
|
+
For authenticated CI provisioning, provide `REMOTEDRAW_CLI_TOKEN` as a secret.
|
|
176
|
+
|
|
177
|
+
The CLI can also print or install the RemoteDraw skill for coding agents:
|
|
71
178
|
|
|
72
179
|
```sh
|
|
73
180
|
remotedraw agent --print-skill
|
|
74
181
|
remotedraw agent --path ~/.codex/skills/remotedraw --force
|
|
75
182
|
```
|
|
76
183
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
184
|
+
## Command reference
|
|
185
|
+
|
|
186
|
+
```text
|
|
187
|
+
guide Choose an integration path and SDK.
|
|
188
|
+
options Print setup choices and compatibility metadata.
|
|
189
|
+
login Authorize this computer through the dashboard.
|
|
190
|
+
logout Revoke and remove this computer's CLI credential.
|
|
191
|
+
whoami Show the signed-in RemoteDraw account.
|
|
192
|
+
new Create a new app with RemoteDraw starter code.
|
|
193
|
+
init Add RemoteDraw starter code to an existing project.
|
|
194
|
+
dev Print the local sandbox workflow for an integration.
|
|
195
|
+
doctor Check project config, packages, and environment variables.
|
|
196
|
+
create-input Create or print a test input request payload.
|
|
197
|
+
examples List or install example projects.
|
|
198
|
+
agent Print or install the RemoteDraw agent skill.
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Run `remotedraw <command> --help` for command-specific options.
|
|
202
|
+
|
|
203
|
+
## Links
|
|
204
|
+
|
|
205
|
+
- [RemoteDraw documentation](https://docs.remotedraw.com)
|
|
206
|
+
- [API dashboard](https://dashboard.remotedraw.com)
|
|
207
|
+
- [Support](mailto:support@remotedraw.com)
|
|
208
|
+
|
|
209
|
+
## Contributing
|
|
210
|
+
|
|
211
|
+
This section is for contributors working inside the RemoteDraw repository:
|
|
212
|
+
|
|
213
|
+
```sh
|
|
214
|
+
bun install
|
|
215
|
+
bun run cli -- --help
|
|
216
|
+
cd packages/cli
|
|
217
|
+
bun run verify:publish
|
|
218
|
+
npm pack --dry-run
|
|
219
|
+
```
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type WizardDefinition, type WizardTerminal } from "./setup-wizard.js";
|
|
2
2
|
import { type CloudRuntime } from "./cloud.js";
|
|
3
|
+
import { type UpdateRuntime } from "./update.js";
|
|
3
4
|
export declare const CLI_VERSION: string;
|
|
4
5
|
export type CliResult = {
|
|
5
6
|
exitCode: number;
|
|
@@ -27,8 +28,10 @@ export type CliPrompter = {
|
|
|
27
28
|
text: (options: TextPromptOptions) => Promise<string>;
|
|
28
29
|
select: <T extends string>(options: SelectPromptOptions<T>) => Promise<T>;
|
|
29
30
|
};
|
|
30
|
-
export type CliRuntime = CloudRuntime & {
|
|
31
|
+
export type CliRuntime = CloudRuntime & UpdateRuntime & {
|
|
31
32
|
cwd: string;
|
|
33
|
+
/** Absolute path of the running binary; drives update-command detection. */
|
|
34
|
+
binPath?: string;
|
|
32
35
|
prompts?: CliPrompter;
|
|
33
36
|
wizardTerminal?: WizardTerminal | undefined;
|
|
34
37
|
};
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAQA,OAAO,EA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