@airwallex/airi-cli 0.1.0-beta.1 → 0.1.0-beta.2
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 +60 -8
- package/checksums.json +4 -4
- package/package.json +1 -1
- package/scripts/postinstall.mjs +35 -15
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# airi-cli
|
|
2
2
|
|
|
3
|
-

|
|
4
4
|
|
|
5
5
|
Command-line tool for the Airi wallet. Authenticate with OAuth, inspect your
|
|
6
6
|
session, and drive an **agentic checkout** — list payment methods, create a
|
|
@@ -13,7 +13,8 @@ and agents.
|
|
|
13
13
|
## Installation
|
|
14
14
|
|
|
15
15
|
airi-cli is available for macOS and Linux as a single self-contained binary.
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
### npm
|
|
17
18
|
|
|
18
19
|
```bash
|
|
19
20
|
npm install -g @airwallex/airi-cli@beta
|
|
@@ -23,17 +24,68 @@ This installs the `@airwallex/airi-cli` package, which downloads the prebuilt
|
|
|
23
24
|
binary for your platform, verifies its SHA256 checksum, and puts `airi-cli` on
|
|
24
25
|
your `PATH`.
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
To run it once without installing globally, use npx:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx @airwallex/airi-cli@beta
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
#### Switching from a `curl | sh` install
|
|
34
|
+
|
|
35
|
+
If you previously installed with the `install.sh` script (via `curl`), remove
|
|
36
|
+
that copy first — otherwise it may stay ahead of the npm one on your `PATH` and
|
|
37
|
+
keep shadowing it, so `airi-cli` keeps running the old binary.
|
|
38
|
+
|
|
39
|
+
Check for more than one `airi-cli` on your `PATH`:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
which -a airi-cli
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
If an entry under `~/.local/bin` (the `install.sh` default) shows up alongside
|
|
46
|
+
the npm one, remove the old install:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
curl -fsSL https://raw.githubusercontent.com/airwallex/airi-cli/master/install.sh | sh -s -- uninstall
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Then reopen your shell and re-check with `which -a airi-cli`.
|
|
28
53
|
|
|
29
|
-
|
|
54
|
+
### install.sh (fallback)
|
|
55
|
+
|
|
56
|
+
If npm is not available, install the binary directly with the install script:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
curl -fsSL https://raw.githubusercontent.com/airwallex/airi-cli/master/install.sh | sh
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
To uninstall (removes the binary and local state):
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
curl -fsSL https://raw.githubusercontent.com/airwallex/airi-cli/master/install.sh | sh -s -- uninstall
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Install-time environment variables
|
|
69
|
+
|
|
70
|
+
Both install methods honour the same variables and behave identically, except
|
|
71
|
+
where noted:
|
|
30
72
|
|
|
31
73
|
| Variable | Description |
|
|
32
74
|
|----------|-------------|
|
|
33
|
-
| `AIRI_CLI_VERSION` |
|
|
34
|
-
| `
|
|
75
|
+
| `AIRI_CLI_VERSION` | Install a specific release tag (e.g. `v0.1.0`) instead of the default. With npm the pinned checksum only matches the package's own version, so overriding it there also requires `AIRI_CLI_SKIP_CHECKSUM=1`. |
|
|
76
|
+
| `AIRI_CLI_INSTALL_DIR` | install.sh only: where to install (default: `$HOME/.local/bin`). npm always installs inside the package and ignores this. |
|
|
35
77
|
| `AIRI_CLI_SKIP_CHECKSUM` | **Local development only.** Set to `1` to bypass SHA256 verification. Never use this in production or CI. |
|
|
36
|
-
| `
|
|
78
|
+
| `AIRI_CLI_SKIP_SKILLS` | Set to `1` to skip deploying the bundled agent skills. |
|
|
79
|
+
|
|
80
|
+
Both methods deploy the bundled agent skills at install time. You can also
|
|
81
|
+
deploy them to a specific project with:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npx skills add airwallex/airi-cli
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
or re-run deployment any time with `airi-cli skills install` (see
|
|
88
|
+
[Skills](#skills)).
|
|
37
89
|
|
|
38
90
|
### Checking for updates
|
|
39
91
|
|
package/checksums.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"checksums": {
|
|
3
|
-
"linux_amd64": "
|
|
4
|
-
"linux_arm64": "
|
|
5
|
-
"macos_x86_64": "
|
|
6
|
-
"macos_arm64": "
|
|
3
|
+
"linux_amd64": "1654d67477a4673902000467638dd9d8dabeebaf05b6ccc2f3b32776cd18e8a5",
|
|
4
|
+
"linux_arm64": "9962fd90bfd55d5aa722e0c40ce93038656101127aeed60c58a2ea169a36efcd",
|
|
5
|
+
"macos_x86_64": "e81bb619536b8b5c86bf3f9d94c1436022c51a3bf03d14bbf640bc6154e38235",
|
|
6
|
+
"macos_arm64": "5f9fbb14c3d27e7375fa4e9d17f99b27d21b3883f7c94ddc70c89e07d276f849"
|
|
7
7
|
}
|
|
8
8
|
}
|
package/package.json
CHANGED
package/scripts/postinstall.mjs
CHANGED
|
@@ -17,20 +17,19 @@
|
|
|
17
17
|
//
|
|
18
18
|
// Environment variables:
|
|
19
19
|
// AIRI_CLI_VERSION download this release tag instead of the package's
|
|
20
|
-
// own version
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
// AIRI_CLI_SKIP_DOWNLOAD set to "1" to skip the download entirely. Useful
|
|
24
|
-
// for offline CI that provides the binary another
|
|
25
|
-
// way; the CLI won't run until it is present.
|
|
20
|
+
// own version. The pinned digest only matches the
|
|
21
|
+
// package's own version, so an override also requires
|
|
22
|
+
// AIRI_CLI_SKIP_CHECKSUM.
|
|
26
23
|
// AIRI_CLI_SKIP_CHECKSUM set to "1" to skip SHA256 verification (local-dev
|
|
27
24
|
// only — never in production or CI).
|
|
28
|
-
//
|
|
25
|
+
// AIRI_CLI_SKIP_SKILLS set to "1" to skip deploying the bundled agent skills.
|
|
26
|
+
// AIRI_CLI_BASE_URL (internal, undocumented) override the release host.
|
|
27
|
+
// The e2e tests point it at a local server; kept out
|
|
28
|
+
// of the README so it isn't a supported user knob.
|
|
29
29
|
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
// re-reports a missing binary with the same remediation if the CLI is run.
|
|
30
|
+
// A download or verification failure warns but does NOT hard-fail: a transient
|
|
31
|
+
// network issue must not abort a larger `npm install`. The launcher re-reports
|
|
32
|
+
// a missing binary with the same remediation if the CLI is run.
|
|
34
33
|
|
|
35
34
|
import { createWriteStream, existsSync } from 'node:fs'
|
|
36
35
|
import { mkdir, mkdtemp, readFile, rm, chmod, rename } from 'node:fs/promises'
|
|
@@ -157,12 +156,29 @@ function extract(tarball, destDir) {
|
|
|
157
156
|
if (res.status !== 0) throw new Error(`tar exited ${res.status}`)
|
|
158
157
|
}
|
|
159
158
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
// Deploy the agent skills bundled in the binary, mirroring install.sh: invoke
|
|
160
|
+
// the freshly installed binary's `skills install`, honouring AIRI_CLI_SKIP_SKILLS.
|
|
161
|
+
// Best-effort — a failure warns but never fails the install (the user can
|
|
162
|
+
// re-run `airi-cli skills install`).
|
|
163
|
+
function deploySkills(bin) {
|
|
164
|
+
if (process.env.AIRI_CLI_SKIP_SKILLS === '1') {
|
|
165
|
+
warn('AIRI_CLI_SKIP_SKILLS=1 — skipping skill deployment.')
|
|
163
166
|
return
|
|
164
167
|
}
|
|
168
|
+
log('deploying agent skills')
|
|
169
|
+
// stdio inherited so the CLI's own output — including the target directories
|
|
170
|
+
// it installed into — flows through to the npm install log.
|
|
171
|
+
const res = spawnSync(
|
|
172
|
+
bin,
|
|
173
|
+
['--no-telemetry', '-o', 'text', 'skills', 'install'],
|
|
174
|
+
{ stdio: 'inherit' }
|
|
175
|
+
)
|
|
176
|
+
if (res.error || res.status !== 0) {
|
|
177
|
+
warn(`skill deployment failed; retry later with: ${BIN_NAME} skills install`)
|
|
178
|
+
}
|
|
179
|
+
}
|
|
165
180
|
|
|
181
|
+
async function main() {
|
|
166
182
|
let platform
|
|
167
183
|
try {
|
|
168
184
|
platform = detectPlatform()
|
|
@@ -241,7 +257,11 @@ async function main() {
|
|
|
241
257
|
await rename(extracted, staged)
|
|
242
258
|
await chmod(staged, 0o755)
|
|
243
259
|
await rename(staged, finalPath)
|
|
244
|
-
log(`installed
|
|
260
|
+
log(`installed ${BIN_NAME} ${tag}`)
|
|
261
|
+
|
|
262
|
+
// Only after the binary is verified and in place, so skills are never
|
|
263
|
+
// deployed from a half-installed or unverified CLI.
|
|
264
|
+
deploySkills(finalPath)
|
|
245
265
|
} catch (err) {
|
|
246
266
|
warn(`failed to download the airi-cli binary: ${err.message}`)
|
|
247
267
|
warn(
|