@anvil-works/anvil-cli 0.5.2 → 0.5.3
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 +39 -13
- package/dist/cli.js +1841 -1227
- package/dist/index.js +23 -23
- package/package.json +1 -1
- package/scripts/install/install.cmd +7 -0
- package/scripts/install/install.ps1 +11 -1
- package/scripts/install/install.sh +10 -1
package/README.md
CHANGED
|
@@ -34,21 +34,22 @@ curl -fsSL https://anvil.works/install-cli.cmd -o install.cmd && install.cmd &&
|
|
|
34
34
|
### Manual Fallback
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
npm install -g @anvil-works/anvil-cli
|
|
37
|
+
npm install -g @anvil-works/anvil-cli@latest
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
## Quick Start
|
|
41
41
|
|
|
42
|
-
### 1. Run
|
|
42
|
+
### 1. Run Configure (Recommended First Step)
|
|
43
43
|
|
|
44
|
-
Start with guided setup for your default server URL
|
|
44
|
+
Start with guided setup for your default server URL and login:
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
|
-
anvil
|
|
47
|
+
anvil configure
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
When prompted for **Default Anvil server URL**, press Enter unless you're
|
|
51
51
|
running a dedicated enterprise/on-prem Anvil installation.
|
|
52
|
+
`anvil configure` does not run checkout automatically; it ends by suggesting `anvil checkout`.
|
|
52
53
|
|
|
53
54
|
### 2. Check Out Your App from the IDE URL
|
|
54
55
|
|
|
@@ -72,10 +73,11 @@ anvil watch
|
|
|
72
73
|
|
|
73
74
|
- `-A, --appid <APP_ID>` - Specify app ID directly
|
|
74
75
|
- `-f, --first` - Auto-select first detected app ID without confirmation
|
|
75
|
-
- `-s, --staged-only` - Only sync staged changes (use `git add` to stage files)
|
|
76
|
-
- `-a, --auto` - Auto mode: restart on branch changes and sync when behind
|
|
77
|
-
- `-
|
|
78
|
-
- `-
|
|
76
|
+
- `-s, --staged-only` - Only sync staged changes (use `git add` to stage files)
|
|
77
|
+
- `-a, --auto` - Auto mode: restart on branch changes and sync when behind
|
|
78
|
+
- `-O, --open` - Open watched path in your preferred editor (or default app)
|
|
79
|
+
- `-u, --url <ANVIL_URL>` - Specify Anvil server URL (e.g., `anvil.works`, `localhost:3000`)
|
|
80
|
+
- `-V, --verbose` - Show detailed output
|
|
79
81
|
|
|
80
82
|
**Tip:** Open your app in the [Anvil IDE](https://anvil.works) to see your local changes appear in real-time. Changes made in the IDE will also sync back to your local files.
|
|
81
83
|
|
|
@@ -100,10 +102,11 @@ The diagram shows bidirectional sync:
|
|
|
100
102
|
| Command | Description |
|
|
101
103
|
| -------------------------------------- | -------------------------------------------------------------------- |
|
|
102
104
|
| `anvil watch [path]` | Watch directory for changes and sync to Anvil |
|
|
105
|
+
| `anvil watch [path] -O` | Open watched path in preferred editor/default app |
|
|
103
106
|
| `anvil watch -V` or `--verbose` | Watch with verbose logging (detailed output) |
|
|
104
107
|
| `anvil w [path]` | Short form for watch |
|
|
105
|
-
| `anvil
|
|
106
|
-
| `anvil checkout
|
|
108
|
+
| `anvil configure` | Guided setup for default URL and login |
|
|
109
|
+
| `anvil checkout [input] [directory]` | Check out an app by URL/app ID, or interactively with no input |
|
|
107
110
|
| `anvil login [anvil-server-url]` | Authenticate with Anvil using OAuth (supports smart URL handling) |
|
|
108
111
|
| `anvil l [anvil-server-url]` | Short form for login |
|
|
109
112
|
| `anvil logout [anvil-server-url]` | Logout from Anvil (optionally specify URL for specific installation) |
|
|
@@ -160,7 +163,21 @@ anvil watch
|
|
|
160
163
|
|
|
161
164
|
### Checkout Apps
|
|
162
165
|
|
|
163
|
-
`anvil checkout` accepts an editor URL, git URL,
|
|
166
|
+
`anvil checkout` accepts an editor URL, git URL, bare app ID, or no input for interactive selection:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
# Interactive search/select (ordered by most recently edited)
|
|
170
|
+
anvil checkout
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
In interactive mode, apps are displayed as `App Name (APPID)` and support:
|
|
174
|
+
- Arrow-key selection
|
|
175
|
+
- Auto-pagination (fetch-ahead with local cache)
|
|
176
|
+
- Search by app name or app ID
|
|
177
|
+
|
|
178
|
+
In non-interactive mode, pass an explicit app input:
|
|
179
|
+
- `anvil checkout APPID`
|
|
180
|
+
- `anvil checkout https://anvil.works/git/APPID.git`
|
|
164
181
|
|
|
165
182
|
```bash
|
|
166
183
|
# Checkout from editor URL
|
|
@@ -179,6 +196,14 @@ anvil checkout MHVELZG5SZXK2POE my-local-app --url anvil.works
|
|
|
179
196
|
anvil checkout MHVELZG5SZXK2POE --branch master --depth 1 --single-branch
|
|
180
197
|
anvil checkout MHVELZG5SZXK2POE --origin upstream
|
|
181
198
|
anvil checkout MHVELZG5SZXK2POE --quiet
|
|
199
|
+
|
|
200
|
+
# Seed interactive search query
|
|
201
|
+
anvil checkout -Q "dashboard"
|
|
202
|
+
anvil checkout --query "dashboard"
|
|
203
|
+
|
|
204
|
+
# Open watched path in editor/default app
|
|
205
|
+
anvil watch -O
|
|
206
|
+
anvil watch ./my-app -O
|
|
182
207
|
```
|
|
183
208
|
|
|
184
209
|
Safety behavior:
|
|
@@ -199,7 +224,7 @@ Checkout options:
|
|
|
199
224
|
- `--depth <N>` - Shallow clone with `N` commits of history
|
|
200
225
|
- `--single-branch` - Clone only one branch
|
|
201
226
|
- `--origin <NAME>` - Use custom remote name instead of `origin`
|
|
202
|
-
-
|
|
227
|
+
- `--quiet` - Suppress git clone progress output
|
|
203
228
|
- `--verbose` - Verbose git clone output
|
|
204
229
|
- `-f, --force` - Override destination safety checks
|
|
205
230
|
- `-u, --url <ANVIL_URL>` - Override detected Anvil URL
|
|
@@ -296,7 +321,7 @@ anvil config set verbose true
|
|
|
296
321
|
|
|
297
322
|
### Preferred Editor
|
|
298
323
|
|
|
299
|
-
Set this during `anvil
|
|
324
|
+
Set this during `anvil configure`.
|
|
300
325
|
|
|
301
326
|
If needed later, you can still set it manually with:
|
|
302
327
|
|
|
@@ -305,6 +330,7 @@ anvil config set preferredEditor <editor>
|
|
|
305
330
|
```
|
|
306
331
|
|
|
307
332
|
`preferredEditor` is used by checkout for post-checkout guidance and `-O/--open`.
|
|
333
|
+
It is also used by `anvil watch -O`.
|
|
308
334
|
|
|
309
335
|
Verbose output includes timestamped diagnostic lines with file routing details, sync status checks, and other internal processing information.
|
|
310
336
|
|