@typeship-ax/cli 0.8.0 → 0.10.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 (106) hide show
  1. package/AGENTS.md +31 -0
  2. package/README.md +26 -9
  3. package/api.json +3509 -800
  4. package/api.md +444 -494
  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.js +522 -355
  12. package/dist/console-login-check.d.ts +21 -0
  13. package/dist/console-login-check.d.ts.map +1 -0
  14. package/dist/console-login-check.js +107 -0
  15. package/dist/console-login-contract.d.ts +45 -0
  16. package/dist/console-login-contract.d.ts.map +1 -0
  17. package/dist/console-login-contract.js +40 -0
  18. package/dist/core/http.d.ts +17 -2
  19. package/dist/core/http.d.ts.map +1 -1
  20. package/dist/core/http.js +78 -17
  21. package/dist/credential-storage.d.ts +24 -0
  22. package/dist/credential-storage.d.ts.map +1 -0
  23. package/dist/credential-storage.js +207 -0
  24. package/dist/docs.d.ts +25 -0
  25. package/dist/docs.d.ts.map +1 -1
  26. package/dist/docs.js +144 -0
  27. package/dist/errors.d.ts +18 -10
  28. package/dist/errors.d.ts.map +1 -1
  29. package/dist/errors.js +24 -14
  30. package/dist/index.d.ts +10 -3
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +20 -4
  33. package/dist/named-credentials.d.ts +21 -0
  34. package/dist/named-credentials.d.ts.map +1 -0
  35. package/dist/named-credentials.js +86 -0
  36. package/dist/oauth-login.d.ts +39 -0
  37. package/dist/oauth-login.d.ts.map +1 -0
  38. package/dist/oauth-login.js +171 -0
  39. package/dist/oauth-request.d.ts +21 -0
  40. package/dist/oauth-request.d.ts.map +1 -0
  41. package/dist/oauth-request.js +119 -0
  42. package/dist/oauth-session.d.ts +106 -0
  43. package/dist/oauth-session.d.ts.map +1 -0
  44. package/dist/oauth-session.js +244 -0
  45. package/dist/ops.d.ts +14 -1
  46. package/dist/ops.d.ts.map +1 -1
  47. package/dist/ops.js +34 -30
  48. package/dist/polling-login.d.ts +57 -0
  49. package/dist/polling-login.d.ts.map +1 -0
  50. package/dist/polling-login.js +204 -0
  51. package/dist/resources/account.d.ts +2 -2
  52. package/dist/resources/account.d.ts.map +1 -1
  53. package/dist/resources/account.js +1 -0
  54. package/dist/resources/api-keys.d.ts +3 -3
  55. package/dist/resources/api-keys.d.ts.map +1 -1
  56. package/dist/resources/api-keys.js +2 -0
  57. package/dist/resources/definition-revisions.d.ts +5 -5
  58. package/dist/resources/definition-revisions.d.ts.map +1 -1
  59. package/dist/resources/definition-revisions.js +4 -0
  60. package/dist/resources/definitions.d.ts +15 -4
  61. package/dist/resources/definitions.d.ts.map +1 -1
  62. package/dist/resources/definitions.js +11 -2
  63. package/dist/resources/generate.d.ts +14 -3
  64. package/dist/resources/generate.d.ts.map +1 -1
  65. package/dist/resources/generate.js +10 -2
  66. package/dist/resources/generations.d.ts +3 -3
  67. package/dist/resources/generations.d.ts.map +1 -1
  68. package/dist/resources/generations.js +2 -0
  69. package/dist/resources/projects.d.ts +56 -20
  70. package/dist/resources/projects.d.ts.map +1 -1
  71. package/dist/resources/projects.js +40 -4
  72. package/dist/resources/targets.d.ts +84 -10
  73. package/dist/resources/targets.d.ts.map +1 -1
  74. package/dist/resources/targets.js +127 -2
  75. package/dist/schemas.d.ts.map +1 -1
  76. package/dist/schemas.js +55 -26
  77. package/dist/types.d.ts +602 -123
  78. package/dist/types.d.ts.map +1 -1
  79. package/dist/types.js +24 -0
  80. package/package.json +2 -1
  81. package/src/api-identity.ts +98 -0
  82. package/src/auth-profiles.ts +114 -0
  83. package/src/cli.ts +444 -332
  84. package/src/console-login-check.ts +88 -0
  85. package/src/console-login-contract.ts +65 -0
  86. package/src/core/http.ts +88 -19
  87. package/src/credential-storage.ts +183 -0
  88. package/src/docs.ts +138 -0
  89. package/src/errors.ts +26 -15
  90. package/src/index.ts +29 -4
  91. package/src/named-credentials.ts +74 -0
  92. package/src/oauth-login.ts +184 -0
  93. package/src/oauth-request.ts +90 -0
  94. package/src/oauth-session.ts +258 -0
  95. package/src/ops.ts +48 -31
  96. package/src/polling-login.ts +165 -0
  97. package/src/resources/account.ts +3 -0
  98. package/src/resources/api-keys.ts +5 -0
  99. package/src/resources/definition-revisions.ts +9 -0
  100. package/src/resources/definitions.ts +25 -0
  101. package/src/resources/generate.ts +23 -0
  102. package/src/resources/generations.ts +5 -0
  103. package/src/resources/projects.ts +95 -7
  104. package/src/resources/targets.ts +241 -0
  105. package/src/schemas.ts +55 -26
  106. package/src/types.ts +640 -123
package/api.md CHANGED
@@ -1,19 +1,25 @@
1
- # typeship — API reference
1
+ # typeship — CLI reference
2
2
 
