@typeship-ax/cli 0.6.0 → 0.9.1

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 (121) hide show
  1. package/AGENTS.md +31 -0
  2. package/README.md +26 -9
  3. package/api.json +6861 -3083
  4. package/api.md +508 -277
  5. package/dist/api-identity.d.ts +40 -0
  6. package/dist/api-identity.d.ts.map +1 -0
  7. package/dist/api-identity.js +128 -0
  8. package/dist/auth-profiles.d.ts +30 -0
  9. package/dist/auth-profiles.d.ts.map +1 -0
  10. package/dist/auth-profiles.js +138 -0
  11. package/dist/cli-agent.d.ts +9 -1
  12. package/dist/cli-agent.d.ts.map +1 -1
  13. package/dist/cli-agent.js +26 -9
  14. package/dist/cli.js +600 -582
  15. package/dist/console-login-check.d.ts +21 -0
  16. package/dist/console-login-check.d.ts.map +1 -0
  17. package/dist/console-login-check.js +107 -0
  18. package/dist/console-login-contract.d.ts +45 -0
  19. package/dist/console-login-contract.d.ts.map +1 -0
  20. package/dist/console-login-contract.js +40 -0
  21. package/dist/core/http.d.ts +21 -92
  22. package/dist/core/http.d.ts.map +1 -1
  23. package/dist/core/http.js +143 -221
  24. package/dist/core/pagination.d.ts.map +1 -1
  25. package/dist/core/pagination.js +6 -34
  26. package/dist/credential-storage.d.ts +24 -0
  27. package/dist/credential-storage.d.ts.map +1 -0
  28. package/dist/credential-storage.js +207 -0
  29. package/dist/dates.d.ts +0 -2
  30. package/dist/dates.d.ts.map +1 -1
  31. package/dist/dates.js +0 -1
  32. package/dist/docs.d.ts +36 -0
  33. package/dist/docs.d.ts.map +1 -0
  34. package/dist/docs.js +258 -0
  35. package/dist/errors.d.ts +42 -34
  36. package/dist/errors.d.ts.map +1 -1
  37. package/dist/errors.js +30 -20
  38. package/dist/index.d.ts +27 -12
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +40 -14
  41. package/dist/named-credentials.d.ts +21 -0
  42. package/dist/named-credentials.d.ts.map +1 -0
  43. package/dist/named-credentials.js +86 -0
  44. package/dist/oauth-login.d.ts +39 -0
  45. package/dist/oauth-login.d.ts.map +1 -0
  46. package/dist/oauth-login.js +171 -0
  47. package/dist/oauth-request.d.ts +21 -0
  48. package/dist/oauth-request.d.ts.map +1 -0
  49. package/dist/oauth-request.js +119 -0
  50. package/dist/oauth-session.d.ts +106 -0
  51. package/dist/oauth-session.d.ts.map +1 -0
  52. package/dist/oauth-session.js +244 -0
  53. package/dist/ops.d.ts +18 -0
  54. package/dist/ops.d.ts.map +1 -1
  55. package/dist/ops.js +31 -17
  56. package/dist/polling-login.d.ts +57 -0
  57. package/dist/polling-login.d.ts.map +1 -0
  58. package/dist/polling-login.js +204 -0
  59. package/dist/resources/account.d.ts +4 -4
  60. package/dist/resources/account.d.ts.map +1 -1
  61. package/dist/resources/account.js +1 -0
  62. package/dist/resources/api-keys.d.ts +13 -8
  63. package/dist/resources/api-keys.d.ts.map +1 -1
  64. package/dist/resources/api-keys.js +5 -1
  65. package/dist/resources/definition-revisions.d.ts +58 -0
  66. package/dist/resources/definition-revisions.d.ts.map +1 -0
  67. package/dist/resources/definition-revisions.js +114 -0
  68. package/dist/resources/definitions.d.ts +35 -0
  69. package/dist/resources/definitions.d.ts.map +1 -0
  70. package/dist/resources/definitions.js +60 -0
  71. package/dist/resources/generate.d.ts +18 -7
  72. package/dist/resources/generate.d.ts.map +1 -1
  73. package/dist/resources/generate.js +13 -5
  74. package/dist/resources/generations.d.ts +6 -6
  75. package/dist/resources/generations.d.ts.map +1 -1
  76. package/dist/resources/generations.js +3 -1
  77. package/dist/resources/projects.d.ts +111 -35
  78. package/dist/resources/projects.d.ts.map +1 -1
  79. package/dist/resources/projects.js +125 -15
  80. package/dist/resources/targets.d.ts +97 -0
  81. package/dist/resources/targets.d.ts.map +1 -0
  82. package/dist/resources/targets.js +197 -0
  83. package/dist/schemas.d.ts.map +1 -1
  84. package/dist/schemas.js +135 -62
  85. package/dist/types.d.ts +2072 -267
  86. package/dist/types.d.ts.map +1 -1
  87. package/dist/types.js +20 -3
  88. package/package.json +2 -1
  89. package/src/api-identity.ts +98 -0
  90. package/src/auth-profiles.ts +114 -0
  91. package/src/cli-agent.ts +28 -11
  92. package/src/cli.ts +528 -560
  93. package/src/console-login-check.ts +88 -0
  94. package/src/console-login-contract.ts +65 -0
  95. package/src/core/http.ts +156 -305
  96. package/src/core/pagination.ts +6 -30
  97. package/src/credential-storage.ts +183 -0
  98. package/src/dates.ts +0 -1
  99. package/src/docs.ts +239 -0
  100. package/src/errors.ts +52 -41
  101. package/src/index.ts +49 -14
  102. package/src/named-credentials.ts +74 -0
  103. package/src/oauth-login.ts +184 -0
  104. package/src/oauth-request.ts +90 -0
  105. package/src/oauth-session.ts +258 -0
  106. package/src/ops.ts +56 -17
  107. package/src/polling-login.ts +165 -0
  108. package/src/resources/account.ts +6 -3
  109. package/src/resources/api-keys.ts +27 -7
  110. package/src/resources/definition-revisions.ts +207 -0
  111. package/src/resources/definitions.ts +122 -0
  112. package/src/resources/generate.ts +29 -6
  113. package/src/resources/generations.ts +9 -4
  114. package/src/resources/projects.ts +274 -41
  115. package/src/resources/targets.ts +378 -0
  116. package/src/schemas.ts +135 -62
  117. package/src/types.ts +2273 -322
  118. package/dist/resources/spec-revisions.d.ts +0 -47
  119. package/dist/resources/spec-revisions.d.ts.map +0 -1
  120. package/dist/resources/spec-revisions.js +0 -90
  121. package/src/resources/spec-revisions.ts +0 -150
