@revenexx/cli 0.0.7 → 0.0.9
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 +93 -84
- package/dist/bundle-win-arm64.mjs +66514 -58078
- package/dist/cli.cjs +66518 -58082
- package/dist/cli.d.ts.map +1 -1
- package/dist/index.cjs +1243 -61
- package/dist/index.js +1243 -61
- package/dist/lib/client.d.ts +57 -1
- package/dist/lib/client.d.ts.map +1 -1
- package/dist/lib/command-picker.d.ts +17 -0
- package/dist/lib/command-picker.d.ts.map +1 -0
- package/dist/lib/commands/create/appsdk-core.d.ts +143 -0
- package/dist/lib/commands/create/appsdk-core.d.ts.map +1 -0
- package/dist/lib/commands/create/scaffold-app.d.ts +24 -0
- package/dist/lib/commands/create/scaffold-app.d.ts.map +1 -0
- package/dist/lib/commands/create/scaffold-theme.d.ts +22 -0
- package/dist/lib/commands/create/scaffold-theme.d.ts.map +1 -0
- package/dist/lib/commands/create.d.ts +3 -0
- package/dist/lib/commands/create.d.ts.map +1 -0
- package/dist/lib/commands/deploy.d.ts +3 -0
- package/dist/lib/commands/deploy.d.ts.map +1 -0
- package/dist/lib/commands/generic.d.ts +32 -1
- package/dist/lib/commands/generic.d.ts.map +1 -1
- package/dist/lib/commands/services/apps.d.ts.map +1 -1
- package/dist/lib/commands/services/avatars.d.ts.map +1 -1
- package/dist/lib/commands/services/carts.d.ts.map +1 -1
- package/dist/lib/commands/services/channels.d.ts.map +1 -1
- package/dist/lib/commands/services/customers.d.ts.map +1 -1
- package/dist/lib/commands/services/forms.d.ts.map +1 -1
- package/dist/lib/commands/services/greetings.d.ts.map +1 -1
- package/dist/lib/commands/services/inventories.d.ts.map +1 -1
- package/dist/lib/commands/services/locale.d.ts.map +1 -1
- package/dist/lib/commands/services/markets.d.ts.map +1 -1
- package/dist/lib/commands/services/messaging.d.ts.map +1 -1
- package/dist/lib/commands/services/orderlists.d.ts.map +1 -1
- package/dist/lib/commands/services/orders.d.ts.map +1 -1
- package/dist/lib/commands/services/pages.d.ts.map +1 -1
- package/dist/lib/commands/services/payments.d.ts.map +1 -1
- package/dist/lib/commands/services/prices.d.ts.map +1 -1
- package/dist/lib/commands/services/products.d.ts.map +1 -1
- package/dist/lib/commands/services/search.d.ts.map +1 -1
- package/dist/lib/commands/services/settings.d.ts.map +1 -1
- package/dist/lib/commands/services/shipping.d.ts.map +1 -1
- package/dist/lib/commands/services/sites.d.ts.map +1 -1
- package/dist/lib/commands/services/storage.d.ts.map +1 -1
- package/dist/lib/commands/services/tokens.d.ts.map +1 -1
- package/dist/lib/commands/skills.d.ts +3 -0
- package/dist/lib/commands/skills.d.ts.map +1 -0
- package/dist/lib/commands/tenants.d.ts.map +1 -1
- package/dist/lib/commands/update.d.ts.map +1 -1
- package/dist/lib/config.d.ts +21 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/constants.d.ts +7 -3
- package/dist/lib/constants.d.ts.map +1 -1
- package/dist/lib/interactive.d.ts +68 -0
- package/dist/lib/interactive.d.ts.map +1 -0
- package/dist/lib/oauth.d.ts +97 -0
- package/dist/lib/oauth.d.ts.map +1 -0
- package/dist/lib/parser.d.ts +13 -6
- package/dist/lib/parser.d.ts.map +1 -1
- package/dist/lib/redact.d.ts +12 -0
- package/dist/lib/redact.d.ts.map +1 -0
- package/dist/lib/sdks.d.ts +7 -0
- package/dist/lib/sdks.d.ts.map +1 -1
- package/dist/lib/spinner.d.ts +9 -1
- package/dist/lib/spinner.d.ts.map +1 -1
- package/dist/lib/types.d.ts +10 -2
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/tests/client-transport.test.d.ts +2 -0
- package/dist/tests/client-transport.test.d.ts.map +1 -0
- package/dist/tests/command-picker.test.d.ts +2 -0
- package/dist/tests/command-picker.test.d.ts.map +1 -0
- package/dist/tests/endpoint.test.d.ts +2 -0
- package/dist/tests/endpoint.test.d.ts.map +1 -0
- package/dist/tests/interactive.test.d.ts +2 -0
- package/dist/tests/interactive.test.d.ts.map +1 -0
- package/dist/tests/oauth.test.d.ts +2 -0
- package/dist/tests/oauth.test.d.ts.map +1 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
> **This repository is auto-generated by the [Revenexx SDK Generator](https://github.com/revenexx/sdk-generator). Do not submit changes directly — they will be overwritten on the next generation run.**
|
|
2
2
|
|
|
3
|
-
# Revenexx
|
|
3
|
+
# Revenexx CLI SDK
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|

|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
|
|
10
10
|
Revenexx command-line interface for managing your platform.
|
|
11
11
|
|
|
12
|
-

|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
|
-
The Revenexx
|
|
16
|
+
The Revenexx CLI is a Node based command line tool to help you interact with the Revenexx API. The CLI is distributed both as an [`npm package`](https://www.npmjs.com/package/@revenexx/cli) as well as [pre built binaries](https://github.com/revenexx-sdks/cli/releases/latest) for specific operating systems and architectures.
|
|
17
17
|
|
|
18
18
|
### Install using NPM
|
|
19
19
|
---
|
|
@@ -28,7 +28,7 @@ Once the installation is complete, you can verify the install using
|
|
|
28
28
|
|
|
29
29
|
```sh
|
|
30
30
|
$ revenexx -v
|
|
31
|
-
0.0.
|
|
31
|
+
0.0.9
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
### Install using prebuilt binaries
|
|
@@ -62,115 +62,114 @@ $ scoop install https://raw.githubusercontent.com/revenexx-sdks/cli/master/scoop
|
|
|
62
62
|
Once the installation completes, you can verify your install using
|
|
63
63
|
```
|
|
64
64
|
$ revenexx -v
|
|
65
|
-
0.0.
|
|
65
|
+
0.0.9
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
## Getting Started
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
### 1. Sign in
|
|
71
|
+
|
|
72
|
+
Authenticate once — the CLI stores your session under `~/.revenexx/`.
|
|
71
73
|
|
|
72
74
|
```sh
|
|
75
|
+
# Developers: interactive SSO sign-in via the browser (Zitadel)
|
|
73
76
|
$ revenexx login
|
|
74
77
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
✓ Success
|
|
78
|
+
# CI / scripts: a gateway API key
|
|
79
|
+
$ revenexx login --token <token> --tenant <tenant>
|
|
78
80
|
```
|
|
79
|
-
This will also prompt you to enter your Revenexx endpoint ( default: https://revenexx.com/v1 )
|
|
80
81
|
|
|
81
|
-
|
|
82
|
-
Once logged in, the CLI needs to be initialised before you can use it with your Revenexx project. You can do this with the `revenexx init project` command.
|
|
82
|
+
Confirm who you're signed in as at any time:
|
|
83
83
|
|
|
84
84
|
```sh
|
|
85
|
-
$ revenexx
|
|
85
|
+
$ revenexx whoami
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
See the [Authentication](#authentication) section below for the full login, credential-resolution, and sign-out details.
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
* Keeps track of all your project's collections
|
|
94
|
-
* Helps you deploy your Revenexx project to production and more..
|
|
90
|
+
### 2. Choose a tenant
|
|
91
|
+
|
|
92
|
+
Every request is scoped to a tenant. Set the active one once and the CLI remembers it:
|
|
95
93
|
|
|
96
|
-
You can also fetch all the collections in your current project using
|
|
97
94
|
```sh
|
|
98
|
-
revenexx
|
|
95
|
+
$ revenexx tenants use <slug>
|
|
96
|
+
$ revenexx tenants current
|
|
99
97
|
```
|
|
100
98
|
|
|
101
|
-
|
|
99
|
+
### 3. Run a command
|
|
102
100
|
|
|
103
|
-
|
|
101
|
+
Each API service is exposed as a command, and every method as a subcommand. Discover them with `--help`:
|
|
104
102
|
|
|
105
|
-
```
|
|
106
|
-
$ revenexx
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
✓ Success
|
|
103
|
+
```sh
|
|
104
|
+
$ revenexx --help # list every service
|
|
105
|
+
$ revenexx <service> --help # list a service's methods
|
|
106
|
+
$ revenexx <service> <method> --help # show a method's flags
|
|
110
107
|
```
|
|
111
108
|
|
|
112
|
-
|
|
109
|
+
For example, to list products:
|
|
113
110
|
|
|
114
111
|
```sh
|
|
115
|
-
$
|
|
116
|
-
|
|
117
|
-
My Awesome Function
|
|
118
|
-
├── README.md
|
|
119
|
-
├── index.js
|
|
120
|
-
├── package-lock.json
|
|
121
|
-
└── package.json
|
|
122
|
-
|
|
123
|
-
0 directories, 4 files
|
|
112
|
+
$ revenexx products products-list
|
|
124
113
|
```
|
|
125
114
|
|
|
126
|
-
|
|
115
|
+
Ready-to-copy examples for every command are generated under [`docs/examples/`](docs/examples).
|
|
127
116
|
|
|
128
|
-
|
|
129
|
-
|
|
117
|
+
> ### Note
|
|
118
|
+
> By default, requests to domains with self-signed SSL certificates (or no certificates) are rejected. If you trust the host, you can bypass certificate validation using
|
|
119
|
+
> ```sh
|
|
120
|
+
> $ revenexx client --self-signed true
|
|
121
|
+
> ```
|
|
130
122
|
|
|
131
|
-
|
|
132
|
-
ℹ Info Deploying function My Awesome Function ( 61d1a4c81dfcd95bc834 )
|
|
133
|
-
✓ Success Deployed My Awesome Function ( 61d1a4c81dfcd95bc834 )
|
|
134
|
-
```
|
|
123
|
+
## Authentication
|
|
135
124
|
|
|
136
|
-
|
|
125
|
+
The CLI supports two ways to authenticate:
|
|
137
126
|
|
|
138
|
-
|
|
127
|
+
- **Gateway API key** — non-interactive, ideal for CI and scripts. Sent as `X-Revenexx-Api-Key`.
|
|
128
|
+
- **Zitadel SSO** — interactive browser sign-in for developers, using OAuth2 Authorization Code + PKCE. Mints a JWT that the CLI sends in the standard `Authorization: Bearer` header.
|
|
139
129
|
|
|
140
|
-
|
|
130
|
+
An API key always takes precedence; SSO is the fallback when no key is present (or when you force it with `--browser`).
|
|
141
131
|
|
|
142
|
-
|
|
143
|
-
revenexx push collection
|
|
144
|
-
```
|
|
132
|
+
### Interactive SSO login
|
|
145
133
|
|
|
146
|
-
> ### Note
|
|
147
|
-
> By default, requests to domains with self signed SSL certificates (or no certificates) are disabled. If you trust the domain, you can bypass the certificate validation using
|
|
148
134
|
```sh
|
|
149
|
-
|
|
135
|
+
# Sign in with the browser (used automatically when no API key is configured):
|
|
136
|
+
$ revenexx login
|
|
137
|
+
|
|
138
|
+
# Force SSO even if an API key is present (alias: --sso):
|
|
139
|
+
$ revenexx login --browser
|
|
150
140
|
```
|
|
151
141
|
|
|
152
|
-
|
|
142
|
+
This opens your browser to sign in with Zitadel, captures the response on a local loopback callback (a fixed port — `8000` by default; free it if `login` reports it's in use), exchanges it for a JWT, and stores the JWT (plus a refresh token) in `~/.revenexx/prefs.json`. Expired JWTs are refreshed automatically; if the refresh fails you're prompted to `login` again. Once signed in, commands authenticate with the JWT in the `Authorization: Bearer` header.
|
|
143
|
+
|
|
144
|
+
The Zitadel application is preconfigured, but every value can be overridden through the environment — useful for self-hosted or staging identity providers:
|
|
153
145
|
|
|
154
|
-
|
|
146
|
+
| Variable | Default | Purpose |
|
|
147
|
+
|---|---|---|
|
|
148
|
+
| `REVENEXX_SSO_ISSUER` | `https://id.revenexx.com` | OIDC issuer; the authorize/token/userinfo endpoints come from its discovery document |
|
|
149
|
+
| `REVENEXX_SSO_CLIENT_ID` | built-in CLI client | Zitadel application (native / public) client ID |
|
|
150
|
+
| `REVENEXX_SSO_REDIRECT_URI` | `http://127.0.0.1:8000/callback` | Loopback callback — must exactly match a redirect URI registered on the Zitadel app |
|
|
155
151
|
|
|
156
|
-
###
|
|
152
|
+
### API key login (non-interactive)
|
|
157
153
|
|
|
158
154
|
```sh
|
|
155
|
+
# CI / scripts:
|
|
156
|
+
$ revenexx login --token <token> --tenant <tenant>
|
|
157
|
+
|
|
158
|
+
# Project workspace — drop credentials in `.env` or `.revenexx.yaml`:
|
|
159
159
|
$ revenexx login
|
|
160
160
|
```
|
|
161
161
|
|
|
162
|
-
With no flags, `login` resolves a token from (in order) `--token`, `REVENEXX_API_KEY`, then `.revenexx.yaml`.
|
|
162
|
+
With no flags, `login` resolves a token from (in order) `--token`, `REVENEXX_API_KEY`, then `.revenexx.yaml`. A found token is validated against the gateway (`GET /locale`) and persisted to `~/.revenexx/prefs.json`.
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
### Inspecting and clearing your session
|
|
165
165
|
|
|
166
166
|
```sh
|
|
167
|
-
#
|
|
168
|
-
$ revenexx
|
|
169
|
-
|
|
170
|
-
# Project workspace — drop credentials in `.env` or `.revenexx.yaml`
|
|
171
|
-
$ revenexx login
|
|
167
|
+
$ revenexx whoami # auth method, its source, tenant and endpoint
|
|
168
|
+
$ revenexx logout # clears the stored local session(s)
|
|
172
169
|
```
|
|
173
170
|
|
|
171
|
+
`whoami` reports **where** the active credential comes from — e.g. `REVENEXX_API_KEY env var`, `.revenexx.yaml`, or `login session`. Note that `logout` only clears the stored session: a key supplied via `REVENEXX_API_KEY` or `.revenexx.yaml` keeps authenticating you (and outranks any SSO session), so `logout` will warn you when one is still active. Unset it to fully sign out.
|
|
172
|
+
|
|
174
173
|
### Credential resolution order
|
|
175
174
|
|
|
176
175
|
For any command that needs auth, credentials are resolved as:
|
|
@@ -178,9 +177,11 @@ For any command that needs auth, credentials are resolved as:
|
|
|
178
177
|
1. CLI flag — `--token`, `--endpoint`, `--project-id`, `--tenant`
|
|
179
178
|
2. Environment variables — `REVENEXX_API_KEY`, `REVENEXX_API_URL`, `REVENEXX_TENANT` (legacy alias `REVENEXX_PROJECT` is still honoured)
|
|
180
179
|
3. Project file `.revenexx.yaml` — nearest one, walking up from the current directory
|
|
181
|
-
4. Global config at `~/.revenexx/prefs.json` — populated by `revenexx login`
|
|
180
|
+
4. Global config at `~/.revenexx/prefs.json` — an API key, or an SSO JWT, populated by `revenexx login`
|
|
182
181
|
5. Built-in default endpoint
|
|
183
182
|
|
|
183
|
+
When no API key resolves, a stored SSO JWT (from `login --browser`) is used instead, sent in the `Authorization: Bearer` header.
|
|
184
|
+
|
|
184
185
|
Exception: the tenant slug prefers the explicit `tenants use` switch — `--tenant` flag → `~/.revenexx/tenant` → `REVENEXX_TENANT` → `.revenexx.yaml`.
|
|
185
186
|
|
|
186
187
|
## Versioning & changesets
|
|
@@ -229,31 +230,35 @@ Use the `--image` flag on the script to pin a specific Node base (e.g. `--image
|
|
|
229
230
|
|
|
230
231
|
## Global Configuration
|
|
231
232
|
|
|
232
|
-
The CLI stores its
|
|
233
|
+
The CLI stores its state in `~/.revenexx/prefs.json`. It holds one entry per signed-in **session**, keyed by a generated session ID, plus a top-level `current` that points at the active one. You don't normally edit this by hand — it's written by `login`, `logout`, `tenants use`, and `client`.
|
|
233
234
|
|
|
234
235
|
```json
|
|
235
236
|
{
|
|
236
|
-
"current": "",
|
|
237
|
-
"
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
237
|
+
"current": "6a3ba27f0010bb19c8e6",
|
|
238
|
+
"6a3ba27f0010bb19c8e6": {
|
|
239
|
+
"endpoint": "https://api.revenexx.com",
|
|
240
|
+
"email": "you@example.com",
|
|
241
|
+
"authMethod": "sso",
|
|
242
|
+
"jwt": "<json-web-token>",
|
|
243
|
+
"refreshToken": "<refresh-token>",
|
|
244
|
+
"jwtExpiresAt": 1782336318182
|
|
245
|
+
}
|
|
243
246
|
}
|
|
244
247
|
```
|
|
245
248
|
|
|
246
|
-
| Key | Description |
|
|
247
|
-
|
|
248
|
-
| `current` |
|
|
249
|
-
| `
|
|
250
|
-
| `
|
|
251
|
-
| `
|
|
252
|
-
| `key` | API key
|
|
253
|
-
| `
|
|
254
|
-
| `
|
|
249
|
+
| Key | Scope | Description |
|
|
250
|
+
|-----|-------|-------------|
|
|
251
|
+
| `current` | top-level | ID of the active session (set on `login`, cleared on `logout`) |
|
|
252
|
+
| `authMethod` | session | `apikey` or `sso` |
|
|
253
|
+
| `endpoint` | session | Revenexx API URL for the session |
|
|
254
|
+
| `email` | session | Signed-in identity (or `apikey:<tenant>` for API-key sessions) |
|
|
255
|
+
| `key` | session | Gateway API key — API-key sessions; sent as `X-Revenexx-Api-Key` |
|
|
256
|
+
| `jwt` | session | SSO JSON Web Token — sent as `Authorization: Bearer` |
|
|
257
|
+
| `refreshToken` | session | SSO refresh token, used to silently renew the JWT |
|
|
258
|
+
| `jwtExpiresAt` | session | JWT expiry (epoch ms); the CLI refreshes shortly before it lapses |
|
|
259
|
+
| `selfSigned` | session | Allow self-signed TLS certificates (`true`/`false`) |
|
|
255
260
|
|
|
256
|
-
|
|
261
|
+
Rather than editing the file, configure the active session via the CLI:
|
|
257
262
|
|
|
258
263
|
```sh
|
|
259
264
|
$ revenexx client --endpoint https://api.revenexx.com
|
|
@@ -261,9 +266,13 @@ $ revenexx client --key YOUR_API_KEY
|
|
|
261
266
|
$ revenexx client --self-signed true
|
|
262
267
|
```
|
|
263
268
|
|
|
269
|
+
## Sample
|
|
270
|
+
|
|
271
|
+
See a runnable example for this SDK in the [samples repo](https://github.com/revenexx-sdks/samples/tree/main/cli).
|
|
272
|
+
|
|
264
273
|
## Contribution
|
|
265
274
|
|
|
266
|
-
This library is auto-generated by
|
|
275
|
+
This library is auto-generated by the Revenexx [SDK Generator](https://github.com/revenexx/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/revenexx/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request.
|
|
267
276
|
|
|
268
277
|
To build and test the CLI for development, follow these steps
|
|
269
278
|
|