3
- API version 1.0.0. Package version 0.8.0. Generated by typeship; regenerate rather than editing.
3
+ API version 1.0.0. Package version 0.10.0. 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
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
@@ -23,32 +29,28 @@ that turns the run into a project once a person signs in. With a key, the free p
23
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
- "definition": {
39
- "url": "https://example.com"
40
- },
41
- "target": {
42
- "generator": "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,66 +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. Valid only for the same account, operation, filters, and ordering that issued it. |
63
-
64
- Returns: `PagePromise<ProjectSummary>` — auto-paginating (`for await` walks every page)
65
- Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `RateLimitedError` (429)
66
-
67
- <details>
68
- <summary>Wire arguments (CLI and MCP)</summary>
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. |
69
65
 
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.
75
71
 
76
- ### `client.projects.create(body, params)`
72
+ Read the full command contract with `typeship docs projects list --json`.
73
+
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 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
80
  Safety: **write** · Authentication: **required**
85
81
 
86
- | Parameter | In | Type | Required | Description |
87
- | --- | --- | --- | --- | --- |
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), `UnprocessableEntityError` (422), `RateLimitedError` (429), `InternalServerError` (500)
94
-
95
- <details>
96
- <summary>Wire arguments (CLI and MCP)</summary>
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.
97
83
 
98
- ```json
99
- {
100
- "name": "example",
101
- "definition": {
102
- "source": {
103
- "kind": "url",
104
- "url": "https://example.com"
105
- }
106
- },
107
- "targets": [
108
- {
109
- "name": "example",
110
- "generator": "typescript-sdk"
111
- }
112
- ]
113
- }
84
+ | Argument or flag | In | Type | Required | Description |
85
+ | --- | --- | --- | --- | --- |
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"}]'
114
98
  ```
115
99
 
116
- </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`.
117
103
 
118
- ### `client.projects.retrieve(projectId)`
104
+ ### `typeship projects retrieve <project_id> [flags]`
119
105
 
120
106
  Retrieve a project
121
107
 
@@ -123,25 +109,21 @@ Retrieve a project
123
109
 
124
110
  Safety: **read** · Authentication: **required**
125
111
 
126
- | Parameter | In | Type | Required | Description |
127
- | --- | --- | --- | --- | --- |
128
- | `projectId` | path | `ProjectId` | yes | — |
129
-
130
- Returns: `Project`
131
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
112
+ Returns Project-owned fields only. List Targets separately for Target and Delivery data.
132
113
 
133
- <details>
134
- <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. |
135
117
 
136
- ```json
137
- {
138
- "project_id": "prj_4f8k2m7x9q1v6b3n"
139
- }
118
+ ```sh
119
+ typeship projects retrieve prj_4f8k2m7x9q1v6b3n
140
120
  ```
141
121
 
142
- </details>
122
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
143
123
 
144
- ### `client.projects.delete(projectId)`
124
+ Read the full command contract with `typeship docs projects retrieve --json`.
125
+
126
+ ### `typeship projects delete <project_id> [flags]`
145
127
 
146
128
  Delete a project
147
129
 
@@ -149,25 +131,19 @@ Delete a project
149
131
 
150
132
  Safety: **destructive** · Authentication: **required**
151
133
 
152
- | Parameter | In | Type | Required | Description |
134
+ | Argument or flag | In | Type | Required | Description |
153
135
  | --- | --- | --- | --- | --- |
154
- | `projectId` | path | `ProjectId` | yes | — |
155
-
156
- Returns: `DeletedProject`
157
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
158
-
159
- <details>
160
- <summary>Wire arguments (CLI and MCP)</summary>
136
+ | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
161
137
 
162
- ```json
163
- {
164
- "project_id": "prj_4f8k2m7x9q1v6b3n"
165
- }
138
+ ```sh
139
+ typeship projects delete prj_4f8k2m7x9q1v6b3n --force
166
140
  ```
167
141
 
168
- </details>
142
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
169
143
 
170
- ### `client.projects.update(projectId, body)`
144
+ Read the full command contract with `typeship docs projects delete --json`.
145
+
146
+ ### `typeship projects update <project_id> [flags]`
171
147
 
172
148
  Update a project
173
149
 
@@ -175,144 +151,118 @@ Update a project
175
151
 
176
152
  Safety: **write** · Authentication: **required**
177
153
 
178
- | Parameter | In | Type | Required | Description |
154
+ | Argument or flag | In | Type | Required | Description |
179
155
  | --- | --- | --- | --- | --- |
180
- | `projectId` | path | `ProjectId` | yes | — |
181
-
182
- Body: `UpdateProjectRequest` (required)
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. |
183
161
 
184
- Returns: `Project`
185
- Errors: `BadRequestError` (400), `UnauthorizedError` (401), `PaymentRequiredError` (402), `ForbiddenError` (403), `NotFoundError` (404), `UnprocessableEntityError` (422), `RateLimitedError` (429)
162
+ Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
186
163
 
187
- <details>
188
- <summary>Wire arguments (CLI and MCP)</summary>
189
-
190
- ```json
191
- {
192
- "project_id": "prj_4f8k2m7x9q1v6b3n"
193
- }
164
+ ```sh
165
+ typeship projects update prj_4f8k2m7x9q1v6b3n
194
166
  ```
195
167
 
196
- </details>
168
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
169
+
170
+ Read the full command contract with `typeship docs projects update --json`.
197
171
 
198
- ### `client.projects.retrieveDiagnostics(projectId)`
172
+ ### `typeship projects retrieve-diagnostics <project_id> [flags]`
199
173
 
200
174
  Analyze a project's latest Definition Revision
201
175
 
202
176
  `GET /projects/{project_id}/diagnostics`
203
177
 
204
- 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.
205
-
206
178
  Safety: **read** · Authentication: **required**
207
179
 
208
- | Parameter | In | Type | Required | Description |
209
- | --- | --- | --- | --- | --- |
210
- | `projectId` | path | `ProjectId` | yes | — |
211
-
212
- Returns: `DiagnosticReport`
213
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
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.
214
181
 
215
- <details>
216
- <summary>Wire arguments (CLI and MCP)</summary>
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. |
217
185
 