package/api.md CHANGED
@@ -1,54 +1,56 @@
1
- # typeship — API reference
1
+ # typeship — CLI reference
2
2
 
3
- Version 0.6.0. Generated by typeship; regenerate rather than editing.
3
+ API version 1.0.0. Package version 0.9.1. Generated by typeship; regenerate rather than editing.
4
4
 
5
- All methods return `ApiResult<T, E>`: check `result.ok`, or `unwrap(result)` to throw typed errors.
5
+ Run `typeship help --json` for the command index. Path arguments are positional; flags use the names shown below. Arrays accept repeated flags, comma-separated values, or a JSON array; object values use JSON.
6
6
 
7
- For complete input and output schemas, use [`api.json`](./api.json), the machine-readable companion to this reference. Collapsed wire arguments below use API field names for CLI and MCP; SDK calls use the native signature shown in each heading.
7
+ API commands write JSON to stdout. Exit codes: `0` success, `1` request failure, `2` invalid usage. In agent mode, errors are JSON on stderr with `status`, `issues`, and `next_steps`; branch on `issues[].code`. Destructive operations require `--force` without an interactive terminal.
8
+
9
+ Use `--fields id,name` to project response fields. `--base-url <url>` overrides the endpoint. See [`README.md`](./README.md) for local setup and authentication.
10
+
11
+ For complete input and output schemas, use [`api.json`](./api.json), the machine-readable companion to this reference.
8
12
 
9
13
  ## generate
10
14
 
11
- ### `client.generate.run(body)`
15
+ ### `typeship generate run [flags]`
12
16
 
13
- Generate a package from a spec
17
+ Generate one Target from a Definition
14
18
 
15
19
  `POST /generate`
16
20
 
21
+ Safety: **write** · Authentication: **optional**
22
+
17
23
  Stateless generation: nothing is stored. Returns the full generated
18
24
  package as files. Works without an API key: anonymous calls generate
19
25
  the first 25 operations, rate limited per IP address, and the
20
26
  response's `limits` object says what was held back and where to lift
21
- it; anonymous calls from a spec URL also carry `claim.url`, a link
27
+ it; anonymous calls from a Definition URL also carry `claim.url`, a link
22
28
  that turns the run into a project once a person signs in. With a key, the free plan generates the first 25 operations and
23
- paid plans generate the whole spec. A present but invalid key is a
29
+ paid plans generate the complete Definition. A present but invalid key is a
24
30
  401, not a downgrade to anonymous.
25
31
 
26
- Safety: **write** · Authentication: **optional**
27
-
28
- Body: `GenerateRequest` (required)
29
-
30
- Returns: `GenerationResult`
31
- Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `PayloadTooLargeError` (413), `UnprocessableEntityError` (422), `RateLimitedError` (429), `ApiResponseError` (default)
32
+ | Argument or flag | In | Type | Required | Description |
33
+ | --- | --- | --- | --- | --- |
34
+ | `--definition` | body | `json` | yes | A Definition for stateless generation, provided as exactly one URL or inline entrypoint. |
35
+ | `--target` | body | `object` | yes | Stateless generator descriptor; no persisted Target is created. |
36
+ | `--package-name` | body | `string` | no | npm package or Python distribution override. Valid only for the TypeScript and Python SDK targets. |
37
+ | `--module-path` | body | `string` | no | Go module path override. Valid only for the Go SDK. Linked projects derive this from the Go destination repository by default. |
38
+ | `--config` | body | `object` | no | Everything Typeship needs beyond the Definition, in one object: generation customization (globals, retries, pagination, readme) and how the generated tooling behaves (cli, mcp, package, docs_url). Plain configuration. Typeship never requires vendor extensions inside the Definition itself. Stateless generation also accepts GraphQL settings here; stored projects keep those settings on their Definition. |
39
+ | `--idempotency-key` | header | `string` | no | Identifies one logical write for 24 hours. The key is scoped to the authenticated account and operation; account-less generation uses a hashed network identity. Retrying the same method, path, query, and JSON body replays the original response. Reusing the key with changed intent returns 409. After expiry the key starts a new write. |
32
40
 
33
- <details>
34
- <summary>Wire arguments (CLI and MCP)</summary>
41
+ Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
35
42
 
36
- ```json
37
- {
38
- "spec": {
39
- "url": "https://example.com"
40
- },
41
- "outputs": [
42
- "typescript-sdk"
43
- ]
44
- }
43
+ ```sh
44
+ typeship generate run --definition '{"url":"https://example.com"}' --target '{"generator":"typescript-sdk"}'
45
45
  ```
46
46
 
47
- </details>
47
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
48
+
49
+ Read the full command contract with `typeship docs generate run --json`.
48
50
 
49
51
  ## projects
50
52
 
51
- ### `client.projects.list(params)`
53
+ ### `typeship projects list [flags]`
52
54
 
53
55
  List projects
54
56
 
@@ -56,61 +58,50 @@ List projects
56
58
 
57
59
  Safety: **read** · Authentication: **required**
58
60
 
59
- | Parameter | In | Type | Required | Description |
61
+ | Argument or flag | In | Type | Required | Description |
60
62
  | --- | --- | --- | --- | --- |
61
- | `limit` | query | `number` | no | Maximum number of resources to return. |
62
- | `cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. |
63
-
64
- Returns: `PagePromise<Project>` — auto-paginating (`for await` walks every page)
65
- Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `RateLimitedError` (429)
63
+ | `--limit` | query | `number` | no | Maximum number of resources to return. Default: 20. |
64
+ | `--cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. Valid only for the same account, operation, filters, and ordering that issued it. |
66
65
 
67
- <details>
68
- <summary>Wire arguments (CLI and MCP)</summary>
69
-
70
- ```json
71
- {}
66
+ ```sh
67
+ typeship projects list
72
68
  ```
73
69
 
74
- </details>
70
+ Output: JSON with `items` and `hasMore`; when another page exists, `nextPage` contains its arguments and `nextCommand` contains the command to fetch it. Use `--all` to stream every item from every page as NDJSON.
71
+
72
+ Read the full command contract with `typeship docs projects list --json`.
75
73
 
76
- ### `client.projects.create(body, params)`
74
+ ### `typeship projects create [flags]`
77
75
 
78
76
  Create a project
79
77
 
80
78
  `POST /projects`
81
79
 
