sitemills-cli 1.0.4 → 1.0.6

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 CHANGED
@@ -104,48 +104,40 @@ SiteMills apps are built on declarative contracts, automatic RPC discovery, sand
104
104
 
105
105
  ---
106
106
 
107
- ## Quickstart: Creating & Deploying a Project
107
+ ## Quickstart
108
108
 
109
- ### 1. Import a Local Directory to a New SiteMills Project
110
109
  ```bash
111
- sitemills-cli import <projectName> <inputDir>
112
- ```
113
- *Example:*
114
- ```bash
115
- sitemills-cli import GradePrep scratch/grade1-superstars
116
- ```
117
- *Output:*
118
- ```text
119
- SUCCESS: Project imported successfully!
120
- Project ID: gradeprep
121
- Branch ID: e4d7df82-24b2-4e3b-97ce-5aa4ba5a79ec
110
+ sitemills-cli login # 1. sign in through your browser
111
+ sitemills-cli list # 2. find your app's ID
112
+ sitemills-cli export <projectId> # 3. download it into ./<projectId>
113
+ cd <projectId>
114
+ # 4. edit the files, then:
115
+ sitemills-cli check # compile your changes without saving anything
116
+ sitemills-cli push # upload your changes and update the branch preview
117
+ sitemills-cli deploy prod # 5. go live (or dev / staging)
122
118
  ```
123
119
 
124
- ### 2. View Branches & Status
125
- ```bash
126
- sitemills-cli list-branches <projectId>
127
- ```
120
+ `export` downloads the app's **Working Draft** and links the folder to it by writing `.sitemills/project.json`. Every command run inside that folder (`check`, `push`, `commit`, `deploy`) uses the link, so you never type IDs. From outside the folder, pass its path instead: `sitemills-cli push ./my-app`.
121
+
122
+ - The `.sitemills/` folder is never uploaded, and it holds no secrets (your login token lives in `~/.sitemills`), so it's fine to commit it to your own git repo.
123
+ - Need a specific branch or folder name? `sitemills-cli export <projectId> <branchId> <outputDir>`.
124
+ - Every folder command also accepts the IDs explicitly: `sitemills-cli push <projectId> <branchId> <dir>`.
125
+
126
+ ### Starting from your own code
128
127
 
129
- ### 3. Compile Project Code
130
- Check local changes without saving or deploying anything:
131
128
  ```bash
132
- sitemills-cli check <projectId> <branchId> <inputDir>
129
+ sitemills-cli import "My App" ./my-folder # creates the app and links ./my-folder to it
130
+ cd my-folder
131
+ sitemills-cli push
133
132
  ```
134
- Recompile what is already on the branch:
133
+
134
+ ### Recompile without local changes
135
+
135
136
  ```bash
136
137
  sitemills-cli compile <projectId> --branch <branchId>
137
138
  ```
138
139
  *Compiles frontend JSX/TSX components (esbuild + Tailwind CSS) and backend TypeScript handlers into the SiteMills V8 isolate runtime.*
139
140
 
140
- ### 4. Deploy Branch to an Environment
141
- ```bash
142
- sitemills-cli deploy <projectId> <branchId> <DEV|STAGING|PROD>
143
- ```
144
- *Example:*
145
- ```bash
146
- sitemills-cli deploy gradeprep e4d7df82-24b2-4e3b-97ce-5aa4ba5a79ec DEV
147
- ```
148
-
149
141
  ---
150
142
 
151
143
  ## Project URLs & Deployment Hostnames
@@ -270,29 +262,31 @@ sitemills-cli <command> [options]
270
262
  ```bash
271
263
  sitemills-cli seed <projectName> [outputDir]
272
264
  ```
273
- - **export**: Export project code from a branch to a local directory.
265
+ - **Folder commands** (`check`, `push`, `commit`, `deploy`): `[dir]` defaults to the current folder and must be a folder created by `export` or `import`. You can always pass `<projectId> <branchId> <dir>` instead.
266
+ - **export**: Download an app's code into a folder and link the folder to the app, so `check`, `push`, `commit`, and `deploy` work inside it without IDs.
274
267
  ```bash
275
- sitemills-cli export <projectId> [branchId] <outputDir>
268
+ sitemills-cli export <projectId> [outputDir] # Working Draft into ./<projectId> by default
269
+ sitemills-cli export <projectId> <branchId> <outputDir>
276
270
  ```
277
271
  - **commit** (or **save-snapshot**): Quickly save a code snapshot to a branch without triggering cloud compilation or tests (~100ms). Only files that differ from the remote branch are uploaded, and remote files missing locally are deleted (pass `--no-prune` to keep them). Automatically saves metadata to `.sitemills/build.json` in the local directory and records the build in `~/.sitemills/builds.json`.
278
272
  ```bash
279
- sitemills-cli commit <projectId> <branchId> <inputDir> [--message <message>] [--no-prune]
273
+ sitemills-cli commit [dir] [--message <message>] [--no-prune]
280
274
  ```
281
275
  - **check**: Compile your local changes against a branch **without saving or deploying anything**. Runs the same frontend and backend compilation as `push`, but creates no snapshot or version, leaves the live branch untouched, and runs no sandbox tests. Exits with code 1 if compilation fails. Use it for a fast edit-compile loop, then `push` once it passes.
282
276
  ```bash
283
- sitemills-cli check <projectId> <branchId> <inputDir> [--no-prune]
277
+ sitemills-cli check [dir] [--no-prune]
284
278
  ```
285
279
  - **push**: Push local updates to a specific branch on SiteMills. Only files that differ from the remote branch are uploaded (compared by content hash), and remote files missing locally are deleted (pass `--no-prune` to keep them). If nothing changed, push exits without recompiling. Performs pre-flight validation on `contracts/jobs.json`, `contracts/db.json`, TypeScript parameter typing, cloud bundle compilation, and automated tests. Pass `--skip-tests` to bypass testing.
286
280
  ```bash
287
- sitemills-cli push <projectId> <branchId> <inputDir> [--message <message>] [--skip-tests] [--no-prune]
281
+ sitemills-cli push [dir] [--message <message>] [--skip-tests] [--no-prune]
288
282
  ```
289
283
  - **compile**: Trigger manual project code compilation for a branch and inspect diagnostics. Pass `--skip-tests` to bypass testing.
290
284
  ```bash
291
285
  sitemills-cli compile <projectId> [--branch <branchId>] [--skip-tests]
292
286
  ```
293
- - **deploy**: Deploy a branch to an environment (`DEV`, `STAGING`, or `PROD`).
287
+ - **deploy**: Deploy a branch to an environment (`dev`, `staging`, or `prod`).
294
288
  ```bash
295
- sitemills-cli deploy <projectId> <branchId> <environment>
289
+ sitemills-cli deploy [dir] <dev|staging|prod>
296
290
  ```
297
291
  - **list-branches**: List all development branches for a project, including active deployed environments.
298
292
  ```bash