218
- ```json
219
- {
220
- "project_id": "prj_4f8k2m7x9q1v6b3n"
221
- }
186
+ ```sh
187
+ typeship projects retrieve-diagnostics prj_4f8k2m7x9q1v6b3n
222
188
  ```
223
189
 
224
- </details>
190
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
225
191
 
226
- ### `client.projects.refreshDiagnostics(projectId)`
192
+ Read the full command contract with `typeship docs projects retrieve-diagnostics --json`.
193
+
194
+ ### `typeship projects refresh-diagnostics <project_id> [flags]`
227
195
 
228
196
  Refresh a project's Diagnostics from its configured source
229
197
 
230
198
  `POST /projects/{project_id}/diagnostics`
231
199
 
232
- 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.
233
-
234
200
  Safety: **write** · Authentication: **required**
235
201
 
236
- | Parameter | In | Type | Required | Description |
237
- | --- | --- | --- | --- | --- |
238
- | `projectId` | path | `ProjectId` | yes | — |
239
-
240
- Returns: `DiagnosticReport`
241
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `UnprocessableEntityError` (422), `RateLimitedError` (429)
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.
242
203
 
243
- <details>
244
- <summary>Wire arguments (CLI and MCP)</summary>
204
+ | Argument or flag | In | Type | Required | Description |
205
+ | --- | --- | --- | --- | --- |
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. |
245
208
 
246
- ```json
247
- {
248
- "project_id": "prj_4f8k2m7x9q1v6b3n"
249
- }
209
+ ```sh
210
+ typeship projects refresh-diagnostics prj_4f8k2m7x9q1v6b3n
250
211
  ```
251
212
 
252
- </details>
213
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
253
214
 
254
- ### `client.projects.remediateDiagnostics(projectId, body)`
215
+ Read the full command contract with `typeship docs projects refresh-diagnostics --json`.
216
+
217
+ ### `typeship projects remediate-diagnostics <project_id> [flags]`
255
218
 
256
219
  Apply exact, reviewed diagnostic remediations
257
220
 
258
221
  `POST /projects/{project_id}/diagnostics/remediations`
259
222
 
260
- 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.
261
-
262
223
  Safety: **write** · Authentication: **required**
263
224
 
264
- | Parameter | In | Type | Required | Description |
265
- | --- | --- | --- | --- | --- |
266
- | `projectId` | path | `ProjectId` | yes | — |
267
-
268
- Body: `DiagnosticRemediationRequest` (required)
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.
269
226
 
270
- Returns: `DiagnosticRemediation`
271
- Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `UnprocessableEntityError` (422), `RateLimitedError` (429)
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. |
272
232
 
273
- <details>
274
- <summary>Wire arguments (CLI and MCP)</summary>
233
+ Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
275
234
 
276
- ```json
277
- {
278
- "project_id": "prj_4f8k2m7x9q1v6b3n",
279
- "diagnostic_ids": [
280
- "value"
281
- ]
282
- }
235
+ ```sh
236
+ typeship projects remediate-diagnostics prj_4f8k2m7x9q1v6b3n --diagnostic-ids '["value"]'
283
237
  ```
284
238
 
285
- </details>
239
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
240
+
241
+ Read the full command contract with `typeship docs projects remediate-diagnostics --json`.
286
242
 
287
- ### `client.projects.retrieveIntegrationHealth(projectId)`
243
+ ### `typeship projects retrieve-integration-health <project_id> [flags]`
288
244
 
289
245
  Diagnose a project's repository integrations
290
246
 
291
247
  `GET /projects/{project_id}/integration-health`
292
248
 
293
- 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.
294
-
295
249
  Safety: **read** · Authentication: **required**
296
250
 
297
- | Parameter | In | Type | Required | Description |
298
- | --- | --- | --- | --- | --- |
299
- | `projectId` | path | `ProjectId` | yes | — |
300
-
301
- Returns: `RepositoryIntegrationHealth`
302
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
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.
303
252
 
304
- <details>
305
- <summary>Wire arguments (CLI and MCP)</summary>
253
+ | Argument or flag | In | Type | Required | Description |
254
+ | --- | --- | --- | --- | --- |
255
+ | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
306
256
 
307
- ```json
308
- {
309
- "project_id": "prj_4f8k2m7x9q1v6b3n"
310
- }
257
+ ```sh
258
+ typeship projects retrieve-integration-health prj_4f8k2m7x9q1v6b3n
311
259
  ```
312
260
 
313
- </details>
261
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
262
+
263
+ Read the full command contract with `typeship docs projects retrieve-integration-health --json`.
314
264
 
315
- ### `client.projects.listGenerations(projectId, params)`
265
+ ### `typeship projects list-generations <project_id> [flags]`
316
266
 
317
267
  List a project's generations
318
268
 
@@ -320,33 +270,29 @@ List a project's generations
320
270
 
321
271
  Safety: **read** · Authentication: **required**
322
272
 
323
- | Parameter | In | Type | Required | Description |
273
+ | Argument or flag | In | Type | Required | Description |
324
274
  | --- | --- | --- | --- | --- |
325
- | `projectId` | path | `ProjectId` | yes | — |
326
- | `limit` | query | `number` | no | Maximum number of resources to return. |
327
- | `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
- | `targetId` | query | `TargetId` | no | Only generations for this persisted Target. |
329
-
330
- Returns: `PagePromise<Generation>` — auto-paginating (`for await` walks every page)
331
- Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
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. |
332
279
 
333
- <details>
334
- <summary>Wire arguments (CLI and MCP)</summary>
335
-
336
- ```json
337
- {
338
- "project_id": "prj_4f8k2m7x9q1v6b3n"
339
- }
280
+ ```sh
281
+ typeship projects list-generations prj_4f8k2m7x9q1v6b3n
340
282
  ```
341
283
 
342
- </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.
285
+
286
+ Read the full command contract with `typeship docs projects list-generations --json`.
343
287
 
344
- ### `client.projects.generate(projectId)`
288
+ ### `typeship projects generate <project_id> [flags]`
345
289
 
346
290
  Generate targets and open pull requests
347
291
 
348
292
  `POST /projects/{project_id}/generations`
349
293
 
294
+ Safety: **write** · Authentication: **required**
295
+
350
296
  Resolves the project's URL or GitHub source, generates every