82
- Stores a URL- or GitHub-sourced project. Free includes one stored project, every selected output, and the first 25 operations, while keeping manual and automatic regeneration, history, destination pull requests, and preview checks. Stateless POST /generate does not consume this slot. Pro adds projects and the whole spec.
83
-
84
80
  Safety: **write** · Authentication: **required**
85
81
 
86
- | Parameter | In | Type | Required | Description |
82
+ Stores a URL- or GitHub-sourced project. Free includes one stored project, every selected target, and the first 25 operations, while keeping manual and automatic regeneration, history, destination pull requests, and preview checks. Stateless POST /generate does not consume this slot. Pro adds projects and generates every operation in the Definition.
83
+
84
+ | Argument or flag | In | Type | Required | Description |
87
85
  | --- | --- | --- | --- | --- |
88
- | `idempotencyKey` | header | `string` | no | Uniquely identifies this creation attempt. Retrying the same request with the same key returns the original response instead of creating another project. Reusing a key with different parameters returns 409. |
89
-
90
- Body: `CreateProjectRequest` (required)
91
-
92
- Returns: `Project`
93
- Errors: `BadRequestError` (400), `UnauthorizedError` (401), `PaymentRequiredError` (402), `ForbiddenError` (403), `ConflictError` (409), `RateLimitedError` (429), `InternalServerError` (500)
94
-
95
- <details>
96
- <summary>Wire arguments (CLI and MCP)</summary>
97
-
98
- ```json
99
- {
100
- "name": "example",
101
- "source": {
102
- "kind": "url",
103
- "url": "https://example.com"
104
- },
105
- "outputs": [
106
- "typescript-sdk"
107
- ]
108
- }
86
+ | `--name` | body | `string` | yes | — |
87
+ | `--definition` | body | `object` | yes | — |
88
+ | `--targets` | body | `array` | yes | Initial first-class Targets. More than one may use the same generator with different identities or Deliveries. |
89
+ | `--auto-generate` | body | `boolean` | no | Whether Typeship should regenerate automatically when the source changes. Default: false. |
90
+ | `--relay-enabled` | body | `boolean` | no | Enable webhook relay sessions. Requires the CLI target and Pro. Default: false. |
91
+ | `--config` | body | `json` | no | Shared defaults inherited by every Target. GraphQL settings belong in definition.graphql. |
92
+ | `--idempotency-key` | header | `string` | no | Identifies one logical write for 24 hours. The key is scoped to the authenticated account and operation; account-less generation uses a hashed network identity. Retrying the same method, path, query, and JSON body replays the original response. Reusing the key with changed intent returns 409. After expiry the key starts a new write. |
93
+
94
+ Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
95
+
96
+ ```sh
97
+ typeship projects create --name example --definition '{"source":{"kind":"url","url":"https://example.com"}}' --targets '[{"name":"example","generator":"typescript-sdk"}]'
109
98
  ```
110
99
 
111
- </details>
100
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
101
+
102
+ Read the full command contract with `typeship docs projects create --json`.
112
103
 
113
- ### `client.projects.retrieve(projectId)`
104
+ ### `typeship projects retrieve <project_id> [flags]`
114
105
 
115
106
  Retrieve a project
116
107
 
@@ -118,25 +109,21 @@ Retrieve a project
118
109
 
119
110
  Safety: **read** · Authentication: **required**
120
111
 
121
- | Parameter | In | Type | Required | Description |
122
- | --- | --- | --- | --- | --- |
123
- | `projectId` | path | `ProjectId` | yes | — |
124
-
125
- Returns: `Project`
126
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
112
+ Returns Project-owned fields only. List Targets separately for Target and Delivery data.
127
113
 
128
- <details>
129
- <summary>Wire arguments (CLI and MCP)</summary>
114
+ | Argument or flag | In | Type | Required | Description |
115
+ | --- | --- | --- | --- | --- |
116
+ | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
130
117
 
131
- ```json
132
- {
133
- "project_id": "prj_4f8k2m7x9q1v6b3n"
134
- }
118
+ ```sh
119
+ typeship projects retrieve prj_4f8k2m7x9q1v6b3n
135
120
  ```
136
121
 
137
- </details>
122
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
123
+
124
+ Read the full command contract with `typeship docs projects retrieve --json`.
138
125
 
139
- ### `client.projects.delete(projectId)`
126
+ ### `typeship projects delete <project_id> [flags]`
140
127
 
141
128
  Delete a project
142
129
 
@@ -144,25 +131,19 @@ Delete a project
144
131
 
145
132
  Safety: **destructive** · Authentication: **required**
146
133
 
147
- | Parameter | In | Type | Required | Description |
134
+ | Argument or flag | In | Type | Required | Description |
148
135
  | --- | --- | --- | --- | --- |
149
- | `projectId` | path | `ProjectId` | yes | — |
150
-
151
- Returns: `DeletedProject`
152
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
136
+ | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
153
137
 
154
- <details>
155
- <summary>Wire arguments (CLI and MCP)</summary>
156
-
157
- ```json
158
- {
159
- "project_id": "prj_4f8k2m7x9q1v6b3n"
160
- }
138
+ ```sh
139
+ typeship projects delete prj_4f8k2m7x9q1v6b3n --force
161
140
  ```
162
141
 
163
- </details>
142
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
143
+
144
+ Read the full command contract with `typeship docs projects delete --json`.
164
145
 
165
- ### `client.projects.update(projectId, body)`
146
+ ### `typeship projects update <project_id> [flags]`
166
147
 
167
148
  Update a project
168
149
 
@@ -170,90 +151,149 @@ Update a project
170
151
 
171
152
  Safety: **write** · Authentication: **required**
172
153
 
173
- | Parameter | In | Type | Required | Description |
154
+ | Argument or flag | In | Type | Required | Description |
174
155
  | --- | --- | --- | --- | --- |
175
- | `projectId` | path | `ProjectId` | yes | — |
156
+ | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
157
+ | `--name` | body | `string` | no | — |
158
+ | `--auto-generate` | body | `boolean` | no | — |
159
+ | `--relay-enabled` | body | `boolean` | no | Enable webhook relay sessions. Requires the CLI target and Pro. |
160
+ | `--config` | body | `json` | no | Replaces the Project's shared Target defaults. Send null to clear them. |
161
+
162
+ Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
163
+
164
+ ```sh
165
+ typeship projects update prj_4f8k2m7x9q1v6b3n
166
+ ```
167
+
168
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
176
169
 
177
- Body: `UpdateProjectRequest` (required)
170
+ Read the full command contract with `typeship docs projects update --json`.
178
171
 
179
- Returns: `Project`
180
- Errors: `BadRequestError` (400), `UnauthorizedError` (401), `PaymentRequiredError` (402), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
172
+ ### `typeship projects retrieve-diagnostics <project_id> [flags]`
181
173
 
182
- <details>
183
- <summary>Wire arguments (CLI and MCP)</summary>
174
+ Analyze a project's latest Definition Revision
184
175
 
185
- ```json
186
- {
187
- "project_id": "prj_4f8k2m7x9q1v6b3n"
188
- }
176
+ `GET /projects/{project_id}/diagnostics`
177
+
178
+ Safety: **read** · Authentication: **required**
179
+
180
+ Runs deterministic OpenAPI or GraphQL authorship checks against the latest observed immutable Definition Revision after applying the Definition's existing patches. Diagnostics group every affected location under a stable rule. Exact patches are included only when Typeship can derive the change without inventing API behavior.
181
+
182
+ | Argument or flag | In | Type | Required | Description |
183
+ | --- | --- | --- | --- | --- |
184
+ | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
185
+
186
+ ```sh
187
+ typeship projects retrieve-diagnostics prj_4f8k2m7x9q1v6b3n
189
188
  ```
