creght-cli 0.10.0 → 0.12.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.
package/README.md
CHANGED
|
@@ -45,7 +45,9 @@ The command opens a browser authorization page. After authorization succeeds, th
|
|
|
45
45
|
~/Library/Application Support/creght/config.json
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
The config file contains the
|
|
48
|
+
The config file contains the default API host and CLI tokens. Tokens are stored per API host, so logging in to `https://creght.cn`, `https://creght.com`, or a local backend does not overwrite the other hosts' login state.
|
|
49
|
+
|
|
50
|
+
`CREGHT_API_HOST` applies to the single command it is set on and never changes the saved default. A login prefixed with it saves a token for that host and leaves the default alone, so a later bare `creght project list` still talks to the default host. To switch hosts for good, see [Default API Host](#default-api-host).
|
|
49
51
|
|
|
50
52
|
When `--web` is omitted, the CLI uses `CREGHT_WEB_HOST` if set. For local API hosts such as `localhost` or `127.0.0.1`, it defaults to `http://localhost:5173`.
|
|
51
53
|
For production, the default API host and default web host are both `https://creght.cn`.
|
|
@@ -60,6 +62,25 @@ creght logout
|
|
|
60
62
|
|
|
61
63
|
When `CREGHT_API_HOST` is set, `logout` removes only that host's token. Other saved hosts remain logged in. If the last saved token is removed, the config file is deleted.
|
|
62
64
|
|
|
65
|
+
Logging out does not move the default API host either, unless the default is the host being logged out of.
|
|
66
|
+
|
|
67
|
+
## Default API Host
|
|
68
|
+
|
|
69
|
+
Commands run without `CREGHT_API_HOST` use the saved default API host, `https://creght.cn` until it is changed. Show it, and any override in effect:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
creght config get
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Change it:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
creght config set api_host=https://creght.com
|
|
79
|
+
creght config set api_host=http://localhost:8433
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
This is the only thing that moves the default — neither `login` nor `logout` under `CREGHT_API_HOST` does. Tokens are kept per API host, so switching to a host already logged in to needs no new login.
|
|
83
|
+
|
|
63
84
|
## List Projects
|
|
64
85
|
|
|
65
86
|
```bash
|
|
@@ -602,6 +623,8 @@ preview. The CLI does not render sites locally.
|
|
|
602
623
|
```bash
|
|
603
624
|
creght login [--web=https://creght.cn]
|
|
604
625
|
creght logout
|
|
626
|
+
creght config get
|
|
627
|
+
creght config set api_host=https://creght.cn
|
|
605
628
|
creght project list
|
|
606
629
|
creght pull --site_id=<project_id>/<site_id> --dir=./mysite
|
|
607
630
|
creght push --site_id=<project_id>/<site_id> --dir=./mysite
|
|
@@ -628,6 +651,7 @@ Command meanings:
|
|
|
628
651
|
|
|
629
652
|
- `login`: Authenticate this machine with Creght and save a CLI token for the current API host.
|
|
630
653
|
- `logout`: Remove the saved CLI login for the current API host.
|
|
654
|
+
- `config`: Show (`config get`) or change (`config set api_host=<url>`) the default API host used when `CREGHT_API_HOST` is not set.
|
|
631
655
|
- `project`: List available projects and sites. Use `project_id/site_id` with site commands. Also supports `project create`.
|
|
632
656
|
- `pull`: Download site files (including Func code under `backend/func/`) into a local workspace, three-way merging remote and local edits.
|
|
633
657
|
- `push`: Push local workspace changes to the remote site/project after a three-way conflict check.
|
package/package.json
CHANGED
|
Binary file
|
package/vendor/darwin-x64/creght
CHANGED
|
Binary file
|
|
Binary file
|
package/vendor/linux-x64/creght
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|