351
297
  configured delivery package, stores each result in the project's history,
352
298
  and attempts to open a pull request in every configured destination.
@@ -355,29 +301,22 @@ commit, branch, or pull request is created and that generation reports
355
301
  `pr_status: no_changes`. This is the same pipeline automatic
356
302
  regeneration runs after a source change.
357
303
 
358
- Safety: **write** · Authentication: **required**
359
-
360
- | Parameter | In | Type | Required | Description |
304
+ | Argument or flag | In | Type | Required | Description |
361
305
  | --- | --- | --- | --- | --- |
362
- | `projectId` | path | `ProjectId` | yes | — |
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. |
363
308
 
364
- Returns: `GenerationBatch`
365
- Errors: `UnauthorizedError` (401), `PaymentRequiredError` (402), `ForbiddenError` (403), `NotFoundError` (404), `UnprocessableEntityError` (422), `RateLimitedError` (429), `InternalServerError` (500)
366
-
367
- <details>
368
- <summary>Wire arguments (CLI and MCP)</summary>
369
-
370
- ```json
371
- {
372
- "project_id": "prj_4f8k2m7x9q1v6b3n"
373
- }
309
+ ```sh
310
+ typeship projects generate prj_4f8k2m7x9q1v6b3n
374
311
  ```
375
312
 
376
- </details>
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`.
377
316
 
378
317
  ## definitions
379
318
 
380
- ### `client.definitions.retrieve(definitionId)`
319
+ ### `typeship definitions retrieve <definition_id> [flags]`
381
320
 
382
321
  Retrieve a Definition
383
322
 
@@ -385,57 +324,50 @@ Retrieve a Definition
385
324
 
386
325
  Safety: **read** · Authentication: **required**
387
326
 
388
- | Parameter | In | Type | Required | Description |
327
+ | Argument or flag | In | Type | Required | Description |
389
328
  | --- | --- | --- | --- | --- |
390
- | `definitionId` | path | `DefinitionId` | yes | — |
391
-
392
- Returns: `Definition`
393
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
329
+ | `<definition_id>` | path | `string` | yes | — |
394
330
 
395
- <details>
396
- <summary>Wire arguments (CLI and MCP)</summary>
397
-
398
- ```json
399
- {
400
- "definition_id": "def_2p8m4q7k1v9d6h3c"
401
- }
331
+ ```sh
332
+ typeship definitions retrieve def_2p8m4q7k1v9d6h3c
402
333
  ```
403
334
 
404
- </details>
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`.
405
338
 
406
- ### `client.definitions.update(definitionId, body)`
339
+ ### `typeship definitions update <definition_id> [flags]`
407
340
 
408
341
  Update and resolve a Definition
409
342
 
410
343
  `PATCH /definitions/{definition_id}`
411
344
 
412
- Resolves the complete document graph and records a new immutable revision before saving.
413
-
414
345
  Safety: **write** · Authentication: **required**
415
346
 
416
- | Parameter | In | Type | Required | Description |
417
- | --- | --- | --- | --- | --- |
418
- | `definitionId` | path | `DefinitionId` | yes | — |
419
-
420
- Body: `DefinitionUpdateRequest` (required)
347
+ Resolves the complete document graph and records a new immutable revision before saving.
421
348
 
422
- Returns: `Definition`
423
- Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `UnprocessableEntityError` (422), `RateLimitedError` (429)
349
+ | Argument or flag | In | Type | Required | Description |
350
+ | --- | --- | --- | --- | --- |
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. |
424
357
 
425
- <details>
426
- <summary>Wire arguments (CLI and MCP)</summary>
358
+ Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
427
359
 
428
- ```json
429
- {
430
- "definition_id": "def_2p8m4q7k1v9d6h3c"
431
- }
360
+ ```sh
361
+ typeship definitions update def_2p8m4q7k1v9d6h3c
432
362
  ```
433
363
 
434
- </details>
364
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
365
+
366
+ Read the full command contract with `typeship docs definitions update --json`.
435
367
 
436
368
  ## targets
437
369
 
438
- ### `client.targets.list(projectId, params)`
370
+ ### `typeship targets list <project_id> [flags]`
439
371
 
440
372
  List a project's Targets
441
373
 
@@ -443,60 +375,55 @@ List a project's Targets
443
375
 
444
376
  Safety: **read** · Authentication: **required**
445
377
 
446
- | Parameter | In | Type | Required | Description |
378
+ | Argument or flag | In | Type | Required | Description |
447
379
  | --- | --- | --- | --- | --- |
448
- | `projectId` | path | `ProjectId` | yes | — |
449
- | `limit` | query | `number` | no | Maximum number of resources to return. |
450
- | `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. |
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. |
451
383
 
452
- Returns: `PagePromise<Target>` — auto-paginating (`for await` walks every page)
453
- Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
454
-
455
- <details>
456
- <summary>Wire arguments (CLI and MCP)</summary>
457
-
458
- ```json
459
- {
460
- "project_id": "prj_4f8k2m7x9q1v6b3n"
461
- }
384
+ ```sh
385
+ typeship targets list prj_4f8k2m7x9q1v6b3n
462
386
  ```
463
387
 
464
- </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.
465
389
 
466
- ### `client.targets.create(projectId, body)`
390
+ Read the full command contract with `typeship docs targets list --json`.
391
+
392
+ ### `typeship targets create <project_id> [flags]`
467
393
 
468
394
  Create an independently configured Target
469
395
 
470
396
  `POST /projects/{project_id}/targets`
471
397
 
472
- Several Targets may use the same generator with distinct configuration, Deliveries, and release streams.
473
-
474
398
  Safety: **write** · Authentication: **required**
475
399
 
476
- | Parameter | In | Type | Required | Description |
477
- | --- | --- | --- | --- | --- |
478
- | `projectId` | path | `ProjectId` | yes | — |
479
-
480
- Body: `TargetFields` (required)
481
-
482
- Returns: `TargetResponse`
483
- Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `ConflictError` (409), `UnprocessableEntityError` (422), `RateLimitedError` (429)
484
-
485
- <details>
486
- <summary>Wire arguments (CLI and MCP)</summary>
400
+ Several Targets may use the same generator with distinct configuration, Deliveries, and release streams.
487
401
 
488
- ```json
489
- {
490
- "project_id": "prj_4f8k2m7x9q1v6b3n",
491
- "name": "example",
492
- "definition_id": "def_2p8m4q7k1v9d6h3c",
493
- "generator": "typescript-sdk"
494
- }
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
495
420
  ```
496
421
 
497
- </details>
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`.
498
425
 