190
189
 
191
- </details>
190
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
192
191
 
193
- ### `client.projects.retrieveGithubHealth(projectId)`
192
+ Read the full command contract with `typeship docs projects retrieve-diagnostics --json`.
194
193
 
195
- Diagnose a project's GitHub integration
194
+ ### `typeship projects refresh-diagnostics <project_id> [flags]`
196
195
 
197
- `GET /projects/{project_id}/github`
196
+ Refresh a project's Diagnostics from its configured source
198
197
 
199
- Returns machine-actionable source and destination access, spec readability, optional label setup, required status names, and the latest durable webhook delivery. The console renders this same result.
198
+ `POST /projects/{project_id}/diagnostics`
200
199
 
201
- Safety: **read** · Authentication: **required**
200
+ Safety: **write** · Authentication: **required**
201
+
202
+ Fetches the complete configured source, records a new immutable revision only when content changed, and returns its Diagnostics. This does not generate targets or consume a metered generation.
202
203
 
203
- | Parameter | In | Type | Required | Description |
204
+ | Argument or flag | In | Type | Required | Description |
204
205
  | --- | --- | --- | --- | --- |
205
- | `projectId` | path | `ProjectId` | yes | — |
206
+ | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
207
+ | `--idempotency-key` | header | `string` | no | Identifies one logical write for 24 hours. The key is scoped to the authenticated account and operation; account-less generation uses a hashed network identity. Retrying the same method, path, query, and JSON body replays the original response. Reusing the key with changed intent returns 409. After expiry the key starts a new write. |
208
+
209
+ ```sh
210
+ typeship projects refresh-diagnostics prj_4f8k2m7x9q1v6b3n
211
+ ```
212
+
213
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
214
+
215
+ Read the full command contract with `typeship docs projects refresh-diagnostics --json`.
206
216
 
207
- Returns: `GithubIntegrationHealth`
208
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
217
+ ### `typeship projects remediate-diagnostics <project_id> [flags]`
209
218
 
210
- <details>
211
- <summary>Wire arguments (CLI and MCP)</summary>
219
+ Apply exact, reviewed diagnostic remediations
212
220
 
213
- ```json
214
- {
215
- "project_id": "prj_4f8k2m7x9q1v6b3n"
216
- }
221
+ `POST /projects/{project_id}/diagnostics/remediations`
222
+
223
+ Safety: **write** · Authentication: **required**
224
+
225
+ Applies only deterministic patches. Repository sources receive an updateable source pull request; URL sources receive project overlays. Diagnostics that require API-owner intent return 422 and include an authoring_brief in the Diagnostic instead.
226
+
227
+ | Argument or flag | In | Type | Required | Description |
228
+ | --- | --- | --- | --- | --- |
229
+ | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
230
+ | `--diagnostic-ids` | body | `array` | yes | Stable IDs of current diagnostics whose exact patches should be reviewed and applied. |
231
+ | `--idempotency-key` | header | `string` | no | Identifies one logical write for 24 hours. The key is scoped to the authenticated account and operation; account-less generation uses a hashed network identity. Retrying the same method, path, query, and JSON body replays the original response. Reusing the key with changed intent returns 409. After expiry the key starts a new write. |
232
+
233
+ Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
234
+
235
+ ```sh
236
+ typeship projects remediate-diagnostics prj_4f8k2m7x9q1v6b3n --diagnostic-ids '["value"]'
217
237
  ```
218
238
 
219
- </details>
239
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
220
240
 
221
- ### `client.projects.listGenerations(projectId, params)`
241
+ Read the full command contract with `typeship docs projects remediate-diagnostics --json`.
222
242
 
223
- List a project's generations
243
+ ### `typeship projects retrieve-integration-health <project_id> [flags]`
224
244
 
225
- `GET /projects/{project_id}/generations`
245
+ Diagnose a project's repository integrations
246
+
247
+ `GET /projects/{project_id}/integration-health`
226
248
 
227
249
  Safety: **read** · Authentication: **required**
228
250
 
229
- | Parameter | In | Type | Required | Description |
251
+ Returns provider-neutral, machine-actionable source and destination access, Definition readability, source-approval label setup, required status names, and the latest durable webhook delivery. The Console renders this same result.
252
+
253
+ | Argument or flag | In | Type | Required | Description |
230
254
  | --- | --- | --- | --- | --- |
231
- | `projectId` | path | `ProjectId` | yes | — |
232
- | `limit` | query | `number` | no | Maximum number of resources to return. |
233
- | `cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. |
234
- | `output` | query | `OutputId` | no | Only generations for this output. |
255
+ | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
235
256
 
236
- Returns: `PagePromise<Generation>` — auto-paginating (`for await` walks every page)
237
- Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
257
+ ```sh
258
+ typeship projects retrieve-integration-health prj_4f8k2m7x9q1v6b3n
259
+ ```
238
260
 
239
- <details>
240
- <summary>Wire arguments (CLI and MCP)</summary>
261
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
241
262
 
242
- ```json
243
- {
244
- "project_id": "prj_4f8k2m7x9q1v6b3n"
245
- }
263
+ Read the full command contract with `typeship docs projects retrieve-integration-health --json`.
264
+
265
+ ### `typeship projects list-generations <project_id> [flags]`
266
+
267
+ List a project's generations
268
+
269
+ `GET /projects/{project_id}/generations`
270
+
271
+ Safety: **read** · Authentication: **required**
272
+
273
+ | Argument or flag | In | Type | Required | Description |
274
+ | --- | --- | --- | --- | --- |
275
+ | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
276
+ | `--limit` | query | `number` | no | Maximum number of resources to return. Default: 20. |
277
+ | `--cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. Valid only for the same account, operation, filters, and ordering that issued it. |
278
+ | `--target-id` | query | `string` | no | Only generations for this persisted Target. |
279
+
280
+ ```sh
281
+ typeship projects list-generations prj_4f8k2m7x9q1v6b3n
246
282
  ```
