brex-cli 0.0.0-canary.c9ef409
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/LICENSE +21 -0
- package/README.md +124 -0
- package/dist/main.js +2460 -0
- package/package.json +32 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ex3ndr
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# brex-cli
|
|
2
|
+
|
|
3
|
+
CLI for the Brex APIs at `https://platform.brexapis.com`.
|
|
4
|
+
|
|
5
|
+
This project uses Brex endpoints from:
|
|
6
|
+
- Authentication: https://developer.brex.com/openapi/authentication
|
|
7
|
+
- Transactions: https://developer.brex.com/openapi/transactions
|
|
8
|
+
- Team: https://developer.brex.com/openapi/team
|
|
9
|
+
- Payments: https://developer.brex.com/openapi/payments
|
|
10
|
+
- Webhooks: https://developer.brex.com/openapi/webhooks
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
bun install
|
|
16
|
+
bun run build
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Run locally:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
bun ./sources/main.ts --help
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Authentication
|
|
26
|
+
|
|
27
|
+
Store an API access token locally:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
brex login --token <ACCESS_TOKEN>
|
|
31
|
+
# or
|
|
32
|
+
cat token.txt | brex login --token-stdin
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Token/config location:
|
|
36
|
+
- `~/.brex/token`
|
|
37
|
+
- `~/.brex/config.json`
|
|
38
|
+
|
|
39
|
+
Check status:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
brex status
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Commands
|
|
46
|
+
|
|
47
|
+
### Accounts
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
brex accounts list --type all
|
|
51
|
+
brex accounts list --type cash --cursor <cursor>
|
|
52
|
+
brex accounts get <account-id> --type cash
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Transactions
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
brex transactions <account-id> --type cash --limit 50
|
|
59
|
+
brex transactions <account-id> --type card --cursor <cursor>
|
|
60
|
+
brex transactions get <account-id> <transaction-id> --type cash
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Transfers (Payments API)
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
brex transfer --from <cash-account-id> --to <counterparty-id> --amount 125.50 --idempotency-key <key>
|
|
67
|
+
brex transfer get <transfer-id>
|
|
68
|
+
brex transfer list --status PROCESSING --limit 20
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Recipients (Payment Counterparties)
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
brex recipients list --limit 50
|
|
75
|
+
brex recipients add --name "Vendor A" --account 123456789 --routing 021000021 --account-type CHECKING
|
|
76
|
+
brex recipients get <counterparty-id>
|
|
77
|
+
brex recipients delete <counterparty-id>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Cards / Users / Organization
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
brex cards list --user-id <user-id>
|
|
84
|
+
brex cards get <card-id>
|
|
85
|
+
|
|
86
|
+
brex users list --cursor <cursor>
|
|
87
|
+
brex users get <user-id>
|
|
88
|
+
|
|
89
|
+
brex organization
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Statements
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Primary card account
|
|
96
|
+
brex statements --scope primary
|
|
97
|
+
brex statements get <statement-id> --scope primary
|
|
98
|
+
|
|
99
|
+
# Additional card account
|
|
100
|
+
brex statements --scope additional --account-id <card-account-id>
|
|
101
|
+
brex statements get <statement-id> --scope additional --account-id <card-account-id>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Webhooks & Events
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
brex webhooks list
|
|
108
|
+
brex webhooks create --url https://example.com/webhooks/brex --events PAYMENT_COMPLETED,TRANSFER_COMPLETED
|
|
109
|
+
brex webhooks get <webhook-id>
|
|
110
|
+
brex webhooks update <webhook-id> --status ACTIVE
|
|
111
|
+
brex webhooks delete <webhook-id>
|
|
112
|
+
|
|
113
|
+
brex events list --event-type PAYMENT_COMPLETED --limit 25
|
|
114
|
+
brex events get <event-id>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Notes
|
|
118
|
+
|
|
119
|
+
- `brex transactions send` is intentionally not used for outbound payments. Use `brex transfer`.
|
|
120
|
+
- `brex categories` is currently a placeholder because there is no direct categories endpoint wired in this CLI.
|
|
121
|
+
|
|
122
|
+
## Disclaimer
|
|
123
|
+
|
|
124
|
+
This is an unofficial CLI. Verify scopes, permissions, and request payload requirements in Brex docs before production use.
|