499
- ### `client.targets.retrieve(targetId)`
426
+ ### `typeship targets retrieve <target_id> [flags]`
500
427
 
501
428
  Retrieve a Target
502
429
 
@@ -504,53 +431,41 @@ Retrieve a Target
504
431
 
505
432
  Safety: **read** · Authentication: **required**
506
433
 
507
- | Parameter | In | Type | Required | Description |
434
+ | Argument or flag | In | Type | Required | Description |
508
435
  | --- | --- | --- | --- | --- |
509
- | `targetId` | path | `TargetId` | yes | — |
510
-
511
- Returns: `TargetResponse`
512
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
436
+ | `<target_id>` | path | `string` | yes | — |
513
437
 
514
- <details>
515
- <summary>Wire arguments (CLI and MCP)</summary>
516
-
517
- ```json
518
- {
519
- "target_id": "tgt_5m8q2v7k1p9d4h6c"
520
- }
438
+ ```sh
439
+ typeship targets retrieve tgt_5m8q2v7k1p9d4h6c
521
440
  ```
522
441
 
523
- </details>
442
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
443
+
444
+ Read the full command contract with `typeship docs targets retrieve --json`.
524
445
 
525
- ### `client.targets.delete(targetId)`
446
+ ### `typeship targets delete <target_id> [flags]`
526
447
 
527
448
  Delete an unused Target
528
449
 
529
450
  `DELETE /targets/{target_id}`
530
451
 
531
- Targets with Generation or release history, or an active release candidate, must be disabled instead.
532
-
533
452
  Safety: **destructive** · Authentication: **required**
534
453
 
535
- | Parameter | In | Type | Required | Description |
536
- | --- | --- | --- | --- | --- |
537
- | `targetId` | path | `TargetId` | yes | — |
538
-
539
- Returns: `DeletedTarget`
540
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `ConflictError` (409), `RateLimitedError` (429)
454
+ Targets with Generation or release history, or an active release candidate, must be disabled instead.
541
455
 
542
- <details>
543
- <summary>Wire arguments (CLI and MCP)</summary>
456
+ | Argument or flag | In | Type | Required | Description |
457
+ | --- | --- | --- | --- | --- |
458
+ | `<target_id>` | path | `string` | yes | — |
544
459
 
545
- ```json
546
- {
547
- "target_id": "tgt_5m8q2v7k1p9d4h6c"
548
- }
460
+ ```sh
461
+ typeship targets delete tgt_5m8q2v7k1p9d4h6c --force
549
462
  ```
550
463
 
551
- </details>
464
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
465
+
466
+ Read the full command contract with `typeship docs targets delete --json`.
552
467
 
553
- ### `client.targets.update(targetId, body)`
468
+ ### `typeship targets update <target_id> [flags]`
554
469
 
555
470
  Update a Target, its Deliveries, or its next reviewed version
556
471
 
@@ -558,55 +473,125 @@ Update a Target, its Deliveries, or its next reviewed version
558
473
 
559
474
  Safety: **write** · Authentication: **required**
560
475
 
561
- | Parameter | In | Type | Required | Description |
476
+ | Argument or flag | In | Type | Required | Description |
562
477
  | --- | --- | --- | --- | --- |
563
- | `targetId` | path | `TargetId` | yes | — |
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
+ ```
564
492
 
565
- Body: `TargetUpdateRequest` (required)
493
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
566
494
 
567
- Returns: `TargetResponse`
568
- Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `ConflictError` (409), `UnprocessableEntityError` (422), `RateLimitedError` (429)
495
+ Read the full command contract with `typeship docs targets update --json`.
569
496
 
570
- <details>
571
- <summary>Wire arguments (CLI and MCP)</summary>
497
+ ### `typeship targets list-releases <target_id> [flags]`
572
498
 
573
- ```json
574
- {
575
- "target_id": "tgt_5m8q2v7k1p9d4h6c"
576
- }
499
+ List immutable releases for a Target
500
+
501
+ `GET /targets/{target_id}/releases`
502
+
503
+ Safety: **read** · Authentication: **required**
504
+
505
+ | Argument or flag | In | Type | Required | Description |
506
+ | --- | --- | --- | --- | --- |
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. |
510
+
511
+ ```sh
512
+ typeship targets list-releases tgt_5m8q2v7k1p9d4h6c
577
513
  ```
578
514
 
579
- </details>
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.
580
516
 
581
- ### `client.targets.listReleases(targetId, params)`
517
+ Read the full command contract with `typeship docs targets list-releases --json`.
582
518
 
583
- List immutable releases for a Target
519
+ ### `typeship targets retrieve-draft <target_id> [flags]`
584
520
 
585
- `GET /targets/{target_id}/releases`
521
+ Retrieve a Target's rolling Draft release
522
+
523
+ `GET /targets/{target_id}/draft`
586
524
 
587
525
  Safety: **read** · Authentication: **required**
588
526
 
589
- | Parameter | In | Type | Required | Description |
527
+ Returns Current, the cumulative Draft version and readiness, its exact head, and the optimistic release revision.
528
+
529
+ | Argument or flag | In | Type | Required | Description |
530
+ | --- | --- | --- | --- | --- |
531
+ | `<target_id>` | path | `string` | yes | — |
532
+
533
+ ```sh
534
+ typeship targets retrieve-draft tgt_5m8q2v7k1p9d4h6c
535
+ ```
536
+
537
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
538
+
539
+ Read the full command contract with `typeship docs targets retrieve-draft --json`.
540
+
541
+ ### `typeship targets update-draft <target_id> [flags]`
542
+
543
+ Select an exact Draft version or return to automatic versioning
544
+
545
+ `PATCH /targets/{target_id}/draft`
546
+
547
+ Safety: **write** · Authentication: **required**
548
+
549
+ Validates the selection against the cumulative required bump and regenerates the same rolling Draft pull request.
550
+
551
+ | Argument or flag | In | Type | Required | Description |
590
552
  | --- | --- | --- | --- | --- |