247
283
 
248
- </details>
284
+ Output: JSON with `items` and `hasMore`; when another page exists, `nextPage` contains its arguments and `nextCommand` contains the command to fetch it. Use `--all` to stream every item from every page as NDJSON.
249
285
 
250
- ### `client.projects.generate(projectId)`
286
+ Read the full command contract with `typeship docs projects list-generations --json`.
251
287
 
252
- Generate outputs and open pull requests
288
+ ### `typeship projects generate <project_id> [flags]`
289
+
290
+ Generate targets and open pull requests
253
291
 
254
292
  `POST /projects/{project_id}/generations`
255
293
 
256
- Resolves the project's URL or repository source, generates every
294
+ Safety: **write** · Authentication: **required**
295
+
296
+ Resolves the project's URL or GitHub source, generates every
257
297
  configured delivery package, stores each result in the project's history,
258
298
  and attempts to open a pull request in every configured destination.
259
299
  When the complete generated tree already matches a destination, no
@@ -261,252 +301,443 @@ commit, branch, or pull request is created and that generation reports
261
301
  `pr_status: no_changes`. This is the same pipeline automatic
262
302
  regeneration runs after a source change.
263
303
 
304
+ | Argument or flag | In | Type | Required | Description |
305
+ | --- | --- | --- | --- | --- |
306
+ | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
307
+ | `--idempotency-key` | header | `string` | no | Identifies one logical write for 24 hours. The key is scoped to the authenticated account and operation; account-less generation uses a hashed network identity. Retrying the same method, path, query, and JSON body replays the original response. Reusing the key with changed intent returns 409. After expiry the key starts a new write. |
308
+
309
+ ```sh
310
+ typeship projects generate prj_4f8k2m7x9q1v6b3n
311
+ ```
312
+
313
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
314
+
315
+ Read the full command contract with `typeship docs projects generate --json`.
316
+
317
+ ## definitions
318
+
319
+ ### `typeship definitions retrieve <definition_id> [flags]`
320
+
321
+ Retrieve a Definition
322
+
323
+ `GET /definitions/{definition_id}`
324
+
325
+ Safety: **read** · Authentication: **required**
326
+
327
+ | Argument or flag | In | Type | Required | Description |
328
+ | --- | --- | --- | --- | --- |
329
+ | `<definition_id>` | path | `string` | yes | — |
330
+
331
+ ```sh
332
+ typeship definitions retrieve def_2p8m4q7k1v9d6h3c
333
+ ```
334
+
335
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
336
+
337
+ Read the full command contract with `typeship docs definitions retrieve --json`.
338
+
339
+ ### `typeship definitions update <definition_id> [flags]`
340
+
341
+ Update and resolve a Definition
342
+
343
+ `PATCH /definitions/{definition_id}`
344
+
264
345
  Safety: **write** · Authentication: **required**
265
346
 
266
- | Parameter | In | Type | Required | Description |
347
+ Resolves the complete document graph and records a new immutable revision before saving.
348
+
349
+ | Argument or flag | In | Type | Required | Description |
267
350
  | --- | --- | --- | --- | --- |
268
- | `projectId` | path | `ProjectId` | yes | — |
351
+ | `<definition_id>` | path | `string` | yes | — |
352
+ | `--source` | body | `json` | no | — |
353
+ | `--patches` | body | `array` | no | — |
354
+ | `--graphql` | body | `json` | no | — |
355
+ | `--diagnostic-policy` | body | `object` | no | Source pull-request enforcement threshold, new-versus-complete baseline, and explicitly reviewed rule or location exceptions. |
356
+ | `--idempotency-key` | header | `string` | no | Identifies one logical write for 24 hours. The key is scoped to the authenticated account and operation; account-less generation uses a hashed network identity. Retrying the same method, path, query, and JSON body replays the original response. Reusing the key with changed intent returns 409. After expiry the key starts a new write. |
357
+
358
+ Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
359
+
360
+ ```sh
361
+ typeship definitions update def_2p8m4q7k1v9d6h3c
362
+ ```
269
363
 
270
- Returns: `GenerationBatch`
271
- Errors: `UnauthorizedError` (401), `PaymentRequiredError` (402), `ForbiddenError` (403), `NotFoundError` (404), `UnprocessableEntityError` (422), `RateLimitedError` (429), `InternalServerError` (500)
364
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
272
365
 
273
- <details>
274
- <summary>Wire arguments (CLI and MCP)</summary>
366
+ Read the full command contract with `typeship docs definitions update --json`.
275
367
 
276
- ```json
277
- {
278
- "project_id": "prj_4f8k2m7x9q1v6b3n"
279
- }
368
+ ## targets
369
+
370
+ ### `typeship targets list <project_id> [flags]`
371
+
372
+ List a project's Targets
373
+
374
+ `GET /projects/{project_id}/targets`
375
+
376
+ Safety: **read** · Authentication: **required**
377
+
378
+ | Argument or flag | In | Type | Required | Description |
379
+ | --- | --- | --- | --- | --- |
380
+ | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
381
+ | `--limit` | query | `number` | no | Maximum number of resources to return. Default: 20. |
382
+ | `--cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. Valid only for the same account, operation, filters, and ordering that issued it. |
383
+
384
+ ```sh
385
+ typeship targets list prj_4f8k2m7x9q1v6b3n
280
386
  ```
281
387
 
282
- </details>
388
+ Output: JSON with `items` and `hasMore`; when another page exists, `nextPage` contains its arguments and `nextCommand` contains the command to fetch it. Use `--all` to stream every item from every page as NDJSON.
283
389
 
284
- ## generations
390
+ Read the full command contract with `typeship docs targets list --json`.
285
391
 
286
- ### `client.generations.retrieve(generationId)`
392
+ ### `typeship targets create <project_id> [flags]`
287
393
 
288
- Retrieve a generation
394
+ Create an independently configured Target
289
395
 
290
- `GET /generations/{generation_id}`
396
+ `POST /projects/{project_id}/targets`
291
397
 
