@coderook/cli 0.36.0 → 0.38.1

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.
@@ -1,371 +1,413 @@
1
- ---
2
- name: coderook
3
- description: Save, browse and restore versions of a project on CodeRook — a version host where every version is a complete snapshot, reached with the cbx command or with plain git. Use when asked to save, submit or push work to CodeRook, check what has changed, look at a project's versions or files, fetch a project, start or switch a line of work, resolve a save that landed at the same time as somebody else's, build a project's executables for Windows, Linux and macOS from one machine (cbx build), or publish a mod to a game's mod repository or set one up (cbx mods).
4
- allowed-tools: Bash Read
5
- ---
6
-
7
- # CodeRook
8
-
9
- CodeRook stores whole snapshots of a folder. A version names every file the
10
- project had at that moment, so restoring one never depends on the versions
11
- around it, and there is no staging area, no branches to rebase and no history
12
- to rewrite.
13
-
14
- Everything here is the `cbx` command line (also installed as `coderook`), or
15
- git itself through CodeRook's remote helper. Run them with Bash.
16
-
17
- **Which one to use.** If the folder is a git repository (`git rev-parse` works
18
- in it), prefer git — see *Working in a git repository* below. Each commit then
19
- arrives with its own message, instead of one snapshot standing in for many.
20
- Use `cbx submit` for folders that are not git repositories.
21
-
22
- ## Before anything else
23
-
24
- `cbx whoami` says who this machine is signed in as. If it refuses, the
25
- person needs to run `cbx sign-in` themselves — it takes a personal access
26
- token, so do not attempt it on their behalf.
27
-
28
- If the command is not found at all, this machine has the skill but not the
29
- command line. Either install it once with
30
- `npm install --global @coderook/cli`, or put `npx -y @coderook/cli` where
31
- `coderook` appears below — the commands are identical, npx is just slower
32
- to start.
33
-
34
- ## Reading
35
-
36
- ```bash
37
- cbx status # what has changed in this folder since its last version
38
- cbx projects # every project on the account
39
- cbx versions [project] # what has been saved, newest first
40
- cbx tracks [project] # the lines a project has, and any waiting on a decision
41
- ```
42
-
43
- `status` is the one to reach for when somebody asks what is uncommitted, what
44
- changed, or whether anything needs saving. It reads the folder and changes
45
- nothing.
46
-
47
- ## Saving
48
-
49
- ```bash
50
- cbx submit -m "What changed, in a sentence"
51
- ```
52
-
53
- **The first save from a folder must say which project it is.** A folder that
54
- is not linked goes to a new project named after it — unless the account has a
55
- project with a name like it, and then `submit` stops and lists them. Do not
56
- guess: show the person the list and ask. Then run one of:
57
-
58
- ```bash
59
- cbx submit --into <project> -m "…" # this folder is that project
60
- cbx submit --new -m "…" # a separate project (add --name if the name is taken)
61
- cbx link <project> # link only; send nothing yet
62
- ```
63
-
64
- Never start a second project for work that already has one. A folder copied to
65
- another machine, another operating system or another path is still the same
66
- project: `cbx link` it.
67
-
68
- Send only what changed; the version still names every file. Write the message
69
- yourself from the actual diff rather than asking for one — a message like
70
- "update" helps nobody reading the history later.
71
-
72
- **Ask before running this.** Saving is the one thing here that leaves a mark on
73
- somebody's account, and a version saved by mistake is a version they have to
74
- explain. Propose it, say what it would send, and let them agree.
75
-
76
- `cbx submit -n` shows exactly what would be sent without sending it. Use
77
- that freely; it is safe and it is the honest way to answer "what would this
78
- upload?".
79
-
80
- ## Working in a git repository
81
-
82
- CodeRook is a git remote. `npm install --global @coderook/cli` puts the helper
83
- (`git-remote-coderook`) on PATH; the plugin and `npx` do not, so check with
84
- `git ls-remote coderook://<project>` before relying on it.
85
-
86
- ```bash
87
- git remote -v # is there a coderook:// remote already?
88
- git remote add coderook coderook://<project> # if not
89
- git push coderook main # each new commit becomes a save
90
- git push coderook <branch> # a branch becomes a line
91
- git push coderook v1.2.0 # a tag names a version
92
- git fetch coderook # bring other people's saves in
93
- ```
94
-
95
- If the project was started with `cbx submit` or the desktop app, the first push
96
- is refused with a message saying so. When the repository holds that project,
97
- `git push -o adopt coderook main` saves the current commit on top of what is
98
- there, once; plain pushes work from then on. **Ask before adopting** — it is a
99
- save like any other. If the project is somebody else's work under the same
100
- name, push to a new name instead.
101
-
102
- Git's limits here: no force pushes or branch deletions (saves are permanent), a
103
- merge commit arrives as one save holding the merged tree, and a commit holding
104
- a credential is refused — take the key out of history rather than looking for
105
- a way round.
106
-
107
- ## Fetching
108
-
109
- ```bash
110
- cbx get # bring this folder up to date
111
- cbx clone <project> [dir] # fetch a project into a new folder
112
- ```
113
-
114
- `get` protects local edits by default. `cbx get --replace` discards them
115
- to make an exact copy — only run it when the person has said so in those terms.
116
-
117
- ## Lines of work
118
-
119
- A project can have more than one line, so two people can save without one
120
- landing on top of the other.
121
-
122
- ```bash
123
- cbx track # which line this folder saves to
124
- cbx track spike --new # start a line and switch to it
125
- cbx track main # switch back
126
- cbx submit --track spike -m "…"
127
- ```
128
-
129
- Switching says where the next save goes and nothing else — no files move.
130
- Run `cbx get` afterwards to bring that line's files in.
131
-
132
- ## A history on this machine
133
-
134
- A folder with a `.cbx/` folder in it keeps its own history, and there
135
- `status`, `diff`, `log`, `switch`, `merge`, `push` and `pull` work on that
136
- history instead of the account. Check with `cbx status`: it names the line and
137
- the last local save.
138
-
139
- ```bash
140
- cbx init # start one (only when asked to)
141
- cbx save -m "…" # record the folder as it is
142
- cbx log # saves on this line
143
- cbx switch -c spike # start a line here; no files change
144
- cbx merge spike # bring that line's work in
145
- cbx restore path --from main~1 # put a file back from an earlier save
146
- cbx push # send new saves to CodeRook
147
- cbx pull # bring CodeRook's saves in, merging if both moved
148
- ```
149
-
150
- A merge that stops on conflicts leaves markers in the files and waits. Show
151
- the person the conflicts (`cbx status`) and let them decide; `cbx save`
152
- finishes the merge once the markers are gone. Do not pass `--force` to
153
- `restore`, `switch`, `save` or `pull` unless the person has said to throw away
154
- the changes it names, and do not run `cbx merge --cancel` unless they asked.
155
-
156
- ## Versions, and going back
157
-
158
- Every save is a commit. A commit becomes a *version* — the thing the public
159
- side of a project offers, and the thing a collaborator pulls — only when
160
- somebody promotes it.
161
-
162
- ```bash
163
- cbx promote # pick from the last ten and name one
164
- cbx mark 41 --pin # pin, hide, rename or label one save
165
- cbx labels add shipped green # the labels a project can wear
166
- cbx undo # put the project back on the save before this one
167
- ```
168
-
169
- `undo` moves where the project stands. Nothing is deleted and nothing is
170
- renumbered — the saves passed over stay in the history, and the next save
171
- carries on from wherever it now stands. It is the answer to "I pushed the
172
- wrong thing"; hiding a version stops strangers reading it but leaves the
173
- project standing on it, so the next person to pull still lands on the mistake.
174
-
175
- **Ask before `undo`, `promote` and `take-down`.** They change what other
176
- people see. `cbx versions` first, so the person can say which save they mean.
177
-
178
- ## Who can reach a project
179
-
180
- ```bash
181
- cbx visibility # what it is now: private, unlisted or public
182
- cbx visibility public --yes # list it on the owner's profile
183
- cbx visibility private # back to the people invited
184
- ```
185
-
186
- **Never make a project public or unlisted unless the person has asked for
187
- exactly that.** `--yes` skips the question the command would otherwise ask
188
- them, so only pass it once they have answered it. Going private is always safe.
189
-
190
- ## Serving a project as a website
191
-
192
- ```bash
193
- cbx pages # is the site on, its address, what it serves
194
- cbx pages auto # find the build in what was published, and offer to serve it
195
- cbx pages on --folder dist # serve a folder of the published version
196
- cbx pages off # stop serving it
197
- ```
198
-
199
- **Never turn Pages on (`auto` or `on`) unless the person has asked for their
200
- project to be served as a site.** It runs their code in strangers' browsers
201
- under the project's name. Pass `--yes` only once they have said yes. Only
202
- published versions are served and the project must be public. When `auto`
203
- finds a build left out by the ignore rules it offers a `.gitignore` line and
204
- lists the next steps; it never saves or publishes — ask before doing those.
205
- Turning Pages off is always safe.
206
-
207
- ## When two saves collide
208
-
209
- If somebody saved while this folder was behind, the second save becomes a merge
210
- waiting on a decision rather than overwriting anything.
211
-
212
- ```bash
213
- cbx merges # this folder's saves waiting on a decision
214
- cbx merge <ref> # look at one, and decide
215
- ```
216
-
217
- Read the conflict out to the person and let them choose. Do not pick a side for
218
- them: the whole reason it stopped is that the service could not tell which copy
219
- was wanted.
220
-
221
- ## What is worth leaving out
222
-
223
- ```bash
224
- cbx ignore --suggest # dependency directories, build output, virtual environments
225
- cbx ignore --suggest --apply # add the confident ones to .gitignore
226
- ```
227
-
228
- Rules live in the project's own `.gitignore`, so CodeRook, git and the website
229
- all read one file.
230
-
231
- ## Bundles
232
-
233
- ```bash
234
- cbx bundle . project.cbx # the whole project, every version, as one file
235
- cbx inspect project.cbx # what is inside, without unpacking
236
- cbx unbundle project.cbx ./restored
237
- ```
238
-
239
- ## Reading a public project without signing in
240
-
241
- Public projects can be read by anything, with no token, from
242
- `https://api.coderook.com/v1/public`. There is no need to read the command
243
- line's source to find these — this is the whole of it:
244
-
245
- ```text
246
- GET /projects?q= public projects, newest first
247
- GET /projects/{owner}/{slug} one project
248
- GET /projects/{owner}/{slug}/versions the versions it offers
249
- GET /projects/{owner}/{slug}/releases every release, with its downloads
250
- GET /projects/{owner}/{slug}/releases/latest newest release and its files
251
- GET /projects/{owner}/{slug}/updates/latest.yml electron-updater feed
252
- GET /projects/{owner}/{slug}/versions/{v}/files every file, with digests
253
- GET /projects/{owner}/{slug}/versions/{v}/file?path= one file
254
- GET /projects/{owner}/{slug}/versions/{v}/archive the version as a zip
255
- GET /projects/{owner}/{slug}/versions/{v}/last-changes?path= which version last changed each entry
256
- GET /projects/{owner}/{slug}/versions/{v}/attachments files attached to it
257
- GET /projects/{owner}/{slug}/versions/{v}/attachments/{id} download one
258
- ```
259
-
260
- `{v}` is a version id or `latest`. A private project answers 404, exactly as
261
- if it did not exist.
262
-
263
- ### An app that updates itself from CodeRook
264
-
265
- Release a version named like a version number and attach the installer:
266
-
267
- ```bash
268
- cbx release 1.4.0
269
- cbx attach ./dist/MyApp-Setup-1.4.0.exe
270
- ```
271
-
272
- An Electron app then needs nothing custom — electron-builder's generic
273
- provider pointed at the feed:
274
-
275
- ```json
276
- "publish": [{ "provider": "generic",
277
- "url": "https://api.coderook.com/v1/public/projects/OWNER/SLUG/updates" }]
278
- ```
279
-
280
- The feed serves `latest.yml`, `latest-mac.yml` and `latest-linux.yml` with
281
- each file's size and SHA-512, and redirects file names to their downloads.
282
- Anything else can read `releases/latest` as JSON: version, notes, and every
283
- file with its size, SHA-256 and `url`. Updaters have no account, so the
284
- project they read must be public, but its source need not be:
285
-
286
- ```bash
287
- cbx release 1.4.0 --downloads public # notes, attachments and feed public; files stay private
288
- cbx releases # public / downloads public / private, and the addresses
289
- ```
290
-
291
- **Ask before `--downloads public`**: it publishes the attached files to anyone.
292
- One project holds the code and ships the app; a second "releases" project is
293
- no longer needed.
294
-
295
- ## Building executables for every platform
296
-
297
- ```bash
298
- cbx build --plan # how this machine would build each target
299
- cbx build --target win,linux,mac # build them into .coderook/build/<target>/
300
- ```
301
-
302
- It builds on this machine, with the tools it has, and uploads nothing. Run
303
- `--plan` first and read it out: a target marked "no" says what would build it
304
- (Docker, a Mac, cargo-zigbuild) — pass that on rather than installing things
305
- unasked. `--ship` attaches the results to the newest save, so **ask before
306
- `--ship`**, as before any save. A project's own build description lives in
307
- `coderook.build.json`.
308
-
309
- ## Reviewing proposals with GitHub tools
310
-
311
- When someone wants CodeRabbit, Blacksmith or GitHub Actions on their CodeRook
312
- proposals, that is `cbx github`: a GitHub repository mirrors each open
313
- proposal as a pull request, and the results come back as checks named
314
- `github/<check>` and `review/<reviewer>`.
315
-
316
- ```bash
317
- cbx github setup OWNER/REPO # token limited to this project, secret, workflow file
318
- cbx submit # the workflow has to be saved into the project
319
- cbx github sync --repo OWNER/REPO
320
- ```
321
-
322
- **Ask before `setup`**: it creates a token and stores it in GitHub. The person
323
- adds the second secret, `CODEROOK_BRIDGE_PUSH` (a GitHub fine-grained token
324
- with Contents and Pull requests read/write), themselves, because it is their
325
- GitHub credential. Every proposal also carries a `coderook/malware` check; a
326
- failure names the file. Do not try to get round it.
327
-
328
- ## Mod repositories for games
329
-
330
- A game's maker can run a mod repository: players' game clients read a signed
331
- catalogue from it, modders publish to it, and nothing is listed until it
332
- passes the repository's rules and a malware scan.
333
-
334
- ```bash
335
- cbx mods info zt1 # a repository's rules, for anybody
336
- cbx mods publish ./BetterTrees --repo zt1 # zip, upload, wait for the checks
337
- cbx mods publish ./HD-Art --repo zt1 --part animals # one part of a bigger mod
338
- cbx mods list zt1 # your mods and how their checks went
339
- cbx mods create my-game --name "My Game" --allow .png,.ogg,.json
340
- ```
341
-
342
- `publish` reads the folder's `mod.json` (or the repository's manifest) for the
343
- mod's id, name, folder and version; `--id`, `--name`, `--folder` and
344
- `--version` override it. It waits up to 30 minutes for the checks and prints
345
- what failed, file by file — pass that on as it is. Programs and scripts
346
- (`.exe`, `.dll`, `.ps1`, `.js` …) are refused in every repository, so do not
347
- try to rename one past the check. **Ask before `publish`**, as before any
348
- save: it makes the mod public once it passes. Ask before `remove`, `block`
349
- and `delete`, which only the person should decide. The game-side protocol
350
- (signed requests, the catalogue signature, downloads) is at
351
- https://coderook.com/docs#mod-repositories.
352
-
353
- ## Things not to do
354
-
355
- - Do not run `cbx delete` unless the person has asked for that project to
356
- be deleted, by name, in this conversation.
357
- - Do not run `cbx sign-out`. It costs them a token they have to fetch
358
- again and gains nothing.
359
- - Do not guess a project name. `cbx projects` lists them; a folder that is
360
- already linked needs no name at all.
361
- - Do not pass `--new` to get past the question `submit` asks. It exists for a
362
- separate project the person wants, not to avoid choosing.
363
- - Do not run `cbx take-down`. It destroys the files in a version and they do
364
- not come back. Say it exists and let its owner run it.
365
-
366
- ## If something refuses
367
-
368
- The commands explain themselves — pass the message on rather than rewording it.
369
- A refusal that says a token was not accepted means signing in; one that says a
370
- project does not allow machines means its owner turned that off deliberately,
371
- and the answer is to say so, not to find another route in.
1
+ ---
2
+ name: coderook
3
+ description: Save, browse and restore versions of a project on CodeRook — a version host where every version is a complete snapshot, reached with the cbx command or with plain git. Use when asked to save, submit or push work to CodeRook, check what has changed, look at a project's versions or files, fetch a project, start or switch a line of work, resolve a save that landed at the same time as somebody else's, build a project's executables for Windows, Linux and macOS from one machine (cbx build), or publish a mod to a game's mod repository or set one up (cbx mods).
4
+ allowed-tools: Bash Read
5
+ ---
6
+
7
+ # CodeRook
8
+
9
+ CodeRook stores whole snapshots of a folder. A version names every file the
10
+ project had at that moment, so restoring one never depends on the versions
11
+ around it, and there is no staging area, no branches to rebase and no history
12
+ to rewrite.
13
+
14
+ Everything here is the `cbx` command line (also installed as `coderook`), or
15
+ git itself through CodeRook's remote helper. Run them with Bash.
16
+
17
+ **Which one to use.** If the folder is a git repository (`git rev-parse` works
18
+ in it), prefer git — see *Working in a git repository* below. Each commit then
19
+ arrives with its own message, instead of one snapshot standing in for many.
20
+ Use `cbx submit` for folders that are not git repositories.
21
+
22
+ ## Remote work without a full checkout
23
+
24
+ Use `cbx workspace` when the person wants to continue a CodeRook project from a lightweight laptop. Do not clone the full project unless that work needs local files. Start with `cbx workspace list <project>` or open a named draft with a unique `--key`. Keep its ID and revision, read/search the needed paths, edit with explicit hashes in a JSON `--data-file`, review the diff, then save the authorised revision. Retry a lost response using the same operation key and arguments. Saving and deploying are different actions.
25
+
26
+ `cbx workspace show <project> <id>` includes the administrator-configured recipe commands and target information. Run a named recipe, inspect its job with `logs`, and use `cancel` if needed. Only deploy an explicitly requested target and a saved version with applicable checks. A missing recipe requires configuration; running a local terminal command does not change remote files.
27
+
28
+ `cbx mcp --workspaces` opts into the remote workspace tools using this account's stored token. The original `cbx mcp` stays read-only. A token needs explicit workspace edit/run/deploy grants for those actions; never print its value. The remote plugin can connect directly without this CLI.
29
+
30
+ Native jobs require CLI 0.38.0 or later on the selected Windows laptop and a matching `cbx runner --name` and label. The named recipe can select `includePaths` so only needed inputs download to a temporary job folder. Hosted jobs continue with the desktop PC off. Native execution, local GPU features, toolchains and signed-in services need their own suitable machine/setup. Remote task notes share project handover state, not proprietary chat history.
31
+
32
+ ## Before anything else
33
+
34
+ `cbx whoami` says who this machine is signed in as. If it refuses, the
35
+ person needs to run `cbx sign-in` themselves — it takes a personal access
36
+ token, so do not attempt it on their behalf.
37
+
38
+ If the command is not found at all, this machine has the skill but not the
39
+ command line. Either install it once with
40
+ `npm install --global @coderook/cli`, or put `npx -y @coderook/cli` where
41
+ `coderook` appears below — the commands are identical, npx is just slower
42
+ to start.
43
+
44
+ ## Reading
45
+
46
+ ```bash
47
+ cbx status # what has changed in this folder since its last version
48
+ cbx projects # every project on the account
49
+ cbx versions [project] # what has been saved, newest first
50
+ cbx tracks [project] # the lines a project has, and any waiting on a decision
51
+ ```
52
+
53
+ `status` is the one to reach for when somebody asks what is uncommitted, what
54
+ changed, or whether anything needs saving. It reads the folder and changes
55
+ nothing.
56
+
57
+ ## Saving
58
+
59
+ ```bash
60
+ cbx submit -m "What changed, in a sentence"
61
+ ```
62
+
63
+ **The first save from a folder must say which project it is.** A folder that
64
+ is not linked goes to a new project named after it — unless the account has a
65
+ project with a name like it, and then `submit` stops and lists them. Do not
66
+ guess: show the person the list and ask. Then run one of:
67
+
68
+ ```bash
69
+ cbx submit --into <project> -m "…" # this folder is that project
70
+ cbx submit --new -m "…" # a separate project (add --name if the name is taken)
71
+ cbx link <project> # link only; send nothing yet
72
+ ```
73
+
74
+ Never start a second project for work that already has one. A folder copied to
75
+ another machine, another operating system or another path is still the same
76
+ project: `cbx link` it.
77
+
78
+ Send only what changed; the version still names every file. Write the message
79
+ yourself from the actual diff rather than asking for one — a message like
80
+ "update" helps nobody reading the history later.
81
+
82
+ **Ask before running this.** Saving is the one thing here that leaves a mark on
83
+ somebody's account, and a version saved by mistake is a version they have to
84
+ explain. Propose it, say what it would send, and let them agree.
85
+
86
+ `cbx submit -n` shows exactly what would be sent without sending it. Use
87
+ that freely; it is safe and it is the honest way to answer "what would this
88
+ upload?".
89
+
90
+ ## Working in a git repository
91
+
92
+ CodeRook is a git remote. `npm install --global @coderook/cli` puts the helper
93
+ (`git-remote-coderook`) on PATH; the plugin and `npx` do not, so check with
94
+ `git ls-remote coderook://<project>` before relying on it.
95
+
96
+ ```bash
97
+ git remote -v # is there a coderook:// remote already?
98
+ git remote add coderook coderook://<project> # if not
99
+ git push coderook main # each new commit becomes a save
100
+ git push coderook <branch> # a branch becomes a line
101
+ git push coderook v1.2.0 # a tag names a version
102
+ git fetch coderook # bring other people's saves in
103
+ ```
104
+
105
+ If the project was started with `cbx submit` or the desktop app, the first push
106
+ is refused with a message saying so. When the repository holds that project,
107
+ `git push -o adopt coderook main` saves the current commit on top of what is
108
+ there, once; plain pushes work from then on. **Ask before adopting** — it is a
109
+ save like any other. If the project is somebody else's work under the same
110
+ name, push to a new name instead.
111
+
112
+ Git's limits here: no force pushes or branch deletions (saves are permanent), a
113
+ merge commit arrives as one save holding the merged tree, and a commit holding
114
+ a credential is refused — take the key out of history rather than looking for
115
+ a way round.
116
+
117
+ ## Fetching
118
+
119
+ ```bash
120
+ cbx get # bring this folder up to date
121
+ cbx clone <project> [dir] # fetch a project into a new folder
122
+ ```
123
+
124
+ `get` protects local edits by default. `cbx get --replace` discards them
125
+ to make an exact copy — only run it when the person has said so in those terms.
126
+
127
+ ## Lines of work
128
+
129
+ A project can have more than one line, so two people can save without one
130
+ landing on top of the other.
131
+
132
+ ```bash
133
+ cbx track # which line this folder saves to
134
+ cbx track spike --new # start a line and switch to it
135
+ cbx track main # switch back
136
+ cbx submit --track spike -m "…"
137
+ ```
138
+
139
+ Switching says where the next save goes and nothing else — no files move.
140
+ Run `cbx get` afterwards to bring that line's files in.
141
+
142
+ ## A history on this machine
143
+
144
+ A folder with a `.cbx/` folder in it keeps its own history, and there
145
+ `status`, `diff`, `log`, `switch`, `merge`, `push` and `pull` work on that
146
+ history instead of the account. Check with `cbx status`: it names the line and
147
+ the last local save.
148
+
149
+ ```bash
150
+ cbx init # start one (only when asked to)
151
+ cbx save -m "…" # record the folder as it is
152
+ cbx log # saves on this line
153
+ cbx switch -c spike # start a line here; no files change
154
+ cbx merge spike # bring that line's work in
155
+ cbx restore path --from main~1 # put a file back from an earlier save
156
+ cbx push # send new saves to CodeRook
157
+ cbx pull # bring CodeRook's saves in, merging if both moved
158
+ ```
159
+
160
+ A merge that stops on conflicts leaves markers in the files and waits. Show
161
+ the person the conflicts (`cbx status`) and let them decide; `cbx save`
162
+ finishes the merge once the markers are gone. Do not pass `--force` to
163
+ `restore`, `switch`, `save` or `pull` unless the person has said to throw away
164
+ the changes it names, and do not run `cbx merge --cancel` unless they asked.
165
+
166
+ ## Versions, and going back
167
+
168
+ Every save is a commit. A commit becomes a *version* — the thing the public
169
+ side of a project offers, and the thing a collaborator pulls — only when
170
+ somebody promotes it.
171
+
172
+ ```bash
173
+ cbx promote # pick from the last ten and name one
174
+ cbx mark 41 --pin # pin, hide, rename or label one save
175
+ cbx labels add shipped green # the labels a project can wear
176
+ cbx undo # put the project back on the save before this one
177
+ ```
178
+
179
+ `undo` moves where the project stands. Nothing is deleted and nothing is
180
+ renumbered — the saves passed over stay in the history, and the next save
181
+ carries on from wherever it now stands. It is the answer to "I pushed the
182
+ wrong thing"; hiding a version stops strangers reading it but leaves the
183
+ project standing on it, so the next person to pull still lands on the mistake.
184
+
185
+ **Ask before `undo`, `promote` and `take-down`.** They change what other
186
+ people see. `cbx versions` first, so the person can say which save they mean.
187
+
188
+ ## Who can reach a project
189
+
190
+ ```bash
191
+ cbx visibility # what it is now: private, unlisted or public
192
+ cbx visibility public --yes # list it on the owner's profile
193
+ cbx visibility private # back to the people invited
194
+ ```
195
+
196
+ **Never make a project public or unlisted unless the person has asked for
197
+ exactly that.** `--yes` skips the question the command would otherwise ask
198
+ them, so only pass it once they have answered it. Going private is always safe.
199
+
200
+ ## Serving a project as a website
201
+
202
+ ```bash
203
+ cbx pages # is the site on, its address, what it serves
204
+ cbx pages auto # find the build in what was published, and offer to serve it
205
+ cbx pages on --folder dist # serve a folder of the published version
206
+ cbx pages off # stop serving it
207
+ ```
208
+
209
+ **Never turn Pages on (`auto` or `on`) unless the person has asked for their
210
+ project to be served as a site.** It runs their code in strangers' browsers
211
+ under the project's name. Pass `--yes` only once they have said yes. Only
212
+ published versions are served and the project must be public. When `auto`
213
+ finds a build left out by the ignore rules it offers a `.gitignore` line and
214
+ lists the next steps; it never saves or publishes — ask before doing those.
215
+ Turning Pages off is always safe.
216
+
217
+ ## When two saves collide
218
+
219
+ If somebody saved while this folder was behind, the second save becomes a merge
220
+ waiting on a decision rather than overwriting anything.
221
+
222
+ ```bash
223
+ cbx merges # this folder's saves waiting on a decision
224
+ cbx merge <ref> # look at one, and decide
225
+ ```
226
+
227
+ Read the conflict out to the person and let them choose. Do not pick a side for
228
+ them: the whole reason it stopped is that the service could not tell which copy
229
+ was wanted.
230
+
231
+ ## What is worth leaving out
232
+
233
+ ```bash
234
+ cbx ignore --suggest # dependency directories, build output, virtual environments
235
+ cbx ignore --suggest --apply # add the confident ones to .gitignore
236
+ ```
237
+
238
+ Rules live in the project's own `.gitignore`, so CodeRook, git and the website
239
+ all read one file.
240
+
241
+ ## Bundles
242
+
243
+ ```bash
244
+ cbx bundle . project.cbx # the whole project, every version, as one file
245
+ cbx inspect project.cbx # what is inside, without unpacking
246
+ cbx unbundle project.cbx ./restored
247
+ ```
248
+
249
+ ## Reading a public project without signing in
250
+
251
+ Public projects can be read by anything, with no token, from
252
+ `https://api.coderook.com/v1/public`. There is no need to read the command
253
+ line's source to find these — this is the whole of it:
254
+
255
+ ```text
256
+ GET /projects?q= public projects, newest first
257
+ GET /projects/{owner}/{slug} one project
258
+ GET /projects/{owner}/{slug}/versions the versions it offers
259
+ GET /projects/{owner}/{slug}/releases every release, with its downloads
260
+ GET /projects/{owner}/{slug}/releases/latest newest release and its files
261
+ GET /projects/{owner}/{slug}/updates/latest.yml electron-updater feed
262
+ GET /projects/{owner}/{slug}/versions/{v}/files every file, with digests
263
+ GET /projects/{owner}/{slug}/versions/{v}/file?path= one file
264
+ GET /projects/{owner}/{slug}/versions/{v}/archive the version as a zip
265
+ GET /projects/{owner}/{slug}/versions/{v}/last-changes?path= which version last changed each entry
266
+ GET /projects/{owner}/{slug}/versions/{v}/attachments files attached to it
267
+ GET /projects/{owner}/{slug}/versions/{v}/attachments/{id} download one
268
+ ```
269
+
270
+ `{v}` is a version id or `latest`. A private project answers 404, exactly as
271
+ if it did not exist.
272
+
273
+ ### An app that updates itself from CodeRook
274
+
275
+ Release a version named like a version number and attach the installer:
276
+
277
+ ```bash
278
+ cbx release 1.4.0
279
+ cbx attach ./dist/MyApp-Setup-1.4.0.exe
280
+ ```
281
+
282
+ An Electron app then needs nothing custom — electron-builder's generic
283
+ provider pointed at the feed:
284
+
285
+ ```json
286
+ "publish": [{ "provider": "generic",
287
+ "url": "https://api.coderook.com/v1/public/projects/OWNER/SLUG/updates" }]
288
+ ```
289
+
290
+ The feed serves `latest.yml`, `latest-mac.yml` and `latest-linux.yml` with
291
+ each file's size and SHA-512, and redirects file names to their downloads.
292
+ Anything else can read `releases/latest` as JSON: version, notes, and every
293
+ file with its size, SHA-256 and `url`. Updaters have no account, so the
294
+ project they read must be public, but its source need not be:
295
+
296
+ ```bash
297
+ cbx release 1.4.0 --downloads public # notes, attachments and feed public; files stay private
298
+ cbx releases # public / downloads public / private, and the addresses
299
+ ```
300
+
301
+ **Ask before `--downloads public`**: it publishes the attached files to anyone.
302
+ One project holds the code and ships the app; a second "releases" project is
303
+ no longer needed.
304
+
305
+ ## Building executables for every platform
306
+
307
+ ```bash
308
+ cbx build --plan # how this machine would build each target
309
+ cbx build --target win,linux,mac # build them into .coderook/build/<target>/
310
+ ```
311
+
312
+ It builds on this machine, with the tools it has, and uploads nothing. Run
313
+ `--plan` first and read it out: a target marked "no" says what would build it
314
+ (Docker, a Mac, cargo-zigbuild) — pass that on rather than installing things
315
+ unasked. `--ship` attaches the results to the newest save, so **ask before
316
+ `--ship`**, as before any save. A project's own build description lives in
317
+ `coderook.build.json`.
318
+
319
+ ## Pull requests
320
+
321
+ A pull request is a proposal: a line offered to another line (`cbx propose`
322
+ opens one). Read and review them with `cbx pr`:
323
+
324
+ ```bash
325
+ cbx pr list # what is open on this project
326
+ cbx pr view M-3 # reviews, checks, conversation, what blocks merging
327
+ cbx pr files M-3 # what it changes
328
+ cbx pr comment M-3 --line src/app.ts:42 -m "…"
329
+ cbx pr approve M-3 # or request-changes M-3 -m "…"
330
+ cbx pr merge M-3
331
+ ```
332
+
333
+ **Ask before** `approve`, `request-changes`, `merge`, `close` and any comment:
334
+ each is the person speaking or acting, and is seen by others. An approval
335
+ stops counting when new saves land on the line, so re-check after pushing.
336
+ Every pull request carries a `coderook/malware` check: what the line adds or
337
+ changes is scanned before it can land, and a failure names the file. Do not
338
+ try to get round it.
339
+
340
+ ## Private files
341
+
342
+ `cbx private add "design/"` keeps matching files out of everything outside the
343
+ project (listings, zips, clone, Pages). Ask before changing the list: it
344
+ decides what strangers can see.
345
+
346
+ ## Runs
347
+
348
+ `cbx runs`, `cbx logs 12 --follow` to watch one, `cbx cancel 12` to stop one,
349
+ `cbx rerun 12` to run it again, `cbx approve 14` for one waiting for approval
350
+ (ask before each). Workflows can be YAML files in `.rook/workflows`; check
351
+ them with `cbx actions check` before saving. Never print or echo secrets:
352
+ `cbx secret set NAME` asks for the value itself, so let the person type it.
353
+
354
+ Inside a run, `CODEROOK_TOKEN`, `CODEROOK_API` and `CODEROOK_PROJECT` are set,
355
+ so `cbx issue comment`, `cbx pr label` and `cbx release` work with no sign-in.
356
+
357
+ ## Issues, forks and security
358
+
359
+ `cbx issue view|comment|close|label|assign`, `cbx fork`, `cbx security`. Ask
360
+ before closing, labelling, assigning, forking, or sending anything: each is the
361
+ person acting where others see it. A security report is private to the
362
+ project's owner; never put vulnerability details in a public issue.
363
+
364
+ ## Releases
365
+
366
+ `cbx release v2.0 --draft --generate-notes` then `cbx release publish`;
367
+ `cbx verify owner/project v2.0 ./file` checks a download; `cbx deps` lists
368
+ known vulnerabilities in the lockfiles. Ask before publishing.
369
+
370
+ ## Mod repositories for games
371
+
372
+ A game's maker can run a mod repository: players' game clients read a signed
373
+ catalogue from it, modders publish to it, and nothing is listed until it
374
+ passes the repository's rules and a malware scan.
375
+
376
+ ```bash
377
+ cbx mods info zt1 # a repository's rules, for anybody
378
+ cbx mods publish ./BetterTrees --repo zt1 # zip, upload, wait for the checks
379
+ cbx mods publish ./HD-Art --repo zt1 --part animals # one part of a bigger mod
380
+ cbx mods list zt1 # your mods and how their checks went
381
+ cbx mods create my-game --name "My Game" --allow .png,.ogg,.json
382
+ ```
383
+
384
+ `publish` reads the folder's `mod.json` (or the repository's manifest) for the
385
+ mod's id, name, folder and version; `--id`, `--name`, `--folder` and
386
+ `--version` override it. It waits up to 30 minutes for the checks and prints
387
+ what failed, file by file — pass that on as it is. Programs and scripts
388
+ (`.exe`, `.dll`, `.ps1`, `.js` …) are refused in every repository, so do not
389
+ try to rename one past the check. **Ask before `publish`**, as before any
390
+ save: it makes the mod public once it passes. Ask before `remove`, `block`
391
+ and `delete`, which only the person should decide. The game-side protocol
392
+ (signed requests, the catalogue signature, downloads) is at
393
+ https://coderook.com/docs#mod-repositories.
394
+
395
+ ## Things not to do
396
+
397
+ - Do not run `cbx delete` unless the person has asked for that project to
398
+ be deleted, by name, in this conversation.
399
+ - Do not run `cbx sign-out`. It costs them a token they have to fetch
400
+ again and gains nothing.
401
+ - Do not guess a project name. `cbx projects` lists them; a folder that is
402
+ already linked needs no name at all.
403
+ - Do not pass `--new` to get past the question `submit` asks. It exists for a
404
+ separate project the person wants, not to avoid choosing.
405
+ - Do not run `cbx take-down`. It destroys the files in a version and they do
406
+ not come back. Say it exists and let its owner run it.
407
+
408
+ ## If something refuses
409
+
410
+ The commands explain themselves — pass the message on rather than rewording it.
411
+ A refusal that says a token was not accepted means signing in; one that says a
412
+ project does not allow machines means its owner turned that off deliberately,
413
+ and the answer is to say so, not to find another route in.