591
- | `targetId` | path | `TargetId` | yes | — |
592
- | `limit` | query | `number` | no | Maximum number of resources to return. |
593
- | `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. |
553
+ | `<target_id>` | path | `string` | yes | — |
554
+ | `--body-version` | body | `string` | yes | Exact SemVer, or null to return to automatic selection. |
555
+ | `--expected-revision` | body | `number` | no | — |
556
+
557
+ Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
558
+
559
+ ```sh
560
+ typeship targets update-draft tgt_5m8q2v7k1p9d4h6c --body-version 1.0.0
561
+ ```
562
+
563
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
564
+
565
+ Read the full command contract with `typeship docs targets update-draft --json`.
594
566
 
595
- Returns: `PagePromise<TargetRelease>` — auto-paginating (`for await` walks every page)
596
- Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
567
+ ### `typeship targets adopt-release <target_id> [flags]`
597
568
 
598
- <details>
599
- <summary>Wire arguments (CLI and MCP)</summary>
569
+ Adopt a verified existing package as Current
600
570
 
601
- ```json
602
- {
603
- "target_id": "tgt_5m8q2v7k1p9d4h6c"
604
- }
571
+ `POST /targets/{target_id}/adopt`
572
+
573
+ Safety: **write** · Authentication: **required**
574
+
575
+ Verifies the repository tag, package metadata, and registry artifact; records an Imported Current release; then opens the first Typeship Draft at the next major version because no trusted generated baseline exists yet.
576
+
577
+ | Argument or flag | In | Type | Required | Description |
578
+ | --- | --- | --- | --- | --- |
579
+ | `<target_id>` | path | `string` | yes | — |
580
+ | `--body-version` | body | `string` | yes | Exact already-published package version to make Current. |
581
+ | `--tag` | body | `string` | yes | Immutable repository tag containing the matching package source. |
582
+ | `--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. |
583
+
584
+ Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
585
+
586
+ ```sh
587
+ typeship targets adopt-release tgt_5m8q2v7k1p9d4h6c --body-version 1.0.0 --tag value
605
588
  ```
606
589
 
607
- </details>
590
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
608
591
 
609
- ### `client.targets.retrieveRelease(targetReleaseId)`
592
+ Read the full command contract with `typeship docs targets adopt-release --json`.
593
+
594
+ ### `typeship targets retrieve-release <target_release_id> [flags]`
610
595
 
611
596
  Retrieve an immutable Target release
612
597
 
@@ -614,173 +599,159 @@ Retrieve an immutable Target release
614
599
 
615
600
  Safety: **read** · Authentication: **required**
616
601
 
617
- | Parameter | In | Type | Required | Description |
602
+ | Argument or flag | In | Type | Required | Description |
618
603
  | --- | --- | --- | --- | --- |
619
- | `targetReleaseId` | path | `TargetReleaseId` | yes | — |
604
+ | `<target_release_id>` | path | `string` | yes | — |
605
+
606
+ ```sh
607
+ typeship targets retrieve-release rel_7m2q8v4k1p9d5h6c
608
+ ```
609
+
610
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
611
+
612
+ Read the full command contract with `typeship docs targets retrieve-release --json`.
613
+
614
+ ### `typeship targets republish-release <target_release_id> [flags]`
620
615
 
621
- Returns: `TargetReleaseResponse`
622
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
616
+ Retry publication of an exact Target release
623
617
 
624
- <details>
625
- <summary>Wire arguments (CLI and MCP)</summary>
618
+ `POST /target_releases/{target_release_id}/republish`
626
619
 
627
- ```json
628
- {
629
- "target_release_id": "rel_7m2q8v4k1p9d5h6c"
630
- }
620
+ Safety: **write** · Authentication: **required**
621
+
622
+ Dispatches the repository-owned republish workflow for this immutable version and accepted commit. It never selects the latest Draft or release.
623
+
624
+ | Argument or flag | In | Type | Required | Description |
625
+ | --- | --- | --- | --- | --- |
626
+ | `<target_release_id>` | path | `string` | yes | — |
627
+ | `--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. |
628
+
629
+ ```sh
630
+ typeship targets republish-release rel_7m2q8v4k1p9d5h6c
631
631
  ```
632
632
 
633
- </details>
633
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
634
+
635
+ Read the full command contract with `typeship docs targets republish-release --json`.
634
636
 
635
637
  ## generations
636
638
 
637
- ### `client.generations.retrieve(generationId)`
639
+ ### `typeship generations retrieve <generation_id> [flags]`
638
640
 
639
641
  Retrieve a generation
640
642
 
641
643
  `GET /generations/{generation_id}`
642
644
 
643
- Includes the generated files when the generation succeeded.
644
-
645
645
  Safety: **read** · Authentication: **required**
646
646
 
647
- | Parameter | In | Type | Required | Description |
648
- | --- | --- | --- | --- | --- |
649
- | `generationId` | path | `GenerationId` | yes | — |
650
-
651
- Returns: `GenerationResponse`
652
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
647
+ Includes the generated files when the generation succeeded.
653
648
 
654
- <details>
655
- <summary>Wire arguments (CLI and MCP)</summary>
649
+ | Argument or flag | In | Type | Required | Description |
650
+ | --- | --- | --- | --- | --- |
651
+ | `<generation_id>` | path | `string` | yes | — |
656
652
 
657
- ```json
658
- {
659
- "generation_id": "gen_7h2p5d9c3m8w1k6q"
660
- }
653
+ ```sh
654
+ typeship generations retrieve gen_7h2p5d9c3m8w1k6q
661
655
  ```