292
- Includes the generated files when the generation succeeded.
398
+ Safety: **write** · Authentication: **required**
399
+
400
+ Several Targets may use the same generator with distinct configuration, Deliveries, and release streams.
401
+
402
+ | Argument or flag | In | Type | Required | Description |
403
+ | --- | --- | --- | --- | --- |
404
+ | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
405
+ | `--name` | body | `string` | yes | — |
406
+ | `--definition-id` | body | `string` | yes | Unique identifier for a project's logical API Definition. |
407
+ | `--generator` | body | `string` | yes | Generator implementation selected by a Target. This is configuration, not identity; several Targets may use the same generator. |
408
+ | `--state` | body | `string` | no | Default: "active". |
409
+ | `--edition` | body | `string` | no | Default: "2026-08-24". |
410
+ | `--release-channel` | body | `string` | no | Default: "stable". |
411
+ | `--proposed-version` | body | `string` | no | Optional larger or prerelease SemVer for the next reviewed release. |
412
+ | `--config` | body | `json` | no | Target-specific overrides merged over Project.config. GraphQL settings are rejected here and belong to the Definition. |
413
+ | `--deliveries` | body | `array` | no | — |
414
+ | `--idempotency-key` | header | `string` | no | Identifies one logical write for 24 hours. The key is scoped to the authenticated account and operation; account-less generation uses a hashed network identity. Retrying the same method, path, query, and JSON body replays the original response. Reusing the key with changed intent returns 409. After expiry the key starts a new write. |
415
+
416
+ Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
417
+
418
+ ```sh
419
+ typeship targets create prj_4f8k2m7x9q1v6b3n --name example --definition-id def_2p8m4q7k1v9d6h3c --generator typescript-sdk
420
+ ```
421
+
422
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
423
+
424
+ Read the full command contract with `typeship docs targets create --json`.
425
+
426
+ ### `typeship targets retrieve <target_id> [flags]`
427
+
428
+ Retrieve a Target
429
+
430
+ `GET /targets/{target_id}`
293
431
 
294
432
  Safety: **read** · Authentication: **required**
295
433
 
296
- | Parameter | In | Type | Required | Description |
434
+ | Argument or flag | In | Type | Required | Description |
297
435
  | --- | --- | --- | --- | --- |
298
- | `generationId` | path | `GenerationId` | yes | — |
436
+ | `<target_id>` | path | `string` | yes | — |
437
+
438
+ ```sh
439
+ typeship targets retrieve tgt_5m8q2v7k1p9d4h6c
440
+ ```
441
+
442
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
299
443
 
300
- Returns: `Generation`
301
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
444
+ Read the full command contract with `typeship docs targets retrieve --json`.
302
445
 
303
- <details>
304
- <summary>Wire arguments (CLI and MCP)</summary>
446
+ ### `typeship targets delete <target_id> [flags]`
305
447
 
306
- ```json
307
- {
308
- "generation_id": "gen_7h2p5d9c3m8w1k6q"
309
- }
448
+ Delete an unused Target
449
+
450
+ `DELETE /targets/{target_id}`
451
+
452
+ Safety: **destructive** · Authentication: **required**
453
+
454
+ Targets with Generation or release history, or an active release candidate, must be disabled instead.
455
+
456
+ | Argument or flag | In | Type | Required | Description |
457
+ | --- | --- | --- | --- | --- |
458
+ | `<target_id>` | path | `string` | yes | — |
459
+
460
+ ```sh
461
+ typeship targets delete tgt_5m8q2v7k1p9d4h6c --force
310
462
  ```
311
463
 
312
- </details>
464
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
313
465
 
314
- ### `client.generations.retrieveFile(generationId, params)`
466
+ Read the full command contract with `typeship docs targets delete --json`.
315
467
 
316
- Fetch one file from a generation
468
+ ### `typeship targets update <target_id> [flags]`
317
469
 
318
- `GET /generations/{generation_id}/file`
470
+ Update a Target, its Deliveries, or its next reviewed version
471
+
472
+ `PATCH /targets/{target_id}`
473
+
474
+ Safety: **write** · Authentication: **required**
319
475
 
320
- Raw file content, for generations whose output was too large to inline (files_omitted true). The generation's files_index lists valid paths.
476
+ | Argument or flag | In | Type | Required | Description |
477
+ | --- | --- | --- | --- | --- |
478
+ | `<target_id>` | path | `string` | yes | — |
479
+ | `--name` | body | `string` | no | — |
480
+ | `--state` | body | `string` | no | — |
481
+ | `--edition` | body | `string` | no | — |
482
+ | `--release-channel` | body | `string` | no | — |
483
+ | `--proposed-version` | body | `string` | no | — |
484
+ | `--config` | body | `json` | no | Target-specific overrides merged over Project.config. GraphQL settings are rejected here and belong to the Definition. |
485
+ | `--deliveries` | body | `array` | no | — |
486
+
487
+ Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
488
+
489
+ ```sh
490
+ typeship targets update tgt_5m8q2v7k1p9d4h6c
491
+ ```
492
+
493
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
494
+
495
+ Read the full command contract with `typeship docs targets update --json`.
496
+
497
+ ### `typeship targets list-releases <target_id> [flags]`
498
+
499
+ List immutable releases for a Target
500
+
501
+ `GET /targets/{target_id}/releases`
321
502
 
322
503
  Safety: **read** · Authentication: **required**
323
504
 
324
- | Parameter | In | Type | Required | Description |
505
+ | Argument or flag | In | Type | Required | Description |
325
506
  | --- | --- | --- | --- | --- |
326
- | `generationId` | path | `GenerationId` | yes | — |
327
- | `path` | query | `string` | yes | Repo-relative path inside the generated package. |
507
+ | `<target_id>` | path | `string` | yes | — |
508
+ | `--limit` | query | `number` | no | Maximum number of resources to return. Default: 20. |
509
+ | `--cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. Valid only for the same account, operation, filters, and ordering that issued it. |
328
510
 
329
- Returns: `string`
330
- Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
511
+ ```sh
512
+ typeship targets list-releases tgt_5m8q2v7k1p9d4h6c
513
+ ```
514
+
515
+ Output: JSON with `items` and `hasMore`; when another page exists, `nextPage` contains its arguments and `nextCommand` contains the command to fetch it. Use `--all` to stream every item from every page as NDJSON.
516
+
517
+ Read the full command contract with `typeship docs targets list-releases --json`.
331
518
 
332
- <details>
333
- <summary>Wire arguments (CLI and MCP)</summary>
519
+ ### `typeship targets retrieve-release <target_release_id> [flags]`
334
520
 
