@ogment-ai/cli 0.6.0 → 0.7.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.
Files changed (108) hide show
  1. package/dist/cli.js +21382 -4
  2. package/dist/cli.js.map +1 -0
  3. package/package.json +46 -53
  4. package/README.md +0 -134
  5. package/dist/cli/commands.d.ts +0 -37
  6. package/dist/cli/commands.d.ts.map +0 -1
  7. package/dist/cli/commands.js +0 -56
  8. package/dist/cli/execute.d.ts +0 -11
  9. package/dist/cli/execute.d.ts.map +0 -1
  10. package/dist/cli/execute.js +0 -468
  11. package/dist/cli/invocations.d.ts +0 -31
  12. package/dist/cli/invocations.d.ts.map +0 -1
  13. package/dist/cli/invocations.js +0 -1
  14. package/dist/cli/parse-errors.d.ts +0 -17
  15. package/dist/cli/parse-errors.d.ts.map +0 -1
  16. package/dist/cli/parse-errors.js +0 -184
  17. package/dist/cli/program.d.ts +0 -10
  18. package/dist/cli/program.d.ts.map +0 -1
  19. package/dist/cli/program.js +0 -174
  20. package/dist/cli/run.d.ts +0 -6
  21. package/dist/cli/run.d.ts.map +0 -1
  22. package/dist/cli/run.js +0 -83
  23. package/dist/cli/runtime.d.ts +0 -21
  24. package/dist/cli/runtime.d.ts.map +0 -1
  25. package/dist/cli/runtime.js +0 -80
  26. package/dist/cli.d.ts +0 -4
  27. package/dist/cli.d.ts.map +0 -1
  28. package/dist/commands/auth.d.ts +0 -19
  29. package/dist/commands/auth.d.ts.map +0 -1
  30. package/dist/commands/auth.js +0 -21
  31. package/dist/commands/catalog.d.ts +0 -31
  32. package/dist/commands/catalog.d.ts.map +0 -1
  33. package/dist/commands/catalog.js +0 -167
  34. package/dist/commands/context.d.ts +0 -15
  35. package/dist/commands/context.d.ts.map +0 -1
  36. package/dist/commands/context.js +0 -1
  37. package/dist/commands/invoke.d.ts +0 -17
  38. package/dist/commands/invoke.d.ts.map +0 -1
  39. package/dist/commands/invoke.js +0 -173
  40. package/dist/commands/server-context.d.ts +0 -14
  41. package/dist/commands/server-context.d.ts.map +0 -1
  42. package/dist/commands/server-context.js +0 -26
  43. package/dist/commands/status.d.ts +0 -12
  44. package/dist/commands/status.d.ts.map +0 -1
  45. package/dist/commands/status.js +0 -5
  46. package/dist/index.d.ts +0 -4
  47. package/dist/index.d.ts.map +0 -1
  48. package/dist/index.js +0 -3
  49. package/dist/infra/credentials.d.ts +0 -22
  50. package/dist/infra/credentials.d.ts.map +0 -1
  51. package/dist/infra/credentials.js +0 -74
  52. package/dist/infra/env.d.ts +0 -15
  53. package/dist/infra/env.d.ts.map +0 -1
  54. package/dist/infra/env.js +0 -100
  55. package/dist/infra/http.d.ts +0 -16
  56. package/dist/infra/http.d.ts.map +0 -1
  57. package/dist/infra/http.js +0 -84
  58. package/dist/output/envelope.d.ts +0 -22
  59. package/dist/output/envelope.d.ts.map +0 -1
  60. package/dist/output/envelope.js +0 -67
  61. package/dist/output/manager.d.ts +0 -47
  62. package/dist/output/manager.d.ts.map +0 -1
  63. package/dist/output/manager.js +0 -120
  64. package/dist/services/account.d.ts +0 -16
  65. package/dist/services/account.d.ts.map +0 -1
  66. package/dist/services/account.js +0 -75
  67. package/dist/services/auth.d.ts +0 -37
  68. package/dist/services/auth.d.ts.map +0 -1
  69. package/dist/services/auth.js +0 -270
  70. package/dist/services/info.d.ts +0 -24
  71. package/dist/services/info.d.ts.map +0 -1
  72. package/dist/services/info.js +0 -316
  73. package/dist/services/mcp-error-mapping.d.ts +0 -9
  74. package/dist/services/mcp-error-mapping.d.ts.map +0 -1
  75. package/dist/services/mcp-error-mapping.js +0 -129
  76. package/dist/services/mcp.d.ts +0 -39
  77. package/dist/services/mcp.d.ts.map +0 -1
  78. package/dist/services/mcp.js +0 -169
  79. package/dist/shared/constants.d.ts +0 -5
  80. package/dist/shared/constants.d.ts.map +0 -1
  81. package/dist/shared/constants.js +0 -6
  82. package/dist/shared/error-codes.d.ts +0 -31
  83. package/dist/shared/error-codes.d.ts.map +0 -1
  84. package/dist/shared/error-codes.js +0 -25
  85. package/dist/shared/error-presentation.d.ts +0 -17
  86. package/dist/shared/error-presentation.d.ts.map +0 -1
  87. package/dist/shared/error-presentation.js +0 -151
  88. package/dist/shared/errors.d.ts +0 -146
  89. package/dist/shared/errors.d.ts.map +0 -1
  90. package/dist/shared/errors.js +0 -233
  91. package/dist/shared/exit-codes.d.ts +0 -15
  92. package/dist/shared/exit-codes.d.ts.map +0 -1
  93. package/dist/shared/exit-codes.js +0 -44
  94. package/dist/shared/guards.d.ts +0 -11
  95. package/dist/shared/guards.d.ts.map +0 -1
  96. package/dist/shared/guards.js +0 -29
  97. package/dist/shared/recovery.d.ts +0 -5
  98. package/dist/shared/recovery.d.ts.map +0 -1
  99. package/dist/shared/recovery.js +0 -123
  100. package/dist/shared/schema-example.d.ts +0 -3
  101. package/dist/shared/schema-example.d.ts.map +0 -1
  102. package/dist/shared/schema-example.js +0 -105
  103. package/dist/shared/schemas.d.ts +0 -14
  104. package/dist/shared/schemas.d.ts.map +0 -1
  105. package/dist/shared/schemas.js +0 -14
  106. package/dist/shared/types.d.ts +0 -225
  107. package/dist/shared/types.d.ts.map +0 -1
  108. package/dist/shared/types.js +0 -1
