@remotedraw/cli 0.1.1 → 0.1.2

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.
Files changed (2) hide show
  1. package/README.md +167 -49
  2. package/package.json +3 -8
package/README.md CHANGED
@@ -1,53 +1,114 @@
1
- # @remotedraw/cli
1
+ # RemoteDraw CLI
2
2
 
3
- Command-line tools for starting and inspecting RemoteDraw developer integrations.
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
- ## Local Development
8
+ ## Install
9
+
10
+ RemoteDraw requires Node.js 20 or newer.
6
11
 
7
12
  ```sh
8
- bun run cli -- guide
9
- bun run cli -- options --format json
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
- The published package will expose the same commands through the `remotedraw`
21
- binary, for example `npx @remotedraw/cli@latest guide`.
17
+ You can also run it without installing globally:
22
18
 
23
- Run `remotedraw` with no arguments in an interactive terminal for the guided
24
- project-creation wizard. It supports keyboard navigation, review, and explicit
25
- confirmation before writing. Piped or redirected no-argument use prints the
26
- same deterministic help as `remotedraw --help` and never waits for input.
19
+ ```sh
20
+ npx @remotedraw/cli@latest
21
+ ```
27
22
 
28
- `remotedraw new` remains available with either explicit flags or its existing
29
- interactive prompts. Both routes use the same project validation, templates,
30
- and file writer.
23
+ ## Start here
31
24
 
32
- Coding agents and CI should use the machine-readable path instead of driving
33
- the wizard:
25
+ Run the guided setup:
34
26
 
35
27
  ```sh
36
- remotedraw options --format json
37
- remotedraw new --non-interactive --offline --dry-run --format json \
38
- --app-name AgentDesk --target web --sender remotedraw-ios \
39
- --sdk react --preset sketch --package-manager npm
40
- remotedraw doctor --format json
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
- `--non-interactive` guarantees that setup never opens prompts or browser
44
- authorization. JSON dry runs return the resolved plan, applied defaults, file
45
- list, warnings, cloud mode, and next commands. Remove `--dry-run` only after
46
- inspecting that result; `--force` remains an explicit overwrite decision.
90
+ It checks the project configuration, installed packages, environment values,
91
+ and—when credentials are available—the RemoteDraw API connection.
92
+
93
+ Useful account commands:
94
+
95
+ ```sh
96
+ remotedraw login
97
+ remotedraw whoami
98
+ remotedraw logout
99
+ ```
47
100
 
48
- By default, `new` and `init` also create a project on the RemoteDraw backend,
49
- mint a project-scoped development API key, and write these server-side values
50
- to a gitignored `.env.local`:
101
+ ## Generated files and credentials
102
+
103
+ Depending on your selected integration, `new` and `init` create or update:
104
+
105
+ - `remotedraw.config.json`
106
+ - `.env.example`
107
+ - `.env.local`
108
+ - starter files under `src/remotedraw`
109
+
110
+ The generated `.env.local` contains the project runtime values and should stay
111
+ gitignored:
51
112
 
52
113
  ```dotenv
53
114
  REMOTEDRAW_API_BASE_URL=https://api.remotedraw.com
@@ -55,25 +116,82 @@ REMOTEDRAW_PROJECT_ID=...
55
116
  REMOTEDRAW_API_KEY=rd_sk_...
56
117
  ```
57
118
 