335
- ```json
336
- {
337
- "generation_id": "gen_7h2p5d9c3m8w1k6q",
338
- "path": "openapi.yaml"
339
- }
521
+ Retrieve an immutable Target release
522
+
523
+ `GET /target_releases/{target_release_id}`
524
+
525
+ Safety: **read** · Authentication: **required**
526
+
527
+ | Argument or flag | In | Type | Required | Description |
528
+ | --- | --- | --- | --- | --- |
529
+ | `<target_release_id>` | path | `string` | yes | — |
530
+
531
+ ```sh
532
+ typeship targets retrieve-release rel_7m2q8v4k1p9d5h6c
340
533
  ```
341
534
 
342
- </details>
535
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
343
536
 
344
- ## specRevisions
537
+ Read the full command contract with `typeship docs targets retrieve-release --json`.
345
538
 
346
- ### `client.specRevisions.list(projectId, params)`
539
+ ## generations
347
540
 
348
- List specification revisions
541
+ ### `typeship generations retrieve <generation_id> [flags]`
349
542
 
350
- `GET /projects/{project_id}/spec_revisions`
543
+ Retrieve a generation
351
544
 
352
- Immutable snapshots of the exact source text this project consumed, newest first. Raw content is available from each revision's content endpoint and is never embedded in a list response.
545
+ `GET /generations/{generation_id}`
353
546
 
354
547
  Safety: **read** · Authentication: **required**
355
548
 
356
- | Parameter | In | Type | Required | Description |
549
+ Includes the generated files when the generation succeeded.
550
+
551
+ | Argument or flag | In | Type | Required | Description |
357
552
  | --- | --- | --- | --- | --- |
358
- | `projectId` | path | `ProjectId` | yes | — |
359
- | `limit` | query | `number` | no | Maximum number of resources to return. |
360
- | `cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. |
553
+ | `<generation_id>` | path | `string` | yes | — |
554
+
555
+ ```sh
556
+ typeship generations retrieve gen_7h2p5d9c3m8w1k6q
557
+ ```
558
+
559
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
560
+
561
+ Read the full command contract with `typeship docs generations retrieve --json`.
361
562
 
362
- Returns: `PagePromise<SpecRevision>` — auto-paginating (`for await` walks every page)
363
- Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
563
+ ### `typeship generations retrieve-file <generation_id> [flags]`
364
564
 
365
- <details>
366
- <summary>Wire arguments (CLI and MCP)</summary>
565
+ Fetch one file from a generation
566
+
567
+ `GET /generations/{generation_id}/file`
367
568
 
368
- ```json
369
- {
370
- "project_id": "prj_4f8k2m7x9q1v6b3n"
371
- }
569
+ Safety: **read** · Authentication: **required**
570
+
571
+ Raw file content, for generations whose target was too large to inline (files_omitted true). The generation's files_index lists valid paths.
572
+
573
+ | Argument or flag | In | Type | Required | Description |
574
+ | --- | --- | --- | --- | --- |
575
+ | `<generation_id>` | path | `string` | yes | — |
576
+ | `--path` | query | `string` | yes | Repo-relative path inside the generated package. |
577
+
578
+ ```sh
579
+ typeship generations retrieve-file gen_7h2p5d9c3m8w1k6q --path openapi.yaml
372
580
  ```
373
581
 
374
- </details>
582
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
583
+
584
+ Read the full command contract with `typeship docs generations retrieve-file --json`.
375
585
 
376
- ### `client.specRevisions.retrieve(specRevisionId)`
586
+ ## definitionRevisions
377
587
 
378
- Retrieve a specification revision
588
+ ### `typeship definition-revisions list <definition_id> [flags]`
379
589
 
380
- `GET /spec_revisions/{spec_revision_id}`
590
+ List Definition Revisions
381
591
 
382
- Metadata for one immutable source snapshot. Fetch raw source text from the content endpoint so metadata responses stay small and predictable.
592
+ `GET /definitions/{definition_id}/revisions`
383
593
 
384
594
  Safety: **read** · Authentication: **required**
385
595
 
386
- | Parameter | In | Type | Required | Description |
596
+ Immutable snapshots of the complete resolved document graph this Definition observed, newest first. Content is available from the revision and document endpoints and is never embedded in a list response.
597
+
598
+ | Argument or flag | In | Type | Required | Description |
387
599
  | --- | --- | --- | --- | --- |
388
- | `specRevisionId` | path | `SpecRevisionId` | yes | — |
600
+ | `<definition_id>` | path | `string` | yes | — |
601
+ | `--limit` | query | `number` | no | Maximum number of resources to return. Default: 20. |
602
+ | `--cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. Valid only for the same account, operation, filters, and ordering that issued it. |
603
+
604
+ ```sh
605
+ typeship definition-revisions list def_2p8m4q7k1v9d6h3c
606
+ ```
607
+
608
+ Output: JSON with `items` and `hasMore`; when another page exists, `nextPage` contains its arguments and `nextCommand` contains the command to fetch it. Use `--all` to stream every item from every page as NDJSON.
389
609
 
390
- Returns: `SpecRevision`
391
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
610
+ Read the full command contract with `typeship docs definition-revisions list --json`.
392
611
 
393
- <details>
394
- <summary>Wire arguments (CLI and MCP)</summary>
612
+ ### `typeship definition-revisions retrieve <definition_revision_id> [flags]`
395
613
 
