@flintpay/cli 0.2.0 → 0.3.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 +27 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -10,6 +10,8 @@ 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` 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.
|
|
14
|
+
|
|
13
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:
|
|
14
16
|
|
|
15
17
|
```bash
|
|
@@ -27,12 +29,36 @@ flint doctor
|
|
|
27
29
|
|
|
28
30
|
Confirm the code shown in your terminal and approve CLI access on the website. Flint validates the OAuth session and stores its access and refresh tokens in your OS keychain. Use `--no-open` to open the printed link yourself, `--profile NAME` for an existing profile, or `--live` to explicitly request production access.
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
The existing single-context browser login has been verified against Flint staging. To use staging, set `FLINT_BASE_URL=https://api.staging.withflintpay.com` for login and subsequent commands. Production rollout is separate; use `flint auth import` on servers without browser login support.
|
|
31
33
|
|
|
32
34
|
Access tokens refresh automatically as needed. `flint auth logout --confirm` revokes the OAuth session before removing its local credentials. If the server does not confirm revocation, logout reports failure and retains the credentials for retry. Imported API-key logout still removes only the local key.
|
|
33
35
|
|
|
34
36
|
`flint login` is a shortcut for `flint auth login`. Related shortcuts: `flint logout` for `flint auth logout`, and `flint whoami` for `flint auth status`.
|
|
35
37
|
|
|
38
|
+
### Sessions and contexts
|
|
39
|
+
|
|
40
|
+
With a server that supports multi-context sessions, approve access to selected merchants, sandboxes, and live contexts once in the browser, then select where commands run:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
flint login
|
|
44
|
+
flint context list
|
|
45
|
+
flint context switch # interactive selector
|
|
46
|
+
flint context switch ctx_development # select an authorized sandbox
|
|
47
|
+
flint context switch ctx_production --live # explicitly select a live default
|
|
48
|
+
flint auth status --context ctx_development # one command, without changing the default
|
|
49
|
+
flint reauth # change browser-approved access
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`flint login` reuses a valid saved OAuth session and starts browser approval again when the server confirms that the session expired or was revoked. Temporary connection failures or loss of access to one context do not automatically replace the session. Use `flint login --new-session` to replace it after browser approval; the CLI then attempts to revoke the previous session. `flint logout --confirm` revokes the entire session across its contexts.
|
|
53
|
+
|
|
54
|
+
Manage and revoke sessions on the [CLI sessions page](https://app.withflintpay.com/developers/cli). Browser authorization sends your computer's hostname and operating system to help identify the session.
|
|
55
|
+
|
|
56
|
+
Context selection uses `--context ID`, then a project's `.flint/config.json` `context` field, then the profile default. For example, `{"context":"ctx_development"}` pins a project. Switching changes the profile default, not a project pin. Each running command retains its starting context. Access tokens remain restricted to one context and refresh automatically. LIVE contexts are labeled in the selector and command diagnostics; selected multi-context sessions do not need `--live` on every command, while sensitive/destructive operations still require confirmation.
|
|
57
|
+
|
|
58
|
+
Environment credentials (`FLINT_API_KEY`, `FLINT_ACCESS_TOKEN`, or `FLINT_CHECKOUT_SESSION_SECRET`) override configured browser-session contexts. An explicit `--context` cannot be combined with these overrides. Merchant and sandbox guards still apply.
|
|
59
|
+
|
|
60
|
+
**Backend rollout required:** multi-context listing, switching, and reauthorization require the new session endpoints and token metadata. Existing single-context OAuth sessions remain usable and keep their existing live-mode safeguards. Run `flint reauth` after the server is upgraded to authorize multiple contexts. The new multi-context flow has not yet been verified against a deployed backend.
|
|
61
|
+
|
|
36
62
|
### API keys and automation
|
|
37
63
|
|
|
38
64
|
For manual setup, create a key in the [Flint dashboard](https://app.withflintpay.com/developers/api-keys) and run `flint auth import`. For CI, supply `FLINT_API_KEY` through your secret store and set `FLINT_NO_INPUT=1`. `flint signup` remains available for creating an account from the terminal.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flintpay/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.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.
|
|
20
|
-
"@flintpay/cli-darwin-amd64": "0.
|
|
21
|
-
"@flintpay/cli-linux-arm64": "0.
|
|
22
|
-
"@flintpay/cli-linux-amd64": "0.
|
|
23
|
-
"@flintpay/cli-windows-amd64": "0.
|
|
19
|
+
"@flintpay/cli-darwin-arm64": "0.3.0",
|
|
20
|
+
"@flintpay/cli-darwin-amd64": "0.3.0",
|
|
21
|
+
"@flintpay/cli-linux-arm64": "0.3.0",
|
|
22
|
+
"@flintpay/cli-linux-amd64": "0.3.0",
|
|
23
|
+
"@flintpay/cli-windows-amd64": "0.3.0"
|
|
24
24
|
},
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|