@flintpay/cli 0.6.0 → 0.9.0

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
@@ -10,7 +10,7 @@ Every command maps to a documented `/v1` route, so anything you can do over HTTP
10
10
  npm install -g @flintpay/cli
11
11
  ```
12
12
 
13
- On macOS and Linux, run `flint upgrade` (or its alias `flint update`) to update the global package and its platform binary to the latest stable release. On Windows, the command prints the exact npm update to run after closing the CLI.
13
+ On macOS and Linux, run `flint upgrade` (or its alias `flint update`) to update the global package and its platform binary to the latest stable release. On Windows, the command prints the exact npm update to run after closing the CLI. `flint upgrade --check` only reports the current and latest stable versions and whether an update is available.
14
14
 
15
15
  This package resolves a prebuilt binary for your platform. Node `>=18` is required to run the installer. On macOS and Linux you can install with Homebrew instead:
16
16
 
@@ -87,9 +87,9 @@ This streams your sandbox's events to a local server with a real signature, so y
87
87
 
88
88
  ## Scripting
89
89
 
90
- For bounded commands, `--output json` prints one JSON envelope on stdout and disables terminal input prompts. `flint auth login` still requires approval on the website; use `FLINT_NO_INPUT=1` to prohibit browser login in automation. Streaming commands emit newline-delimited JSON instead. `flint listen --output json` writes one listener, webhook event, delivery result, or checkpoint object per line; use `--max-events` or `--for` to bound it. Diagnostics and progress go to stderr, so stdout stays a clean data stream.
90
+ For bounded commands, `--output json` prints one JSON envelope on stdout and disables terminal input prompts. `flint auth login` still requires approval on the website; `FLINT_NO_INPUT=1` suppresses opening the browser automatically while allowing website approval and polling. Use `FLINT_API_KEY` for unattended automation. Streaming commands emit newline-delimited JSON instead. `flint listen --output json` writes one listener, webhook event, delivery result, or checkpoint object per line; use `--max-events` or `--for` to bound it. Diagnostics and progress go to stderr, so stdout stays a clean data stream.
91
91
 
92
- Exit codes are stable: `0` success, `1` API error, `2` usage error, `3` auth or config, `4` confirmation required, `5` network, `6` `--wait-for` timed out, `70` internal error.
92
+ Exit codes are stable: `0` success, `1` API error, `2` usage error, `3` auth or config, `4` confirmation required, `5` network, `6` `--wait-for` timed out, `70` internal error, including a missing or unsupported platform binary.
93
93
 
94
94
  In CI, pass the key through `FLINT_API_KEY` instead of the keychain, and set `FLINT_OUTPUT=json` and `FLINT_NO_INPUT=1` to make every command non-interactive.
95
95
 
@@ -98,7 +98,8 @@ In CI, pass the key through `FLINT_API_KEY` instead of the keychain, and set `FL
98
98
  - Guide: https://developers.withflintpay.com/docs/guides/cli
99
99
  - API reference: https://developers.withflintpay.com/docs/api
100
100
  - `flint help` for starting points, `flint <command> --help` for any single command
101
- - `flint schema commands --output json` for the complete machine-readable catalog
101
+ - `flint schema commands customers --output json` for one group's machine-readable commands; omit the group for the complete, large catalog
102
+ - `flint schema input customers create --output json` for the JSON Schema of a command's `--input` body
102
103
 
103
104
  ## License
104
105
 
package/bin/flint.js CHANGED
@@ -3,6 +3,11 @@
3
3
  const { spawn } = require("node:child_process");
4
4
  const path = require("node:path");
5
5
 
6
+ // Exit codes 1-6 report Flint CLI outcomes such as usage, authentication, and
7
+ // network errors. A broken installation is none of these, so the wrapper uses
8
+ // the CLI's internal software error code instead.
9
+ const EXIT_SOFTWARE = 70;
10
+
6
11
  const platform = process.platform;
7
12
  const arch = process.arch === "x64" ? "amd64" : process.arch;
8
13
  const supported = new Set([
@@ -15,8 +20,8 @@ const supported = new Set([
15
20
  const target = `${platform}-${arch}`;
16
21
 
17
22
  if (!supported.has(target)) {
18
- process.stderr.write(`Flint CLI does not publish a binary for ${platform}/${process.arch}.\n`);
19
- process.exit(2);
23
+ process.stderr.write(`Flint CLI does not publish a binary for ${platform}/${process.arch}. Supported platforms: macOS (arm64, x64), Linux (arm64, x64), and Windows (x64).\n`);
24
+ process.exit(EXIT_SOFTWARE);
20
25
  }
21
26
 
22
27
  const packagePlatform = platform === "win32" ? "windows" : platform;
@@ -26,11 +31,14 @@ try {
26
31
  packagePath = path.dirname(require.resolve(`${packageName}/package.json`));
27
32
  } catch {
28
33
  process.stderr.write(`The optional platform package ${packageName} is missing. Reinstall @flintpay/cli without omitting optional dependencies.\n`);
29
- process.exit(3);
34
+ process.exit(EXIT_SOFTWARE);
30
35
  }
31
36
 
32
37
  const binary = path.join(packagePath, "bin", platform === "win32" ? "flint.exe" : "flint");
33
38
  const child = spawn(binary, process.argv.slice(2), { stdio: "inherit" });
39
+ // Forward signals sent to this process alone, such as an MCP client stopping
40
+ // its server. A terminal Ctrl-C reaches the CLI directly as well, because it
41
+ // shares this process group; the CLI ignores such a duplicate for a moment.
34
42
  const signalHandlers = new Map();
35
43
  for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
36
44
  const handler = () => child.kill(signal);
@@ -44,8 +52,8 @@ function removeSignalHandlers() {
44
52
  }
45
53
  child.on("error", (error) => {
46
54
  removeSignalHandlers();
47
- process.stderr.write(`${error.message}\n`);
48
- process.exitCode = 5;
55
+ process.stderr.write(`Could not start the Flint CLI executable from ${packageName}: ${error.message}. Reinstall @flintpay/cli.\n`);
56
+ process.exitCode = EXIT_SOFTWARE;
49
57
  });
50
58
  child.on("exit", (code, signal) => {
51
59
  removeSignalHandlers();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flintpay/cli",
3
- "version": "0.6.0",
3
+ "version": "0.9.0",
4
4
  "description": "Flint Pay command-line interface",
5
5
  "mcpName": "com.withflintpay/cli",
6
6
  "license": "Apache-2.0",
@@ -16,11 +16,11 @@
16
16
  "node": ">=18"
17
17
  },
18
18
  "optionalDependencies": {
19
- "@flintpay/cli-darwin-arm64": "0.6.0",
20
- "@flintpay/cli-darwin-amd64": "0.6.0",
21
- "@flintpay/cli-linux-arm64": "0.6.0",
22
- "@flintpay/cli-linux-amd64": "0.6.0",
23
- "@flintpay/cli-windows-amd64": "0.6.0"
19
+ "@flintpay/cli-darwin-arm64": "0.9.0",
20
+ "@flintpay/cli-darwin-amd64": "0.9.0",
21
+ "@flintpay/cli-linux-arm64": "0.9.0",
22
+ "@flintpay/cli-linux-amd64": "0.9.0",
23
+ "@flintpay/cli-windows-amd64": "0.9.0"
24
24
  },
25
25
  "repository": {
26
26
  "type": "git",