@exayard/cli 0.1.0 → 0.5.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/LICENSE +21 -0
- package/README.md +60 -8
- package/dist/bin.js +4010 -166
- package/dist/index.d.ts +20 -5
- package/dist/index.js +3835 -159
- package/package.json +10 -7
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Exayard
|
|
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
CHANGED
|
@@ -15,21 +15,36 @@ npx @exayard/cli --help
|
|
|
15
15
|
|
|
16
16
|
## Authenticate
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
[exayard.com/settings/developer](https://exayard.com/settings/developer), then:
|
|
18
|
+
Sign in in the browser:
|
|
20
19
|
|
|
21
20
|
```bash
|
|
22
|
-
exayard login
|
|
21
|
+
exayard login
|
|
23
22
|
```
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
The CLI opens the sign-in page (and prints its address, in case no browser
|
|
25
|
+
opens), then saves the session. Calls are made as you, in your companies. If
|
|
26
|
+
you belong to one company it is saved; otherwise pass `--org <id>` to `login`
|
|
27
|
+
or to each call.
|
|
28
|
+
|
|
29
|
+
Or use an API key made in an app at
|
|
30
|
+
[exayard.com/settings/developer](https://exayard.com/settings/developer):
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
exayard login --api-key exa_live_...
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
A key made for a company acts in that company, so no `--org` is needed.
|
|
37
|
+
|
|
38
|
+
Credentials are saved to `~/.exayard/config.json`, readable only by you. A
|
|
39
|
+
saved session renews itself; run `exayard login` again if it ends. You can also
|
|
40
|
+
pass `--api-key` / `--org` per call, or set `EXAYARD_API_KEY` and
|
|
41
|
+
`EXAYARD_ORG_ID` (a key always wins over a browser session).
|
|
27
42
|
|
|
28
43
|
## Commands
|
|
29
44
|
|
|
30
45
|
```
|
|
31
46
|
Projects:
|
|
32
|
-
exayard projects list
|
|
47
|
+
exayard projects list
|
|
33
48
|
exayard projects create --name "<name>"
|
|
34
49
|
exayard projects archive <project_id>
|
|
35
50
|
|
|
@@ -38,20 +53,57 @@ Webhooks:
|
|
|
38
53
|
exayard webhooks create --url <https://...> --events "project.created,bid.generated"
|
|
39
54
|
exayard webhooks delete <endpoint_id>
|
|
40
55
|
exayard webhooks verify --signature ... --secret ... < body.json
|
|
41
|
-
exayard listen --forward-to http://localhost
|
|
56
|
+
exayard listen --forward-to http://localhost:3000/webhooks [--events a,b]
|
|
42
57
|
|
|
43
58
|
Help / misc:
|
|
44
59
|
exayard help-search "how do I run a takeoff"
|
|
45
60
|
exayard init Drop agents.md into the cwd
|
|
46
61
|
```
|
|
47
62
|
|
|
63
|
+
### Receive webhooks on your computer
|
|
64
|
+
|
|
65
|
+
`exayard listen` forwards your company's webhook events to a local address,
|
|
66
|
+
so you can build a webhook handler without a public URL:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
exayard listen --forward-to http://localhost:3000/webhooks --events bid.won,project.created
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
It prints a signing secret (`whsec_...`) when it starts. Each event is POSTed
|
|
73
|
+
to your address with the same body and `Exayard-Signature` header a real
|
|
74
|
+
delivery has, signed with that secret, so your handler verifies it with
|
|
75
|
+
`await constructWebhookEvent(rawBody, signature, secret)` from
|
|
76
|
+
[`@exayard/sdk`](https://www.npmjs.com/package/@exayard/sdk). Without `--events` every event
|
|
77
|
+
is forwarded; without `--forward-to` each event body is printed. Press Ctrl-C
|
|
78
|
+
to stop. Needs a company admin or a company key with `write:webhooks` and
|
|
79
|
+
`read:webhooks`.
|
|
80
|
+
|
|
81
|
+
### Every API operation
|
|
82
|
+
|
|
83
|
+
Every operation in the API is also a command, named after the operation
|
|
84
|
+
(`list_vendor_quotes` becomes `exayard list-vendor-quotes`). `exayard api` lists
|
|
85
|
+
them all and `exayard <command> --help` shows one command's fields.
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
exayard list-vendor-quotes <project_id> --status received
|
|
89
|
+
exayard create-vendor-quote <project_id> --vendorId <id> --quoteNumber Q-7
|
|
90
|
+
exayard update-labor-rate <rate_id> --input '{"hourlyRate": 85}'
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Positional arguments fill the path and every other field is a flag. No
|
|
94
|
+
command needs a company with a company key. When you do name one, `--org`
|
|
95
|
+
(or `EXAYARD_ORG_ID`, or the company saved by `login`) fills
|
|
96
|
+
`organizationId`; a sign-in that belongs to several companies needs it. A command that
|
|
97
|
+
deletes, uses AI usage, sends or buys runs only with `--yes`.
|
|
98
|
+
|
|
48
99
|
### Global flags
|
|
49
100
|
|
|
50
101
|
| Flag | Description |
|
|
51
102
|
|------|-------------|
|
|
52
103
|
| `--json` | Emit machine-readable JSON and suppress prose |
|
|
53
104
|
| `--api-key <key>` | Override saved credentials for this call |
|
|
54
|
-
| `--org <id>` |
|
|
105
|
+
| `--org <id>` | The company to act in (a company key needs none) |
|
|
106
|
+
| `--yes` | Run a command that deletes, uses AI usage, sends or buys |
|
|
55
107
|
|
|
56
108
|
### Exit codes
|
|
57
109
|
|