662
656
 
663
- </details>
657
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
658
+
659
+ Read the full command contract with `typeship docs generations retrieve --json`.
664
660
 
665
- ### `client.generations.retrieveFile(generationId, params)`
661
+ ### `typeship generations retrieve-file <generation_id> [flags]`
666
662
 
667
663
  Fetch one file from a generation
668
664
 
669
665
  `GET /generations/{generation_id}/file`
670
666
 
671
- Raw file content, for generations whose target was too large to inline (files_omitted true). The generation's files_index lists valid paths.
672
-
673
667
  Safety: **read** · Authentication: **required**
674
668
 
675
- | Parameter | In | Type | Required | Description |
676
- | --- | --- | --- | --- | --- |
677
- | `generationId` | path | `GenerationId` | yes | — |
678
- | `path` | query | `string` | yes | Repo-relative path inside the generated package. |
679
-
680
- Returns: `string`
681
- Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
669
+ Raw file content, for generations whose target was too large to inline (files_omitted true). The generation's files_index lists valid paths.
682
670
 
683
- <details>
684
- <summary>Wire arguments (CLI and MCP)</summary>
671
+ | Argument or flag | In | Type | Required | Description |
672
+ | --- | --- | --- | --- | --- |
673
+ | `<generation_id>` | path | `string` | yes | — |
674
+ | `--path` | query | `string` | yes | Repo-relative path inside the generated package. |
685
675
 
686
- ```json
687
- {
688
- "generation_id": "gen_7h2p5d9c3m8w1k6q",
689
- "path": "openapi.yaml"
690
- }
676
+ ```sh
677
+ typeship generations retrieve-file gen_7h2p5d9c3m8w1k6q --path openapi.yaml
691
678
  ```
692
679
 
693
- </details>
680
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
681
+
682
+ Read the full command contract with `typeship docs generations retrieve-file --json`.
694
683
 
695
684
  ## definitionRevisions
696
685
 
697
- ### `client.definitionRevisions.list(definitionId, params)`
686
+ ### `typeship definition-revisions list <definition_id> [flags]`
698
687
 
699
688
  List Definition Revisions
700
689
 
701
690
  `GET /definitions/{definition_id}/revisions`
702
691
 
703
- 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.
704
-
705
692
  Safety: **read** · Authentication: **required**
706
693
 
707
- | Parameter | In | Type | Required | Description |
708
- | --- | --- | --- | --- | --- |
709
- | `definitionId` | path | `DefinitionId` | yes | — |
710
- | `limit` | query | `number` | no | Maximum number of resources to return. |
711
- | `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. |
712
-
713
- Returns: `PagePromise<DefinitionRevision>` — auto-paginating (`for await` walks every page)
714
- Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
694
+ 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.
715
695
 
716
- <details>
717
- <summary>Wire arguments (CLI and MCP)</summary>
696
+ | Argument or flag | In | Type | Required | Description |
697
+ | --- | --- | --- | --- | --- |
698
+ | `<definition_id>` | path | `string` | yes | — |
699
+ | `--limit` | query | `number` | no | Maximum number of resources to return. Default: 20. |
700
+ | `--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. |
718
701
 
719
- ```json
720
- {
721
- "definition_id": "def_2p8m4q7k1v9d6h3c"
722
- }
702
+ ```sh
703
+ typeship definition-revisions list def_2p8m4q7k1v9d6h3c
723
704
  ```
724
705
 
725
- </details>
706
+ 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.
726
707
 
727
- ### `client.definitionRevisions.retrieve(definitionRevisionId)`
708
+ Read the full command contract with `typeship docs definition-revisions list --json`.
709
+
710
+ ### `typeship definition-revisions retrieve <definition_revision_id> [flags]`
728
711
 
729
712
  Retrieve a Definition Revision
730
713
 
731
714
  `GET /definition_revisions/{definition_revision_id}`
732
715
 
733
- Metadata for one immutable resolved document graph. Fetch its canonical content or individual source documents from the content endpoints.
734
-
735
716
  Safety: **read** · Authentication: **required**
736
717
 
737
- | Parameter | In | Type | Required | Description |
738
- | --- | --- | --- | --- | --- |
739
- | `definitionRevisionId` | path | `DefinitionRevisionId` | yes | — |
740
-
741
- Returns: `DefinitionRevisionResponse`
742
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
718
+ Metadata for one immutable resolved document graph. Fetch its canonical content or individual source documents from the content endpoints.
743
719
 
744
- <details>
745
- <summary>Wire arguments (CLI and MCP)</summary>
720
+ | Argument or flag | In | Type | Required | Description |
721
+ | --- | --- | --- | --- | --- |
722
+ | `<definition_revision_id>` | path | `string` | yes | — |
746
723
 
747
- ```json
748
- {
749
- "definition_revision_id": "drev_6m1q8v4k2p9d7h3c"
750
- }
724
+ ```sh
725
+ typeship definition-revisions retrieve drev_6m1q8v4k2p9d7h3c
751
726
  ```
752
727
 
753
- </details>
728
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
754
729
 
755
- ### `client.definitionRevisions.retrieveContent(definitionRevisionId)`
730
+ Read the full command contract with `typeship docs definition-revisions retrieve --json`.
731
+
732
+ ### `typeship definition-revisions retrieve-content <definition_revision_id> [flags]`
756
733
 
757
734
  Retrieve a Definition Revision's canonical content
758
735
 
759
736
  `GET /definition_revisions/{definition_revision_id}/content`
760
737
 
761
- Returns the exact canonical resolved content identified by the revision's graph digest, suitable for saving or piping into a diff.
762
-
763
738
  Safety: **read** · Authentication: **required**
764
739
 
765
- | Parameter | In | Type | Required | Description |
766
- | --- | --- | --- | --- | --- |
767
- | `definitionRevisionId` | path | `DefinitionRevisionId` | yes | — |
768
-
769
- Returns: `string`
770
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
740
+ Returns the exact canonical resolved content identified by the revision's graph digest, suitable for saving or piping into a diff.
771
741
 
772
- <details>
773
- <summary>Wire arguments (CLI and MCP)</summary>
742
+ | Argument or flag | In | Type | Required | Description |
743
+ | --- | --- | --- | --- | --- |
744
+ | `<definition_revision_id>` | path | `string` | yes | — |
774
745
 
775
- ```json
776
- {
777
- "definition_revision_id": "drev_6m1q8v4k2p9d7h3c"
778
- }
746
+ ```sh
747
+ typeship definition-revisions retrieve-content drev_6m1q8v4k2p9d7h3c
779
748
  ```