396
- ```json
397
- {
398
- "spec_revision_id": "spec_6m1q8v4k2p9d7h3c"
399
- }
614
+ Retrieve a Definition Revision
615
+
616
+ `GET /definition_revisions/{definition_revision_id}`
617
+
618
+ Safety: **read** · Authentication: **required**
619
+
620
+ Metadata for one immutable resolved document graph. Fetch its canonical content or individual source documents from the content endpoints.
621
+
622
+ | Argument or flag | In | Type | Required | Description |
623
+ | --- | --- | --- | --- | --- |
624
+ | `<definition_revision_id>` | path | `string` | yes | — |
625
+
626
+ ```sh
627
+ typeship definition-revisions retrieve drev_6m1q8v4k2p9d7h3c
400
628
  ```
401
629
 
402
- </details>
630
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
403
631
 
404
- ### `client.specRevisions.retrieveContent(specRevisionId)`
632
+ Read the full command contract with `typeship docs definition-revisions retrieve --json`.
405
633
 
406
- Retrieve a specification revision's raw text
634
+ ### `typeship definition-revisions retrieve-content <definition_revision_id> [flags]`
407
635
 
408
- `GET /spec_revisions/{spec_revision_id}/content`
636
+ Retrieve a Definition Revision's canonical content
409
637
 
410
- Returns the exact source text identified by the revision's SHA-256 digest, suitable for saving or piping directly into a diff.
638
+ `GET /definition_revisions/{definition_revision_id}/content`
411
639
 
412
640
  Safety: **read** · Authentication: **required**
413
641
 
414
- | Parameter | In | Type | Required | Description |
642
+ Returns the exact canonical resolved content identified by the revision's graph digest, suitable for saving or piping into a diff.
643
+
644
+ | Argument or flag | In | Type | Required | Description |
415
645
  | --- | --- | --- | --- | --- |
416
- | `specRevisionId` | path | `SpecRevisionId` | yes | — |
646
+ | `<definition_revision_id>` | path | `string` | yes | — |
647
+
648
+ ```sh
649
+ typeship definition-revisions retrieve-content drev_6m1q8v4k2p9d7h3c
650
+ ```
651
+
652
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
653
+
654
+ Read the full command contract with `typeship docs definition-revisions retrieve-content --json`.
417
655
 
418
- Returns: `string`
419
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
656
+ ### `typeship definition-revisions retrieve-document-content <definition_revision_id> <document_id> [flags]`
420
657
 
421
- <details>
422
- <summary>Wire arguments (CLI and MCP)</summary>
658
+ Retrieve one source document from a Definition Revision
423
659
 
424
- ```json
425
- {
426
- "spec_revision_id": "spec_6m1q8v4k2p9d7h3c"
427
- }
660
+ `GET /definition_revisions/{definition_revision_id}/documents/{document_id}/content`
661
+
662
+ Safety: **read** · Authentication: **required**
663
+
664
+ | Argument or flag | In | Type | Required | Description |
665
+ | --- | --- | --- | --- | --- |
666
+ | `<definition_revision_id>` | path | `string` | yes | — |
667
+ | `<document_id>` | path | `string` | yes | — |
668
+
669
+ ```sh
670
+ typeship definition-revisions retrieve-document-content drev_6m1q8v4k2p9d7h3c doc_8q2m5v1k9p4d7h3c
428
671
  ```
429
672
 
430
- </details>
673
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
674
+
675
+ Read the full command contract with `typeship docs definition-revisions retrieve-document-content --json`.
431
676
 
432
677
  ## account
433
678
 
434
- ### `client.account.retrieve()`
679
+ ### `typeship account retrieve [flags]`
435
680
 
436
681
  The account behind the presented credentials
437
682
 
438
683
  `GET /me`
439
684
 
440
- Returns the account that owns the presented API key. This is also the
441
- identity endpoint the generated typeship CLI's `whoami` calls.
442
-
443
685
  Safety: **read** · Authentication: **required**
444
686
 
445
- Returns: `Account`
446
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `RateLimitedError` (429)
447
-
448
- <details>
449
- <summary>Wire arguments (CLI and MCP)</summary>
687
+ Returns the account that owns the presented API key. This is also the
688
+ identity endpoint the generated typeship CLI's `whoami` calls.
450
689
 
451
- ```json
452
- {}
690
+ ```sh
691
+ typeship account retrieve
453
692
  ```
454
693
 
455
- </details>
694
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
695
+
696
+ Read the full command contract with `typeship docs account retrieve --json`.
456
697
 
457
698
  ## apiKeys
458
699
 
459
- ### `client.apiKeys.list(params)`
700
+ ### `typeship api-keys list [flags]`
460
701
 
461
702
  List API keys
462
703
 
463
704
  `GET /api_keys`
464
705
 
465
- Keys are never returned in full — only their identity and last four. Creation stays in the console deliberately: a leaked key that can mint more keys is a leaked account.
466
-
467
706
  Safety: **read** · Authentication: **required**
468
707
 
469
- | Parameter | In | Type | Required | Description |
470
- | --- | --- | --- | --- | --- |
471
- | `limit` | query | `number` | no | Maximum number of resources to return. |
472
- | `cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. |
473
-
474
- Returns: `PagePromise<ApiKey>` — auto-paginating (`for await` walks every page)
475
- Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `RateLimitedError` (429)
708
+ Keys are never returned in full — only their identity and last four. Creation stays in the console deliberately: a leaked key that can mint more keys is a leaked account.
476
709
 
477
- <details>
478
- <summary>Wire arguments (CLI and MCP)</summary>
710
+ | Argument or flag | In | Type | Required | Description |
711
+ | --- | --- | --- | --- | --- |
712
+ | `--limit` | query | `number` | no | Maximum number of resources to return. Default: 20. |
713
+ | `--cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. Valid only for the same account, operation, filters, and ordering that issued it. |
479
714
 
480
- ```json
481
- {}
715
+ ```sh
716
+ typeship api-keys list
482
717
  ```
483
718
 
484
- </details>
719
+ Output: JSON with `items` and `hasMore`; when another page exists, `nextPage` contains its arguments and `nextCommand` contains the command to fetch it. Use `--all` to stream every item from every page as NDJSON.
485
720
 
486
- ### `client.apiKeys.revoke(apiKeyId)`
721
+ Read the full command contract with `typeship docs api-keys list --json`.
722
+
723
+ ### `typeship api-keys revoke <api_key_id> [flags]`
487
724
 
488
725
  Revoke an API key
489
726
 
490
727
  `DELETE /api_keys/{api_key_id}`
491
728
 
492
- Idempotent: revoking an already-revoked key returns the same body, so a rotation script that re-runs does not have to special-case having already succeeded.
493
-
494
729
  Safety: **destructive** · Authentication: **required**
495
730
 
496
- | Parameter | In | Type | Required | Description |
497
- | --- | --- | --- | --- | --- |
498
- | `apiKeyId` | path | `string` | yes | — |
499
-
500
- Returns: `ApiKey`
501
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
731
+ Idempotent: revoking an already-revoked key returns the same body, so a rotation script that re-runs does not have to special-case having already succeeded. An OAuth member may revoke a key they created; an organization admin may revoke any key. Organization API keys retain account-wide authority.
502
732
 
503
- <details>
504
- <summary>Wire arguments (CLI and MCP)</summary>
733
+ | Argument or flag | In | Type | Required | Description |
734
+ | --- | --- | --- | --- | --- |
735
+ | `<api_key_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via api_keys_list). IDs come from api_keys_list. |
505
736
 
506
- ```json
507
- {
508
- "api_key_id": "api_key_123"
509
- }
737
+ ```sh
738
+ typeship api-keys revoke api_key_123 --force
510
739
  ```
511
740
 
512
- </details>
741
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
742
+
743
+ Read the full command contract with `typeship docs api-keys revoke --json`.