@ogment-ai/cli 0.3.5 → 0.4.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 +88 -74
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +512 -247
- package/dist/commands/auth.d.ts +22 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +29 -0
- package/dist/commands/catalog.d.ts +29 -0
- package/dist/commands/catalog.d.ts.map +1 -0
- package/dist/commands/catalog.js +151 -0
- package/dist/commands/invoke.d.ts +17 -0
- package/dist/commands/invoke.d.ts.map +1 -0
- package/dist/commands/invoke.js +123 -0
- package/dist/commands/{info.d.ts → status.d.ts} +4 -4
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/{info.js → status.js} +1 -1
- package/dist/output/envelope.d.ts +19 -0
- package/dist/output/envelope.d.ts.map +1 -0
- package/dist/output/envelope.js +51 -0
- package/dist/output/manager.d.ts +16 -3
- package/dist/output/manager.d.ts.map +1 -1
- package/dist/output/manager.js +27 -29
- package/dist/services/account.d.ts.map +1 -1
- package/dist/services/account.js +18 -2
- package/dist/services/auth.d.ts +14 -3
- package/dist/services/auth.d.ts.map +1 -1
- package/dist/services/auth.js +119 -15
- package/dist/services/info.d.ts.map +1 -1
- package/dist/services/info.js +11 -10
- package/dist/services/mcp.d.ts.map +1 -1
- package/dist/services/mcp.js +24 -23
- package/dist/shared/constants.d.ts +0 -1
- package/dist/shared/constants.d.ts.map +1 -1
- package/dist/shared/constants.js +0 -1
- package/dist/shared/error-codes.d.ts +28 -0
- package/dist/shared/error-codes.d.ts.map +1 -0
- package/dist/shared/error-codes.js +25 -0
- package/dist/shared/errors.d.ts +100 -9
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/errors.js +103 -0
- package/dist/shared/exit-codes.d.ts +8 -5
- package/dist/shared/exit-codes.d.ts.map +1 -1
- package/dist/shared/exit-codes.js +31 -14
- package/dist/shared/guards.d.ts +5 -1
- package/dist/shared/guards.d.ts.map +1 -1
- package/dist/shared/guards.js +6 -1
- package/dist/shared/retry.d.ts +17 -0
- package/dist/shared/retry.d.ts.map +1 -0
- package/dist/shared/retry.js +27 -0
- package/dist/shared/schema-example.d.ts +2 -0
- package/dist/shared/schema-example.d.ts.map +1 -0
- package/dist/shared/schema-example.js +128 -0
- package/dist/shared/schemas.d.ts +0 -42
- package/dist/shared/schemas.d.ts.map +1 -1
- package/dist/shared/schemas.js +0 -21
- package/dist/shared/types.d.ts +84 -12
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/shared/types.js +1 -1
- package/package.json +5 -7
- package/dist/commands/call.d.ts +0 -14
- package/dist/commands/call.d.ts.map +0 -1
- package/dist/commands/call.js +0 -51
- package/dist/commands/describe.d.ts +0 -4
- package/dist/commands/describe.d.ts.map +0 -1
- package/dist/commands/describe.js +0 -109
- package/dist/commands/info.d.ts.map +0 -1
- package/dist/commands/servers.d.ts +0 -13
- package/dist/commands/servers.d.ts.map +0 -1
- package/dist/commands/servers.js +0 -29
- package/dist/postinstall.d.ts +0 -2
- package/dist/postinstall.d.ts.map +0 -1
- package/dist/postinstall.js +0 -12
package/README.md
CHANGED
|
@@ -1,145 +1,159 @@
|
|
|
1
1
|
# Ogment CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<!-- Generated from docs/command-spec.json via scripts/sync-command-docs.mjs -->
|
|
4
|
+
|
|
5
|
+
Agent-first CLI for discovering and invoking Ogment-backed tools.
|
|
4
6
|
|
|
5
7
|
Package: `@ogment-ai/cli`
|
|
6
8
|
Binary: `ogment`
|
|
7
9
|
|
|
8
|
-
Ogment sits between your AI agent and your SaaS tools. Your agent gets a scoped, revocable API key — your real credentials never leave Ogment.
|
|
9
|
-
|
|
10
10
|
## Install
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
# Global install (recommended)
|
|
14
13
|
npm install -g @ogment-ai/cli
|
|
15
|
-
|
|
16
|
-
# One-off usage without installing globally
|
|
17
|
-
npx @ogment-ai/cli --help
|
|
18
14
|
```
|
|
19
15
|
|
|
16
|
+
## Core Behavior
|
|
17
|
+
|
|
18
|
+
1. Output is machine-readable JSON by default.
|
|
19
|
+
2. Use `--human` for readable terminal output.
|
|
20
|
+
3. Default login flow is device-code + human approval.
|
|
21
|
+
4. Discovery uses progressive disclosure (`catalog` -> `catalog tools` -> `catalog tool`).
|
|
22
|
+
|
|
20
23
|
## Quick Start
|
|
21
24
|
|
|
22
25
|
```bash
|
|
23
|
-
#
|
|
24
|
-
ogment login
|
|
26
|
+
# 1) Authenticate (device flow by default)
|
|
27
|
+
ogment auth login
|
|
28
|
+
|
|
29
|
+
# 2) Discover servers (summary only)
|
|
30
|
+
ogment catalog
|
|
31
|
+
|
|
32
|
+
# 3) Narrow to one server when already known
|
|
33
|
+
ogment catalog --server <server-id>
|
|
25
34
|
|
|
26
|
-
#
|
|
27
|
-
ogment
|
|
35
|
+
# 4) Discover tools for one server
|
|
36
|
+
ogment catalog tools <server-id>
|
|
28
37
|
|
|
29
|
-
#
|
|
30
|
-
ogment
|
|
38
|
+
# 5) Inspect one tool schema and include generated example input
|
|
39
|
+
ogment catalog tool <server-id> <tool-name> --example
|
|
40
|
+
|
|
41
|
+
# 6) Invoke
|
|
42
|
+
ogment invoke <server-id>/<tool-name> --input '{}'
|
|
31
43
|
|
|
32
|
-
# Call a tool
|
|
33
|
-
ogment call <server> <tool> '{"param": "value"}'
|
|
34
44
|
```
|
|
35
45
|
|
|
36
|
-
##
|
|
46
|
+
## Commands
|
|
47
|
+
|
|
48
|
+
### `ogment auth login`
|
|
37
49
|
|
|
38
|
-
|
|
50
|
+
Default device-code login.
|
|
39
51
|
|
|
40
52
|
```bash
|
|
41
|
-
|
|
42
|
-
pnpm test:coverage # Coverage (text + html + lcov)
|
|
43
|
-
pnpm test:changed # Run tests related to changed files
|
|
44
|
-
pnpm test:ci # CI profile (coverage + CI reporters)
|
|
53
|
+
ogment auth login
|
|
45
54
|
```
|
|
46
55
|
|
|
47
|
-
|
|
56
|
+
### `ogment auth login --browser`
|
|
48
57
|
|
|
49
|
-
|
|
58
|
+
Fallback browser callback flow.
|
|
50
59
|
|
|
51
|
-
|
|
60
|
+
```bash
|
|
61
|
+
ogment auth login --browser
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### `ogment auth login --api-key <key>`
|
|
65
|
+
|
|
66
|
+
Last-resort path for CI/unattended setups.
|
|
52
67
|
|
|
53
68
|
```bash
|
|
54
|
-
ogment login
|
|
69
|
+
ogment auth login --api-key "$OGMENT_API_KEY"
|
|
55
70
|
```
|
|
56
71
|
|
|
57
|
-
### `ogment
|
|
72
|
+
### `ogment auth status`
|
|
58
73
|
|
|
59
|
-
|
|
74
|
+
Show credential presence/source.
|
|
60
75
|
|
|
61
76
|
```bash
|
|
62
|
-
ogment
|
|
77
|
+
ogment auth status
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### `ogment auth logout`
|
|
63
81
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
82
|
+
Revoke and clear local credentials.
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
ogment auth logout
|
|
68
86
|
```
|
|
69
87
|
|
|
70
|
-
### `ogment
|
|
88
|
+
### `ogment catalog`
|
|
71
89
|
|
|
72
|
-
|
|
90
|
+
Server metadata only (includes `toolCount`, no full tool schemas). Supports cursor pagination and server filtering.
|
|
73
91
|
|
|
74
92
|
```bash
|
|
75
|
-
ogment
|
|
76
|
-
ogment
|
|
77
|
-
ogment
|
|
93
|
+
ogment catalog
|
|
94
|
+
ogment catalog --limit 20
|
|
95
|
+
ogment catalog --cursor <last-server-id> --limit 20
|
|
96
|
+
ogment catalog --server billing
|
|
78
97
|
```
|
|
79
98
|
|
|
80
|
-
### `ogment
|
|
99
|
+
### `ogment catalog tools <server-id>`
|
|
81
100
|
|
|
82
|
-
|
|
101
|
+
Tool summaries for one server.
|
|
83
102
|
|
|
84
103
|
```bash
|
|
85
|
-
ogment
|
|
86
|
-
ogment call ecommerce-api get__api_products_ '{"limit":2}'
|
|
104
|
+
ogment catalog tools billing
|
|
87
105
|
```
|
|
88
106
|
|
|
89
|
-
### `ogment
|
|
107
|
+
### `ogment catalog tool <server-id> <tool-name>`
|
|
90
108
|
|
|
91
|
-
|
|
109
|
+
Full details and schemas for one tool.
|
|
92
110
|
|
|
93
111
|
```bash
|
|
94
|
-
ogment
|
|
112
|
+
ogment catalog tool billing get_health
|
|
113
|
+
ogment catalog tool billing get_health --example
|
|
95
114
|
```
|
|
96
115
|
|
|
97
|
-
### `ogment
|
|
116
|
+
### `ogment invoke <server-id>/<tool-name>`
|
|
98
117
|
|
|
99
|
-
|
|
118
|
+
Invoke a tool with one input mode.
|
|
100
119
|
|
|
101
120
|
```bash
|
|
102
|
-
ogment
|
|
103
|
-
ogment
|
|
121
|
+
ogment invoke billing/get_health --input '{}'
|
|
122
|
+
ogment invoke billing/get_health --input @./payload.json
|
|
123
|
+
cat payload.json | ogment invoke billing/get_health --input -
|
|
104
124
|
```
|
|
105
125
|
|
|
106
|
-
|
|
126
|
+
### `ogment status`
|
|
107
127
|
|
|
108
|
-
|
|
128
|
+
Runtime and connectivity diagnostics.
|
|
109
129
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
4. **Revoke anytime** — In the Ogment dashboard → Agents tab
|
|
130
|
+
```bash
|
|
131
|
+
ogment status
|
|
132
|
+
```
|
|
114
133
|
|
|
115
|
-
|
|
134
|
+
## Global Options
|
|
116
135
|
|
|
117
|
-
|
|
136
|
+
```bash
|
|
137
|
+
--api-key <key> API key override
|
|
138
|
+
--human Human-readable output
|
|
139
|
+
--quiet Suppress non-essential output
|
|
140
|
+
--non-interactive Disable interactive behavior
|
|
141
|
+
--yes Assume yes for confirmations
|
|
142
|
+
```
|
|
118
143
|
|
|
119
144
|
## Environment Variables
|
|
120
145
|
|
|
121
146
|
| Variable | Default | Description |
|
|
122
147
|
|---|---|---|
|
|
123
|
-
| `OGMENT_BASE_URL` | `https://dashboard.ogment.ai` | Ogment platform URL
|
|
124
|
-
| `OGMENT_API_KEY` |
|
|
148
|
+
| `OGMENT_BASE_URL` | `https://dashboard.ogment.ai` | Ogment platform URL |
|
|
149
|
+
| `OGMENT_API_KEY` | `—` | API key fallback |
|
|
125
150
|
|
|
126
|
-
##
|
|
151
|
+
## Development
|
|
127
152
|
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
▼
|
|
133
|
-
┌─────────────────────────────────┐
|
|
134
|
-
│ Ogment MCP Proxy │
|
|
135
|
-
│ ✓ Validate API key │
|
|
136
|
-
│ ✓ Inject real credentials │
|
|
137
|
-
│ ✓ Log every tool call │
|
|
138
|
-
└──────────────┬──────────────────┘
|
|
139
|
-
│
|
|
140
|
-
┌──────────┼──────────┐
|
|
141
|
-
▼ ▼ ▼
|
|
142
|
-
Salesforce Linear Snowflake
|
|
153
|
+
```bash
|
|
154
|
+
pnpm test
|
|
155
|
+
pnpm test:e2e
|
|
156
|
+
pnpm build
|
|
143
157
|
```
|
|
144
158
|
|
|
145
159
|
## License
|
package/dist/cli.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { type InfoService } from "./services/info.js";
|
|
|
5
5
|
import { type ExitCode } from "./shared/exit-codes.js";
|
|
6
6
|
export interface GlobalCliOptions {
|
|
7
7
|
apiKey: string | undefined;
|
|
8
|
-
|
|
8
|
+
human: boolean | undefined;
|
|
9
9
|
nonInteractive: boolean | undefined;
|
|
10
10
|
quiet: boolean | undefined;
|
|
11
11
|
yes: boolean | undefined;
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAmBA,OAAO,KAAK,EAAE,cAAc,EAAmB,MAAM,uBAAuB,CAAC;AAO7E,OAAO,EAAE,aAAa,EAA0B,MAAM,qBAAqB,CAAC;AAG5E,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAazE,OAAO,EAAa,KAAK,QAAQ,EAAoB,MAAM,wBAAwB,CAAC;AAapF,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B,cAAc,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B,GAAG,EAAE,OAAO,GAAG,SAAS,CAAC;CAC1B;AAED,UAAU,OAAO;IACf,OAAO,EAAE,cAAc,CAAC;IACxB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,MAAM,EAAE,aAAa,CAAC;CACvB;AAy5BD,eAAO,MAAM,MAAM,GACjB,OAAM,SAAS,MAAM,EAA0B,EAC/C,UAAS,OAAyB,KACjC,OAAO,CAAC,QAAQ,CAuBlB,CAAC;AAEF,eAAO,MAAM,UAAU,QAAa,OAAO,CAAC,IAAI,CAG/C,CAAC;AAMF,eAAO,MAAM,gBAAgB,GAAI,eAAe,MAAM,EAAE,OAAO,MAAM,GAAG,SAAS,KAAG,OAanF,CAAC"}
|