creght-cli 0.15.0 → 0.17.0

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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Creght CLI is a thin local bridge for syncing site code between a local directory and Creght.
4
4
 
5
- Creght remains responsible for cloud rendering, CMS, assets, and the preview environment. The CLI does not render sites locally; use `creght preview` to open the canonical remote preview.
5
+ Creght remains responsible for cloud rendering, CMS, assets, and the preview environment. The CLI does not render sites locally; use `creght url` to print the canonical remote preview address.
6
6
 
7
7
  ## Install
8
8
 
@@ -255,6 +255,14 @@ paths from `pull`, `diff`, and `push`. Ignored remote files are left untouched,
255
255
  including when using `push --delete` or `push --force`. The `.creghtignore`
256
256
  file itself is always local and is never synced.
257
257
 
258
+ Order matters: an ignored path also loses its base state, so a rule added
259
+ before the remote copy was deleted leaves that copy live on the site with no
260
+ base for `push --delete` to plan from. `push` and `diff` name the remote files
261
+ a rule is hiding, and `creght rm <path>` deletes one of them. To clear several,
262
+ remove the rule and run `push` to rebuild their base state (`pull` instead if
263
+ the local and remote copies have diverged), delete the files locally, run
264
+ `push --delete`, then add the rule back.
265
+
258
266
  The syntax follows common gitignore conventions: blank lines, `#` comments,
259
267
  `!` negation, root-relative patterns, directory patterns, and `*`, `?`, and
260
268
  `**` wildcards. For example:
@@ -330,18 +338,44 @@ content is backed up under `.creght/backup/<timestamp>-*/`.
330
338
  `base_to_local_diff` / `base_to_remote_diff`, so agents can decide how to
331
339
  resolve without extra round-trips.
332
340
 
333
- ## Open Preview
341
+ ## Site Addresses
342
+
343
+ Print every address a site answers on:
344
+
345
+ ```bash
346
+ creght url
347
+ ```
348
+
349
+ ```text
350
+ Preview: https://<site_id>.preview.creght.cn/
351
+ Live: https://demo.creght.cn/ v11
352
+ https://www.example.com/ v12 (pinned)
353
+ Editor: https://creght.cn/teditor/project/<project_id>/site/<site_id>
354
+ ```
334
355
 
335
- Open the remote preview URL for a site in the browser:
356
+ - **Preview** always serves the current remote workspace, so a `push` shows up
357
+ there immediately.
358
+ - **Live** lists each published domain and the version it serves. A pinned
359
+ domain stays on its own version instead of following the site default.
360
+ - **Editor** opens the site in the Creght web editor.
361
+
362
+ Nothing is opened unless you ask, so the command also works over SSH, in CI,
363
+ and under an agent:
336
364
 
337
365
  ```bash
338
- creght preview --site_id=<project_id>/<site_id>
366
+ creght url --open # print, then open the preview
367
+ creght url --json # {"preview":...,"live":[...],"editor":...}
368
+ creght url --site_id=<project_id>/<site_id>
339
369
  ```
340
370
 
371
+ `creght preview` is an alias of `creght url` and takes the same flags. Inside a
372
+ pulled workspace `--site_id` is optional; it is read from `.creght/state.json`
373
+ like `pull`/`push` do.
374
+
341
375
  For local development:
342
376
 
343
377
  ```bash
344
- CREGHT_API_HOST=http://localhost:8433 creght preview --site_id=<project_id>/<site_id>
378
+ CREGHT_API_HOST=http://localhost:8433 creght url --site_id=<project_id>/<site_id>
345
379
  ```
346
380
 
347
381
  ## Publish Site
@@ -368,7 +402,8 @@ CREGHT_API_HOST=http://localhost:8433 creght publish --site_id=<project_id>/<sit
368
402
 
369
403
  ```text
370
404
  Published <project_id>/<site_id>
371
- version 14 (id 458) is live on demo.creght.cn
405
+ version 14 (id 458) is live on:
406
+ https://demo.creght.cn/
372
407
  ```
373
408
 
374
409
  ## Site Versions
@@ -680,8 +715,8 @@ source of truth.
680
715
 
681
716
  Creght CLI is a local bridge for Creght site code. It can authenticate with
682
717
  Creght, list projects and sites, pull remote site files into a local directory
683
- with three-way merge, push local files back to Creght, resolve conflicts, open
684
- the remote preview, and publish a site.
718
+ with three-way merge, push local files back to Creght, resolve conflicts, print
719
+ a site's preview and live addresses, and publish a site.
685
720
 
686
721
  It can also manage site versions: immutable snapshots of a site's source files,
687
722
  created and published like git commits.
@@ -698,7 +733,7 @@ creght project list
698
733
  creght pull --site_id=<project_id>/<site_id> --dir=./mysite
699
734
  creght push --site_id=<project_id>/<site_id> --dir=./mysite
700
735
  creght resolve --list
701
- creght preview --site_id=<project_id>/<site_id>
736
+ creght url [--open] [--json] [--site_id=<project_id>/<site_id>]
702
737
  creght publish --site_id=<project_id>/<site_id> [--note=<note>]
703
738
  creght cms collections --site_id=<project_id>/<site_id>
704
739
  creght cms collection create --site_id=<project_id>/<site_id> --key=<key> --name=<name> --schema=./schema.json
@@ -724,8 +759,9 @@ Command meanings:
724
759
  - `project`: List available projects and sites. Use `project_id/site_id` with site commands. Also supports `project create`.
725
760
  - `pull`: Download site files (including Func code under `backend/func/`) into a local workspace, three-way merging remote and local edits.
726
761
  - `push`: Push local workspace changes to the remote site/project after a three-way conflict check.
762
+ - `rm`: Delete one remote site file by path, including a file hidden by `.creghtignore` that `push --delete` cannot reach. Leaves the local copy on disk.
727
763
  - `resolve`: List files with conflict markers, or resolve one by keeping the local (`--ours`) or remote (`--theirs`) side.
728
- - `preview`: Open the remote preview URL for a site in the browser.
764
+ - `url`: Print a site's preview, live and editor addresses; `--open` also opens the preview, `--json` prints them for scripting. `preview` is an alias.
729
765
  - `publish`: Snapshot the current remote site source into a new version and make it live in one step.
730
766
  - `cms`: Manage CMS collections.
731
767
  - `content`: Manage CMS content entries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "creght-cli",
3
- "version": "0.15.0",
3
+ "version": "0.17.0",
4
4
  "description": "Creght CLI for syncing local site code with Creght.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/creght-dev/creght-cli#readme",
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file