780
749
 
781
- </details>
750
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
751
+
752
+ Read the full command contract with `typeship docs definition-revisions retrieve-content --json`.
782
753
 
783
- ### `client.definitionRevisions.retrieveDocumentContent(definitionRevisionId, documentId)`
754
+ ### `typeship definition-revisions retrieve-document-content <definition_revision_id> <document_id> [flags]`
784
755
 
785
756
  Retrieve one source document from a Definition Revision
786
757
 
@@ -788,104 +759,83 @@ Retrieve one source document from a Definition Revision
788
759
 
789
760
  Safety: **read** · Authentication: **required**
790
761
 
791
- | Parameter | In | Type | Required | Description |
762
+ | Argument or flag | In | Type | Required | Description |
792
763
  | --- | --- | --- | --- | --- |
793
- | `definitionRevisionId` | path | `DefinitionRevisionId` | yes | — |
794
- | `documentId` | path | `DefinitionDocumentId` | yes | — |
795
-
796
- Returns: `string`
797
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
798
-
799
- <details>
800
- <summary>Wire arguments (CLI and MCP)</summary>
764
+ | `<definition_revision_id>` | path | `string` | yes | — |
765
+ | `<document_id>` | path | `string` | yes | — |
801
766
 
802
- ```json
803
- {
804
- "definition_revision_id": "drev_6m1q8v4k2p9d7h3c",
805
- "document_id": "doc_8q2m5v1k9p4d7h3c"
806
- }
767
+ ```sh
768
+ typeship definition-revisions retrieve-document-content drev_6m1q8v4k2p9d7h3c doc_8q2m5v1k9p4d7h3c
807
769
  ```
808
770
 
809
- </details>
771
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
772
+
773
+ Read the full command contract with `typeship docs definition-revisions retrieve-document-content --json`.
810
774
 
811
775
  ## account
812
776
 
813
- ### `client.account.retrieve()`
777
+ ### `typeship account retrieve [flags]`
814
778
 
815
779
  The account behind the presented credentials
816
780
 
817
781
  `GET /me`
818
782
 
819
- Returns the account that owns the presented API key. This is also the
820
- identity endpoint the generated typeship CLI's `whoami` calls.
821
-
822
783
  Safety: **read** · Authentication: **required**
823
784
 
824
- Returns: `Account`
825
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `RateLimitedError` (429)
826
-
827
- <details>
828
- <summary>Wire arguments (CLI and MCP)</summary>
785
+ Returns the account that owns the presented API key. This is also the
786
+ identity endpoint the generated typeship CLI's `whoami` calls.
829
787
 
830
- ```json
831
- {}
788
+ ```sh
789
+ typeship account retrieve
832
790
  ```
833
791
 
834
- </details>
792
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
793
+
794
+ Read the full command contract with `typeship docs account retrieve --json`.
835
795
 
836
796
  ## apiKeys
837
797
 
838
- ### `client.apiKeys.list(params)`
798
+ ### `typeship api-keys list [flags]`
839
799
 
840
800
  List API keys
841
801
 
842
802
  `GET /api_keys`
843
803
 
844
- 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.
845
-
846
804
  Safety: **read** · Authentication: **required**
847
805
 
848
- | Parameter | In | Type | Required | Description |
849
- | --- | --- | --- | --- | --- |
850
- | `limit` | query | `number` | no | Maximum number of resources to return. |
851
- | `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. |
852
-
853
- Returns: `PagePromise<ApiKey>` — auto-paginating (`for await` walks every page)
854
- Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `RateLimitedError` (429)
806
+ 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.
855
807
 
856
- <details>
857
- <summary>Wire arguments (CLI and MCP)</summary>
808
+ | Argument or flag | In | Type | Required | Description |
809
+ | --- | --- | --- | --- | --- |
810
+ | `--limit` | query | `number` | no | Maximum number of resources to return. Default: 20. |
811
+ | `--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. |
858
812
 
859
- ```json
860
- {}
813
+ ```sh
814
+ typeship api-keys list
861
815
  ```
862
816
 
863
- </details>
817
+ 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.
818
+
819
+ Read the full command contract with `typeship docs api-keys list --json`.
864
820
 
865
- ### `client.apiKeys.revoke(apiKeyId)`
821
+ ### `typeship api-keys revoke <api_key_id> [flags]`
866
822
 
867
823
  Revoke an API key
868
824
 
869
825
  `DELETE /api_keys/{api_key_id}`
870
826
 
871
- 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.
872
-
873
827
  Safety: **destructive** · Authentication: **required**
874
828
 
875
- | Parameter | In | Type | Required | Description |
876
- | --- | --- | --- | --- | --- |
877
- | `apiKeyId` | path | `string` | yes | — |
878
-
879
- Returns: `ApiKeyResponse`
880
- Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
829
+ 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.
881
830
 
882
- <details>
883
- <summary>Wire arguments (CLI and MCP)</summary>
831
+ | Argument or flag | In | Type | Required | Description |
832
+ | --- | --- | --- | --- | --- |
833
+ | `<api_key_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via api_keys_list). IDs come from api_keys_list. |
884
834
 
885
- ```json
886
- {
887
- "api_key_id": "api_key_123"
888
- }
835
+ ```sh
836
+ typeship api-keys revoke api_key_123 --force
889
837
  ```
890
838
 
891
- </details>
839
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
840
+
841
+ Read the full command contract with `typeship docs api-keys revoke --json`.