@vcityio/cli 0.1.0 → 0.2.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 +81 -3
- package/dist/vcity-darwin-arm64 +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,10 +5,38 @@ Official command-line interface for [vcity](https://vcity.io). Modeled after `gh
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
+
# Standalone binary — no Node, no bun, nothing else required
|
|
9
|
+
curl -fsSL https://vcity.io/cli/install.sh | sh
|
|
10
|
+
|
|
11
|
+
# OR via npm (Node 20+)
|
|
8
12
|
npm install -g @vcityio/cli
|
|
9
13
|
```
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
The curl installer detects your platform (`darwin-arm64`, `darwin-x64`, `linux-x64`, `linux-arm64`, `windows-x64`), downloads the matching binary from GitHub Releases, and drops it into `/usr/local/bin/vcity`. Falls back to `npm install -g` if your platform doesn't have a published binary.
|
|
16
|
+
|
|
17
|
+
Pin a specific version or install dir:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
VCITY_CLI_VERSION=0.1.0 curl -fsSL https://vcity.io/cli/install.sh | sh
|
|
21
|
+
VCITY_CLI_INSTALL_DIR=$HOME/.local/bin curl -fsSL https://vcity.io/cli/install.sh | sh
|
|
22
|
+
VCITY_CLI_FORCE_NPM=1 curl -fsSL https://vcity.io/cli/install.sh | sh
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Uninstall
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
curl -fsSL https://vcity.io/cli/uninstall.sh | sh
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Auto-detects how you installed (binary in `/usr/local/bin` or npm-global) and removes both. Also wipes `~/.vcity` (auth tokens + config) by default — set `VCITY_CLI_KEEP_CONFIG=1` to keep your tokens, or `VCITY_CLI_FORCE=1` to skip the confirmation prompt when run interactively.
|
|
32
|
+
|
|
33
|
+
Manual paths if you prefer:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
sudo rm /usr/local/bin/vcity # binary install
|
|
37
|
+
npm uninstall -g @vcityio/cli # npm install
|
|
38
|
+
rm -rf ~/.vcity # local config + tokens
|
|
39
|
+
```
|
|
12
40
|
|
|
13
41
|
## First run
|
|
14
42
|
|
|
@@ -41,8 +69,43 @@ Every read command accepts `--json` for scripting. Output auto-falls-back to JSO
|
|
|
41
69
|
| `vcity org use <slug>` | Set the active org. |
|
|
42
70
|
| `vcity products list [--org <slug>] [--limit <n>] [--json]` | List products of the active org. |
|
|
43
71
|
| `vcity products get <id> [--org <slug>] [--json]` | Print a single product. |
|
|
44
|
-
|
|
45
|
-
|
|
72
|
+
| `vcity products create [--name --price --currency --sku --data @file] [--json]` | Create a product. `--data` seeds the body; named flags override. |
|
|
73
|
+
| `vcity products update <id> [--name --price --currency --sku --visibility --availability --data]` | Patch product fields. |
|
|
74
|
+
| `vcity products delete <id> [--yes] [--json]` | Soft-delete a product. Asks y/N unless `--yes`. |
|
|
75
|
+
| `vcity events list [--org <slug>] [--limit <n>] [--status active\|disabled] [--json]` | List events. |
|
|
76
|
+
| `vcity events get <id> [--org <slug>] [--json]` | Print a single event. |
|
|
77
|
+
| `vcity events create [--name --starts-at --ends-at --slug --data]` | Create an event. `--starts-at` / `--ends-at` accept ISO or epoch-ms. |
|
|
78
|
+
| `vcity events update <id> [--name --starts-at --ends-at --slug --status --data]` | Patch event fields. |
|
|
79
|
+
| `vcity events delete <id> [--yes]` | Soft-delete an event. |
|
|
80
|
+
| `vcity rooms list [--org <slug>] [--limit <n>] [--json]` | List rooms. |
|
|
81
|
+
| `vcity rooms get <id> [--org <slug>] [--json]` | Print a single room. |
|
|
82
|
+
| `vcity rooms create [--title --description --type --data]` | Create a room. |
|
|
83
|
+
| `vcity rooms update <id> [--title --description --type --disabled --data]` | Patch room fields. |
|
|
84
|
+
| `vcity rooms delete <id> [--yes]` | Soft-delete a room. |
|
|
85
|
+
| `vcity bookings list [--org <slug>] [--limit <n>] [--status <s>] [--json]` | List bookings. |
|
|
86
|
+
| `vcity bookings get <id> [--org <slug>] [--json]` | Print a single booking. |
|
|
87
|
+
| `vcity orders list [--org <slug>] [--limit <n>] [--status <s>] [--json]` | List orders. |
|
|
88
|
+
| `vcity orders get <id> [--org <slug>] [--json]` | Print a single order. |
|
|
89
|
+
| `vcity quotes list [--org <slug>] [--limit <n>] [--status <s>] [--json]` | List quote requests. |
|
|
90
|
+
| `vcity quotes get <id> [--org <slug>] [--json]` | Print a single quote. |
|
|
91
|
+
| `vcity update [--check] [--yes] [--json]` | Self-update the CLI binary. |
|
|
92
|
+
|
|
93
|
+
### `--data` flag
|
|
94
|
+
|
|
95
|
+
Create / update commands accept `--data <jsonOrPath>`:
|
|
96
|
+
|
|
97
|
+
- Inline: `--data '{"name":"My Product","price":19.99}'`
|
|
98
|
+
- File: `--data @./product.json`
|
|
99
|
+
|
|
100
|
+
Named flags (`--name`, `--price`, …) override values in `--data`. Combine the
|
|
101
|
+
two to start from a template file and override one field per invocation.
|
|
102
|
+
|
|
103
|
+
### Delete safety
|
|
104
|
+
|
|
105
|
+
Delete commands ask `y/N` before sending the request. Pass `--yes` to skip the
|
|
106
|
+
prompt (required in `--json` / non-TTY mode). All deletes are **soft** — the
|
|
107
|
+
record stays in the database with `deletedAt` set, and read endpoints filter
|
|
108
|
+
it out.
|
|
46
109
|
|
|
47
110
|
## Environment variables
|
|
48
111
|
|
|
@@ -51,9 +114,24 @@ More commands (events, bookings, quotes, product mutations + bulk import) land i
|
|
|
51
114
|
| `VCITY_API_BASE_URL` | Override the API host (e.g. `https://staging.vcity.io`). |
|
|
52
115
|
| `VCITY_CONFIG_DIR` | Override the config dir (default `~/.vcity`). Handy for sandboxing dev sessions. |
|
|
53
116
|
| `VCITY_NO_OPEN_BROWSER` | Never auto-launch a browser during `vcity login`. |
|
|
117
|
+
| `VCITY_NO_UPDATE_CHECK` | Disable the background "new version available" check. |
|
|
54
118
|
|
|
55
119
|
CI tip: `vcity` detects non-interactive stdout and emits JSON without `--json`. Combine with `jq` for pipelines.
|
|
56
120
|
|
|
121
|
+
### Update notifications
|
|
122
|
+
|
|
123
|
+
`vcity` checks the npm registry once every 24h (cached at
|
|
124
|
+
`~/.vcity/update-check.json`) for a newer release. When one exists, a one-line
|
|
125
|
+
banner is printed to stderr after the command finishes:
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
→ vcity 0.3.0 available (you have 0.2.1). Run `vcity update` to upgrade.
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
The check is silent when piped or non-interactive, in `--json` mode, when
|
|
132
|
+
running `vcity update` itself, or when `VCITY_NO_UPDATE_CHECK=1` is set. The
|
|
133
|
+
fetch has a 1.5s timeout and never blocks command output.
|
|
134
|
+
|
|
57
135
|
## Authentication
|
|
58
136
|
|
|
59
137
|
The CLI uses **device-flow** tokens (`vcli_…`) issued through the vcity web app. They inherit your user's org permissions. Refresh tokens rotate single-use — token theft revokes the entire session.
|
|
Binary file
|