58
- The account-level `rd_cli_...` credential is separate: it is stored with mode
59
- `0600` in the user's config directory (`$XDG_CONFIG_HOME/remotedraw/config.json`
60
- or `~/.config/remotedraw/config.json`) and never copied into a project. Use
61
- `remotedraw logout` to revoke it. For CI, provide `REMOTEDRAW_CLI_TOKEN` as a
62
- secret. Use `--offline` when only local scaffolding is wanted.
119
+ The account-level `rd_cli_...` credential is stored separately with restricted
120
+ file permissions in `$XDG_CONFIG_HOME/remotedraw/config.json` or
121
+ `~/.config/remotedraw/config.json`. It is never copied into a project. Run
122
+ `remotedraw logout` to revoke and remove it.
123
+
124
+ Use `--offline` when you only want local scaffolding and do not want to create a
125
+ RemoteDraw cloud project.
126
+
127
+ ## Automation and coding agents
128
+
129
+ CI and coding agents should use the machine-readable, non-interactive flow:
130
+
131
+ ```sh
132
+ remotedraw options --format json
133
+
134
+ remotedraw new \
135
+ --non-interactive \
136
+ --offline \
137
+ --dry-run \
138
+ --format json \
139
+ --app-name AgentDesk \
140
+ --target web \
141
+ --sender remotedraw-ios \
142
+ --sdk react \
143
+ --preset sketch \
144
+ --package-manager npm
145
+
146
+ remotedraw doctor --format json
147
+ ```
63
148
 
64
- Like the Convex CLI, RemoteDraw reads generated runtime values back from
65
- `.env.local`, so `remotedraw doctor` and `remotedraw create-input --execute`
66
- work without manually exporting them in the shell.
149
+ `--non-interactive` prevents prompts and browser authorization. JSON dry runs
150
+ return the resolved plan, defaults, files, warnings, cloud mode, and suggested
151
+ next commands. Inspect the result before rerunning without `--dry-run`.
67
152
 
68
- ## Agent Skill
153
+ For authenticated CI provisioning, provide `REMOTEDRAW_CLI_TOKEN` as a secret.
69
154
 
70
- Print or install the RemoteDraw agent skill:
155
+ The CLI can also print or install the RemoteDraw skill for coding agents:
71
156
 
72
157
  ```sh
73
158
  remotedraw agent --print-skill
74
159
  remotedraw agent --path ~/.codex/skills/remotedraw --force
75
160
  ```
76
161
 
77
- The skill teaches coding agents the CLI-first integration flow, SDK choices,
78
- API key boundary, token lifecycle, structured dry-run workflow, and
79
- verification commands.
162
+ ## Command reference
163
+
164
+ ```text
165
+ guide Choose an integration path and SDK.
166
+ options Print setup choices and compatibility metadata.
167
+ login Authorize this computer through the dashboard.
168
+ logout Revoke and remove this computer's CLI credential.
169
+ whoami Show the signed-in RemoteDraw account.
170
+ new Create a new app with RemoteDraw starter code.
171
+ init Add RemoteDraw starter code to an existing project.
172
+ dev Print the local sandbox workflow for an integration.
173
+ doctor Check project config, packages, and environment variables.
174
+ create-input Create or print a test input request payload.
175
+ examples List or install example projects.
176
+ agent Print or install the RemoteDraw agent skill.
177
+ ```
178
+
179
+ Run `remotedraw <command> --help` for command-specific options.
180
+
181
+ ## Links
182
+
183
+ - [RemoteDraw documentation](https://docs.remotedraw.com)
184
+ - [API dashboard](https://dashboard.remotedraw.com)
185
+ - [Support](mailto:support@remotedraw.com)
186
+
187
+ ## Contributing
188
+
189
+ This section is for contributors working inside the RemoteDraw repository:
190
+
191
+ ```sh
192
+ bun install
193
+ bun run cli -- --help
194
+ cd packages/cli
195
+ bun run verify:publish
196
+ npm pack --dry-run
197
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotedraw/cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Command-line tools for creating and inspecting RemoteDraw integrations.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -13,15 +13,10 @@
13
13
  "engines": {
14
14
  "node": ">=20"
15
15
  },
16
- "repository": {
17
- "type": "git",
18
- "url": "git+https://github.com/AxioSOzo/RemoteDraw.git",
19
- "directory": "packages/cli"
20
- },
21
16
  "bugs": {
22
- "url": "https://github.com/AxioSOzo/RemoteDraw/issues"
17
+ "email": "support@remotedraw.com"
23
18
  },
24
- "homepage": "https://github.com/AxioSOzo/RemoteDraw#readme",
19
+ "homepage": "https://docs.remotedraw.com",
25
20
  "keywords": [
26
21
  "remotedraw",
27
22
  "drawing",