package/package.json CHANGED
@@ -1,75 +1,68 @@
1
1
  {
2
2
  "name": "@ogment-ai/cli",
3
- "version": "0.6.0",
4
- "description": "Ogment Vault CLI — secure your AI agents' SaaS credentials",
5
- "type": "module",
3
+ "version": "0.7.0",
4
+ "private": false,
5
+ "description": "Ogment CLI",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/ogment-ai/ogment.git",
9
+ "directory": "apps/cli"
10
+ },
6
11
  "bin": {
7
- "ogment": "./dist/cli.js"
12
+ "ogment": "dist/cli.js"
8
13
  },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "type": "module",
9
18
  "exports": {
10
19
  ".": {
11
20
  "default": "./dist/cli.js"
12
21
  }
13
22
  },
14
- "files": [
15
- "dist"
16
- ],
17
- "keywords": [
18
- "ogment",
19
- "mcp",
20
- "ai",
21
- "vault",
22
- "cli",
23
- "model-context-protocol",
24
- "agent",
25
- "security"
26
- ],
27
- "author": "Ogment <info@ogment.ai>",
28
- "license": "MIT",
29
- "repository": {
30
- "type": "git",
31
- "url": "git+https://github.com/ogment-ai/ogment-cli.git"
32
- },
33
- "bugs": {
34
- "url": "https://github.com/ogment-ai/ogment-cli/issues"
35
- },
36
- "homepage": "https://ogment.ai",
37
- "engines": {
38
- "node": ">=18"
39
- },
40
- "dependencies": {
41
- "@modelcontextprotocol/sdk": "^1.27.0",
42
- "@ogment-ai/cli-contract": "0.6.0",
43
- "better-result": "^2.7.0",
44
- "commander": "^14.0.3",
45
- "zod": "^4.3.6"
46
- },
47
- "devDependencies": {
48
- "@types/node": "^25.3.0",
49
- "@vitest/coverage-v8": "^4.0.18",
50
- "@vitest/ui": "^4.0.18",
51
- "opensrc": "^0.6.0",
52
- "oxfmt": "^0.35.0",
53
- "oxlint": "^1.50.0",
54
- "oxlint-tsgolint": "^0.14.2",
55
- "tsx": "^4.21.0",
56
- "typescript": "^5.9.3",
57
- "vitest": "^4.0.18"
23
+ "publishConfig": {
24
+ "access": "public"
58
25
  },
59
26
  "scripts": {
60
27
  "clean": "node -e \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true });\"",
61
- "build": "pnpm clean && tsc -p tsconfig.build.json",
28
+ "build": "pnpm run clean && rolldown -c",
29
+ "prepack": "pnpm run build",
30
+ "check-types": "oxlint . --type-aware --type-check -A all --tsconfig tsconfig.json",
62
31
  "dev": "tsx src/cli.ts",
63
32
  "start": "node dist/cli.js",
64
33
  "local": "pnpm run build && CI=1 OGMENT_BASE_URL=${OGMENT_BASE_URL:-http://localhost:3000} node dist/cli.js",
65
34
  "local:json": "pnpm run build && CI=1 OGMENT_BASE_URL=${OGMENT_BASE_URL:-http://localhost:3000} node dist/cli.js",
66
- "lint": "oxlint -c oxlint.config.ts --type-aware --type-check --tsconfig tsconfig.json src test/src test/e2e vitest.config.ts vitest.e2e.config.ts",
67
- "lint:fix": "pnpm lint -- --fix",
35
+ "lint": "oxlint -c oxlint.config.ts --fix --type-aware --tsconfig tsconfig.json src test/src test/e2e vitest.config.ts vitest.e2e.config.ts",
36
+ "lint:check": "oxlint -c oxlint.config.ts --type-aware --deny-warnings --report-unused-disable-directives --tsconfig tsconfig.json src test/src test/e2e vitest.config.ts vitest.e2e.config.ts",
37
+ "lint:ci": "pnpm run lint:check -- --format=github",
68
38
  "format": "oxfmt --write src test/src test/e2e",
69
39
  "format:check": "oxfmt --check src test/src test/e2e",
70
40
  "test": "vitest run -c vitest.config.ts",
71
41
  "test:coverage": "vitest run -c vitest.config.ts --coverage",
72
- "test:e2e": "vitest run -c vitest.e2e.config.ts",
42
+ "test:e2e": "pnpm run build && vitest run -c vitest.e2e.config.ts",
73
43
  "test:changed": "pnpm test -- --changed"
44
+ },
45
+ "dependencies": {
46
+ "@modelcontextprotocol/sdk": "1.25.2",
47
+ "@repo/shared": "*",
48
+ "better-result": "^2.7.0",
49
+ "commander": "^14.0.3",
50
+ "zod": "^4.3.5"
51
+ },
52
+ "devDependencies": {
53
+ "@repo/eslint-config": "*",
54
+ "@repo/typescript-config": "*",
55
+ "@types/node": "22.18.12",
56
+ "@vitest/coverage-v8": "^4.0.14",
57
+ "@vitest/ui": "^4.0.14",
58
+ "oxfmt": "^0.35.0",
59
+ "oxlint": "^1.50.0",
60
+ "rolldown": "1.0.0-rc.6",
61
+ "tsx": "^4.21.0",
62
+ "vitest": "^4.0.14"
63
+ },
64
+ "engines": {
65
+ "node": ">=22.18.0",
66
+ "pnpm": ">=10"
74
67
  }
75
- }
68
+ }
package/README.md DELETED
@@ -1,134 +0,0 @@
1
- # Ogment CLI
2
-
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.
6
-
7
- Package: `@ogment-ai/cli`
8
- Binary: `ogment`
9
-
10
- ## Install
11
-
12
- ```bash
13
- npm install -g @ogment-ai/cli
14
- ```
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 <server-id>` -> `catalog <server-id> <tool-name>`).
22
-
23
- ## Quick Start
24
-
25
- ```bash
26
- # 1) Authenticate (device flow by default)
27
- ogment auth login
28
-
29
- # 2) Discover servers (summary only)
30
- ogment catalog
31
-
32
- # 3) Discover tools for one server
33
- ogment catalog <server-id>
34
-
35
- # 4) Inspect one tool schema and include generated example input
36
- ogment catalog <server-id> <tool-name> --example
37
-
38
- # 5) Invoke
39
- ogment invoke <server-id>/<tool-name> --input '{}'
40
-
41
- ```
42
-
43
- ## Commands
44
-
45
- ### `ogment auth login`
46
-
47
- Default device-code login.
48
-
49
- ```bash
50
- ogment auth login
51
- ```
52
-
53
- ### `ogment auth login --api-key <key>`
54
-
55
- Last-resort path for CI/unattended setups.
56
-
57
- ```bash
58
- ogment auth login --api-key "$OGMENT_API_KEY"
59
- ```
60
-
61
- ### `ogment auth status`
62
-
63
- Show credential presence/source.
64
-
65
- ```bash
66
- ogment auth status
67
- ```
68
-
69
- ### `ogment auth logout`
70
-
71
- Revoke and clear local credentials.
72
-
73
- ```bash
74
- ogment auth logout
75
- ```
76
-
77
- ### `ogment catalog [server-id] [tool-name]`
78
-
79
- Progressive discovery with one command: no args lists servers, one arg lists tools on a server, two args shows full tool schema.
80
-
81
- ```bash
82
- ogment catalog
83
- ogment catalog --limit 20
84
- ogment catalog --cursor <last-server-id> --limit 20
85
- ogment catalog billing
86
- ogment catalog billing get_health
87
- ogment catalog billing get_health --example
88
- ```
89
-
90
- ### `ogment invoke <server-id>/<tool-name>`
91
-
92
- Invoke a tool with one input mode.
93
-
94
- ```bash
95
- ogment invoke billing/get_health --input '{}'
96
- ogment invoke billing/get_health --input @./payload.json
97
- cat payload.json | ogment invoke billing/get_health --input -
98
- ```
99
-
100
- ### `ogment status`
101
-
102
- Runtime and connectivity diagnostics.
103
-
104
- ```bash
105
- ogment status
106
- ```
107
-
108
- ## Global Options
109
-
110
- ```bash
111
- --api-key <key> API key override
112
- --human Human-readable output
113
- --quiet Suppress non-essential output
114
- --yes Assume yes for confirmations
115
- ```
116
-
117
- ## Environment Variables
118
-
119
- | Variable | Default | Description |
120
- |---|---|---|
121
- | `OGMENT_BASE_URL` | `https://dashboard.ogment.ai` | Ogment platform URL |
122
- | `OGMENT_API_KEY` | `—` | API key fallback |
123
-
124
- ## Development
125
-
126
- ```bash
127
- pnpm test
128
- pnpm test:e2e
129
- pnpm build
130
- ```
131
-
132
- ## License
133
-
134
- MIT
@@ -1,37 +0,0 @@
1
- export interface CatalogSummaryCommandOptions {
2
- cursor?: string | undefined;
3
- limit?: number | undefined;
4
- }
5
- export declare const cliCommands: {
6
- readonly auth: {
7
- readonly help: () => string;
8
- readonly login: () => string;
9
- readonly loginWithApiKeyRedacted: () => string;
10
- readonly logout: () => string;
11
- readonly status: () => string;
12
- };
13
- readonly catalog: {
14
- readonly command: () => string;
15
- readonly server: (serverId: string) => string;
16
- readonly summary: (options: CatalogSummaryCommandOptions) => string;
17
- readonly tool: (serverId: string, toolName: string, options: {
18
- example: boolean;
19
- }) => string;
20
- };
21
- readonly helpForScope: (scope: string | null) => string;
22
- readonly invoke: {
23
- readonly command: (target: string) => string;
24
- readonly inlineJson: (target: string) => string;
25
- readonly stdin: (target: string) => string;
26
- readonly withInputValue: (target: string, value: string) => string;
27
- };
28
- readonly root: {
29
- readonly command: () => string;
30
- readonly commandsSurface: () => string[];
31
- readonly help: () => string;
32
- };
33
- readonly status: {
34
- readonly command: () => string;
35
- };
36
- };
37
- //# sourceMappingURL=commands.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,4BAA4B;IAC3C,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,WAAW;;6BAEV,MAAM;8BACL,MAAM;gDACY,MAAM;+BACvB,MAAM;+BACN,MAAM;;;gCAGL,MAAM;oCACA,MAAM,KAAG,MAAM;oCACf,4BAA4B,KAAG,MAAM;kCAOvC,MAAM,YAAY,MAAM,WAAW;YAAE,OAAO,EAAE,OAAO,CAAA;SAAE,KAAG,MAAM;;mCAM7D,MAAM,GAAG,IAAI,KAAG,MAAM;;mCAQxB,MAAM,KAAG,MAAM;sCACZ,MAAM,KAAG,MAAM;iCACpB,MAAM,KAAG,MAAM;0CACN,MAAM,SAAS,MAAM,KAAG,MAAM;;;gCAK1C,MAAM;wCACE,MAAM,EAAE;6BAYnB,MAAM;;;gCAGH,MAAM;;CAEb,CAAC"}
@@ -1,56 +0,0 @@
1
- export const cliCommands = {
2
- auth: {
3
- help: () => "ogment auth --help",
4
- login: () => "ogment auth login",
5
- loginWithApiKeyRedacted: () => "ogment auth login --api-key <redacted>",
6
- logout: () => "ogment auth logout",
7
- status: () => "ogment auth status",
8
- },
9
- catalog: {
10
- command: () => "ogment catalog",
11
- server: (serverId) => `ogment catalog ${serverId}`,
12
- summary: (options) => {
13
- return [
14
- "ogment catalog",
15
- ...(options.cursor === undefined ? [] : [`--cursor ${options.cursor}`]),
16
- ...(options.limit === undefined ? [] : [`--limit ${options.limit}`]),
17
- ].join(" ");
18
- },
19
- tool: (serverId, toolName, options) => {
20
- return ["ogment catalog", serverId, toolName, ...(options.example ? ["--example"] : [])].join(" ");
21
- },
22
- },
23
- helpForScope: (scope) => {
24
- if (scope === null) {
25
- return "ogment --help";
26
- }
27
- return `ogment ${scope} --help`;
28
- },
29
- invoke: {
30
- command: (target) => `ogment invoke ${target}`,
31
- inlineJson: (target) => `ogment invoke ${target} --input <json>`,
32
- stdin: (target) => `ogment invoke ${target} --input -`,
33
- withInputValue: (target, value) => {
34
- return `ogment invoke ${target} --input ${value}`;
35
- },
36
- },
37
- root: {
38
- command: () => "ogment",
39
- commandsSurface: () => {
40
- return [
41
- "auth login",
42
- "auth status",
43
- "auth logout",
44
- "catalog",
45
- "catalog <server-id>",
46
- "catalog <server-id> <tool-name>",
47
- "invoke <server-id>/<tool-name>",
48
- "status",
49
- ];
50
- },
51
- help: () => "ogment --help",
52
- },
53
- status: {
54
- command: () => "ogment status",
55
- },
56
- };
@@ -1,11 +0,0 @@
1
- import { type AppError } from "../shared/errors.js";
2
- import { type ExitCode } from "../shared/exit-codes.js";
3
- import type { CliInvocation } from "./invocations.js";
4
- import type { Runtime } from "./runtime.js";
5
- export declare class CliExitError extends Error {
6
- readonly exitCode: ExitCode;
7
- constructor(exitCode: ExitCode);
8
- }
9
- export declare const executeInvocation: (runtime: Runtime, invocation: CliInvocation) => Promise<void>;
10
- export declare const normalizeCliRuntimeError: (error: unknown) => AppError;
11
- //# sourceMappingURL=execute.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/cli/execute.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,KAAK,QAAQ,EAOd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,QAAQ,EAAoB,MAAM,yBAAyB,CAAC;AAY1E,OAAO,KAAK,EAGV,aAAa,EAEd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAsB5C,qBAAa,YAAa,SAAQ,KAAK;IACrC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;gBAET,QAAQ,EAAE,QAAQ;CAItC;AAooBD,eAAO,MAAM,iBAAiB,GAC5B,SAAS,OAAO,EAChB,YAAY,aAAa,KACxB,OAAO,CAAC,IAAI,CAMd,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,OAAO,OAAO,KAAG,QAuBzD,CAAC"}