@typeship-ax/cli 0.10.0 → 0.20.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 (70) hide show
  1. package/AGENTS.md +9 -4
  2. package/README.md +4 -4
  3. package/api.json +4829 -679
  4. package/api.md +387 -91
  5. package/dist/cli-agent.d.ts +5 -5
  6. package/dist/cli-agent.d.ts.map +1 -1
  7. package/dist/cli-agent.js +14 -10
  8. package/dist/cli.js +151 -75
  9. package/dist/core/http.d.ts +3 -2
  10. package/dist/core/http.d.ts.map +1 -1
  11. package/dist/core/http.js +18 -6
  12. package/dist/errors.d.ts +17 -10
  13. package/dist/errors.d.ts.map +1 -1
  14. package/dist/errors.js +24 -15
  15. package/dist/index.d.ts +7 -3
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +9 -5
  18. package/dist/ops.d.ts +4 -0
  19. package/dist/ops.d.ts.map +1 -1
  20. package/dist/ops.js +45 -35
  21. package/dist/polling-login.d.ts.map +1 -1
  22. package/dist/polling-login.js +11 -1
  23. package/dist/resources/account.d.ts +4 -4
  24. package/dist/resources/account.d.ts.map +1 -1
  25. package/dist/resources/account.js +10 -5
  26. package/dist/resources/api-keys.d.ts +40 -14
  27. package/dist/resources/api-keys.d.ts.map +1 -1
  28. package/dist/resources/api-keys.js +45 -13
  29. package/dist/resources/definition-revisions.d.ts +35 -18
  30. package/dist/resources/definition-revisions.d.ts.map +1 -1
  31. package/dist/resources/definition-revisions.js +43 -15
  32. package/dist/resources/definitions.d.ts +21 -6
  33. package/dist/resources/definitions.d.ts.map +1 -1
  34. package/dist/resources/definitions.js +16 -3
  35. package/dist/resources/generate.d.ts +44 -15
  36. package/dist/resources/generate.d.ts.map +1 -1
  37. package/dist/resources/generate.js +55 -13
  38. package/dist/resources/generations.d.ts +14 -6
  39. package/dist/resources/generations.d.ts.map +1 -1
  40. package/dist/resources/generations.js +26 -5
  41. package/dist/resources/projects.d.ts +106 -53
  42. package/dist/resources/projects.d.ts.map +1 -1
  43. package/dist/resources/projects.js +78 -31
  44. package/dist/resources/targets.d.ts +240 -40
  45. package/dist/resources/targets.d.ts.map +1 -1
  46. package/dist/resources/targets.js +307 -21
  47. package/dist/schemas.d.ts +1 -0
  48. package/dist/schemas.d.ts.map +1 -1
  49. package/dist/schemas.js +171 -111
  50. package/dist/types.d.ts +1969 -154
  51. package/dist/types.d.ts.map +1 -1
  52. package/dist/types.js +87 -3
  53. package/package.json +3 -3
  54. package/src/cli-agent.ts +17 -13
  55. package/src/cli.ts +138 -70
  56. package/src/core/http.ts +17 -6
  57. package/src/errors.ts +25 -15
  58. package/src/index.ts +9 -5
  59. package/src/ops.ts +49 -35
  60. package/src/polling-login.ts +10 -1
  61. package/src/resources/account.ts +11 -4
  62. package/src/resources/api-keys.ts +84 -13
  63. package/src/resources/definition-revisions.ts +74 -16
  64. package/src/resources/definitions.ts +28 -4
  65. package/src/resources/generate.ts +78 -13
  66. package/src/resources/generations.ts +31 -4
  67. package/src/resources/projects.ts +141 -39
  68. package/src/resources/targets.ts +561 -27
  69. package/src/schemas.ts +172 -112
  70. package/src/types.ts +2105 -154
package/api.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # typeship — CLI reference
2
2
 
3
- API version 1.0.0. Package version 0.10.0. Generated by typeship; regenerate rather than editing.
3
+ API version 1.0.0. Package version 0.20.0. Generated by typeship.
4
4
 
5
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
 
@@ -14,40 +14,66 @@ For complete input and output schemas, use [`api.json`](./api.json), the machine
14
14
 
15
15
  ### `typeship generate run [flags]`
16
16
 
17
- Generate one Target from a Definition
17
+ Generate one package from a Definition
18
18
 
19
19
  `POST /generate`
20
20
 
21
21
  Safety: **write** · Authentication: **optional**
22
22
 
23
- Stateless generation: nothing is stored. Returns the full generated
24
- package as files. Works without an API key: anonymous calls generate
25
- the first 25 operations, rate limited per IP address, and the
26
- response's `limits` object says what was held back and where to lift
27
- it; anonymous calls from a Definition URL also carry `claim.url`, a link
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
29
- paid plans generate the complete Definition. A present but invalid key is a
30
- 401, not a downgrade to anonymous.
23
+ Returns one generated package without creating a Project.
24
+
25
+ Supports [idempotent retries](https://typeship.dev/docs/typeship-api/idempotency); keyed responses include generated files in the replay cache.
26
+
27
+ Use `download.url` to save the complete ZIP, verify `download.sha256`, and extract it into an empty directory. The link expires at `download.expires_at` and grants access to anyone who has it. CLI, MCP, and SDK calls supply an idempotency key automatically. Agents should request `fields=["download","meta","warnings","limits","claim"]` to keep the MCP result compact; files can exceed the response limit. Download the ZIP instead of repeating generation to retrieve omitted files.
28
+
29
+ Anonymous and Free requests include the first 25 operations. Paid plans include all operations. Anonymous requests are rate limited by IP address. Check `limits` for omitted operations; an invalid API key returns `401`.
30
+
31
+ An anonymous URL request without source headers may return `claim.url`. Sign in through that link within seven days to save the recipe as a Project.
31
32
 
32
33
  | Argument or flag | In | Type | Required | Description |
33
34
  | --- | --- | --- | --- | --- |
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. |
35
+ | `--definition` | body | `json` | yes | A Definition for one-shot generation, provided as exactly one URL or inline entrypoint. |
36
+ | `--target` | body | `object` | yes | One-shot generator descriptor; no persisted Target is created. |
36
37
  | `--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. |
38
+ | `--module-path` | body | `string` | no | Go module path override for the generated artifact's own module. Valid only for the Go SDK and Go CLI outputs. Linked projects derive this from the Go destination repository by default. |
39
+ | `--go-sdk` | body | `object` | no | The exact paired Go SDK a go-cli generation is built on. Required when target.generator is go-cli and rejected otherwise. The descriptor is closed and immutable, because a CLI that pins a range or a branch pins nothing. |
40
+ | `--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. One-shot generation also accepts GraphQL settings here; stored projects keep those settings on their Definition. |
41
+ | `--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, If-Match header, and JSON body replays the original response. Reusing the key with changed intent returns 409. After expiry the key starts a new write. |
40
42
 
41
43
  Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
42
44
 
43
45
  ```sh
44
- typeship generate run --definition '{"url":"https://example.com"}' --target '{"generator":"typescript-sdk"}'
46
+ typeship generate run --definition '{"url":"https://typeship.dev/examples/petstore/openapi.yaml"}' --target '{"generator":"cli"}'
45
47
  ```
46
48
 
47
49
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
48
50
 
49
51
  Read the full command contract with `typeship docs generate run --json`.
50
52
 
53
+ ### `typeship generate download-package [flags]`
54
+
55
+ Download a generated package
56
+
57
+ `GET /generate/download`
58
+
59
+ Safety: **read** · Authentication: **none**
60
+
61
+ Download the complete ZIP referenced by `generate_run`'s `download.url`. Pass the token from that URL. No API key is needed; the token grants access only to that exact package until its replay window expires. Keep the token private.
62
+
63
+ The local MCP server saves this binary response to disk. On a hosted MCP connection, download the original URL directly to your workspace. Verify the ZIP against `download.sha256` before extracting it into an empty directory. Expired or invalid tokens return `404`; a new generation creates a new download.
64
+
65
+ | Argument or flag | In | Type | Required | Description |
66
+ | --- | --- | --- | --- | --- |
67
+ | `--query-token` | query | `string` | yes | Private download token from download.url in the generation result. |
68
+
69
+ ```sh
70
+ typeship generate download-package --query-token parcel_download_example_token_1234567890123
71
+ ```
72
+
73
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
74
+
75
+ Read the full command contract with `typeship docs generate download-package --json`.
76
+
51
77
  ## projects
52
78
 
53
79
  ### `typeship projects list [flags]`
@@ -60,8 +86,8 @@ Safety: **read** · Authentication: **required**
60
86
 
61
87
  | Argument or flag | In | Type | Required | Description |
62
88
  | --- | --- | --- | --- | --- |
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. |
89
+ | `--limit` | query | `number` | no | Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400 invalid_request. List query parameters must appear only once; unrecognized parameters also return 400. Default: 20. |
90
+ | `--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. Omit to start at the first page. Empty, malformed, or repeated cursors return 400 invalid_request. The page limit may change between requests. |
65
91
 
66
92
  ```sh
67
93
  typeship projects list
@@ -79,7 +105,9 @@ Create a project
79
105
 
80
106
  Safety: **write** · Authentication: **required**
81
107
 
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.
108
+ Creates a Project from a URL or GitHub Definition.
109
+
110
+ Free includes one saved Project, all selected Targets, and the first 25 operations per Target, with regeneration, history, delivery pull requests, and previews. Pro supports additional Projects and all operations. One-shot generation does not use a Project slot.
83
111
 
84
112
  | Argument or flag | In | Type | Required | Description |
85
113
  | --- | --- | --- | --- | --- |
@@ -89,12 +117,12 @@ Stores a URL- or GitHub-sourced project. Free includes one stored project, every
89
117
  | `--auto-generate` | body | `boolean` | no | Whether Typeship should regenerate automatically when the source changes. Default: false. |
90
118
  | `--relay-enabled` | body | `boolean` | no | Enable webhook relay sessions. Requires the CLI target and Pro. Default: false. |
91
119
  | `--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. |
120
+ | `--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, If-Match header, and JSON body replays the original response. Reusing the key with changed intent returns 409. After expiry the key starts a new write. |
93
121
 
94
122
  Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
95
123
 
96
124
  ```sh
97
- typeship projects create --name example --definition '{"source":{"kind":"url","url":"https://example.com"}}' --targets '[{"name":"example","generator":"typescript-sdk"}]'
125
+ typeship projects create --name 'Parcel API' --definition '{"source":{"kind":"url","url":"https://api.parcel.example/openapi.json"}}' --targets '[{"name":"Parcel CLI","generator":"cli","deliveries":[{"kind":"repository","repository":{"provider":"github","identifier":"parcel-example/parcel-client"},"package_name":"parcel-client","publish_on_merge":false}]}]'
98
126
  ```
99
127
 
100
128
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
@@ -109,7 +137,7 @@ Retrieve a project
109
137
 
110
138
  Safety: **read** · Authentication: **required**
111
139
 
112
- Returns Project-owned fields only. List Targets separately for Target and Delivery data.
140
+ Returns the Project's settings and Definition ID. List its Targets separately to retrieve Target configuration and Deliveries.
113
141
 
114
142
  | Argument or flag | In | Type | Required | Description |
115
143
  | --- | --- | --- | --- | --- |
@@ -131,9 +159,13 @@ Delete a project
131
159
 
132
160
  Safety: **destructive** · Authentication: **required**
133
161
 
162
+ A `502` response means the Project was not deleted because its release pull requests could not be retired. Retry deletion to finish retiring the remaining reviews. Repeating a completed deletion returns `404`.
163
+ See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag and If-Match.
164
+
134
165
  | Argument or flag | In | Type | Required | Description |
135
166
  | --- | --- | --- | --- | --- |
136
167
  | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
168
+ | `--if-match` | header | `string` | no | ETag from a preceding response. The write applies only if the resource still has that version; otherwise it returns 412 precondition_failed without changes. Omit to write the current version. See https://typeship.dev/docs/typeship-api#conditional-writes. |
137
169
 
138
170
  ```sh
139
171
  typeship projects delete prj_4f8k2m7x9q1v6b3n --force
@@ -151,6 +183,13 @@ Update a project
151
183
 
152
184
  Safety: **write** · Authentication: **required**
153
185
 
186
+ Omitted fields keep their current values. A supplied config replaces the entire stored object; null or an empty object clears it.
187
+ Omitting If-Match applies the update to the current resource; with If-Match, a stale ETag returns 412 precondition_failed without saving.
188
+
189
+ A `409 target_busy` means a Target is publishing. Retrieve the Project, wait for publication to finish, reconcile your update, and retry.
190
+ A `502` response means the Project was saved, but an obsolete release pull request could not be retired. Retrieve the Project and retry the same update to finish retiring reviews if that update is still desired.
191
+ See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag and If-Match.
192
+
154
193
  | Argument or flag | In | Type | Required | Description |
155
194
  | --- | --- | --- | --- | --- |
156
195
  | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
@@ -158,11 +197,12 @@ Safety: **write** · Authentication: **required**
158
197
  | `--auto-generate` | body | `boolean` | no | — |
159
198
  | `--relay-enabled` | body | `boolean` | no | Enable webhook relay sessions. Requires the CLI target and Pro. |
160
199
  | `--config` | body | `json` | no | Replaces the Project's shared Target defaults. Send null to clear them. |
200
+ | `--if-match` | header | `string` | no | ETag from a preceding response. The write applies only if the resource still has that version; otherwise it returns 412 precondition_failed without changes. Omit to write the current version. See https://typeship.dev/docs/typeship-api#conditional-writes. |
161
201
 
162
202
  Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
163
203
 
164
204
  ```sh
165
- typeship projects update prj_4f8k2m7x9q1v6b3n
205
+ typeship projects update prj_4f8k2m7x9q1v6b3n --auto-generate true
166
206
  ```
167
207
 
168
208
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
@@ -177,7 +217,7 @@ Analyze a project's latest Definition Revision
177
217
 
178
218
  Safety: **read** · Authentication: **required**
179
219
 
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.
220
+ Checks the latest Definition Revision after applying its saved patches. Each finding groups affected locations under a stable rule ID. A suggested patch is included only when the Definition provides enough information to determine the correction.
181
221
 
182
222
  | Argument or flag | In | Type | Required | Description |
183
223
  | --- | --- | --- | --- | --- |
@@ -199,12 +239,12 @@ Refresh a project's Diagnostics from its configured source
199
239
 
200
240
  Safety: **write** · Authentication: **required**
201
241
 
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
+ Fetches the configured source and returns updated Diagnostics. Creates a Definition Revision only when the content changes. Does not generate Targets or use a metered generation.
203
243
 
204
244
  | Argument or flag | In | Type | Required | Description |
205
245
  | --- | --- | --- | --- | --- |
206
246
  | `<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. |
247
+ | `--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, If-Match header, and JSON body replays the original response. Reusing the key with changed intent returns 409. After expiry the key starts a new write. |
208
248
 
209
249
  ```sh
210
250
  typeship projects refresh-diagnostics prj_4f8k2m7x9q1v6b3n
@@ -222,18 +262,20 @@ Apply exact, reviewed diagnostic remediations
222
262
 
223
263
  Safety: **write** · Authentication: **required**
224
264
 
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.
265
+ Applies reviewed patches from Diagnostics. For a repository source, opens or updates a source pull request. For a URL source, saves Definition patches.
266
+
267
+ Findings that need an API-owner decision return `422`. Read the finding's `authoring_brief` and update the source instead.
226
268
 
227
269
  | Argument or flag | In | Type | Required | Description |
228
270
  | --- | --- | --- | --- | --- |
229
271
  | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
230
272
  | `--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. |
273
+ | `--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, If-Match header, and JSON body replays the original response. Reusing the key with changed intent returns 409. After expiry the key starts a new write. |
232
274
 
233
275
  Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
234
276
 
235
277
  ```sh
236
- typeship projects remediate-diagnostics prj_4f8k2m7x9q1v6b3n --diagnostic-ids '["value"]'
278
+ typeship projects remediate-diagnostics prj_4f8k2m7x9q1v6b3n --diagnostic-ids '["missing-operation-id"]'
237
279
  ```
238
280
 
239
281
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
@@ -248,7 +290,7 @@ Diagnose a project's repository integrations
248
290
 
249
291
  Safety: **read** · Authentication: **required**
250
292
 
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.
293
+ Checks repository access, Definition readability, source-approval labels, and required checks. Includes the latest webhook delivery so you can investigate missing updates.
252
294
 
253
295
  | Argument or flag | In | Type | Required | Description |
254
296
  | --- | --- | --- | --- | --- |
@@ -273,8 +315,8 @@ Safety: **read** · Authentication: **required**
273
315
  | Argument or flag | In | Type | Required | Description |
274
316
  | --- | --- | --- | --- | --- |
275
317
  | `<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. |
318
+ | `--limit` | query | `number` | no | Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400 invalid_request. List query parameters must appear only once; unrecognized parameters also return 400. Default: 20. |
319
+ | `--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. Omit to start at the first page. Empty, malformed, or repeated cursors return 400 invalid_request. The page limit may change between requests. |
278
320
  | `--target-id` | query | `string` | no | Only generations for this persisted Target. |
279
321
 
280
322
  ```sh
@@ -287,27 +329,26 @@ Read the full command contract with `typeship docs projects list-generations --j
287
329
 
288
330
  ### `typeship projects generate <project_id> [flags]`
289
331
 
290
- Generate targets and open pull requests
332
+ Start generation for active Targets
291
333
 
292
334
  `POST /projects/{project_id}/generations`
293
335
 
294
336
  Safety: **write** · Authentication: **required**
295
337
 
296
- Resolves the project's URL or GitHub source, generates every
297
- configured delivery package, stores each result in the project's history,
298
- and attempts to open a pull request in every configured destination.
299
- When the complete generated tree already matches a destination, no
300
- commit, branch, or pull request is created and that generation reports
301
- `pr_status: no_changes`. This is the same pipeline automatic
302
- regeneration runs after a source change.
338
+ Queues one Generation per active Target and returns their IDs. Retrieve each Generation until its status moves from `queued` to `running` and then `succeeded` or `failed`. `succeeded` means generated files are saved; check Delivery and Draft status separately for repository delivery and pull requests. A Target already queued or running is returned without starting another Generation. A matching Idempotency-Key replay returns the same Generations with their current statuses.
339
+
340
+ If the package already matches a destination and no Draft is open, delivery reports `pr_status: no_changes` without creating a commit, branch, or pull request. An existing Draft stays open. Automatic generation uses the same workflow.
303
341
 
304
342
  | Argument or flag | In | Type | Required | Description |
305
343
  | --- | --- | --- | --- | --- |
306
344
  | `<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. |
345
+ | `--target-id` | body | `string` | no | Stable identifier for one configured generated product. |
346
+ | `--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, If-Match header, and JSON body replays the original response. Reusing the key with changed intent returns 409. After expiry the key starts a new write. |
347
+
348
+ Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
308
349
 
309
350
  ```sh
310
- typeship projects generate prj_4f8k2m7x9q1v6b3n
351
+ typeship projects generate prj_4f8k2m7x9q1v6b3n --target-id tgt_5m8q2v7k1p9d4h6c
311
352
  ```
312
353
 
313
354
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
@@ -344,21 +385,27 @@ Update and resolve a Definition
344
385
 
345
386
  Safety: **write** · Authentication: **required**
346
387
 
347
- Resolves the complete document graph and records a new immutable revision before saving.
388
+ Resolves the source documents before saving the update and records a new Definition Revision when the source changes.
389
+ Omitted fields remain unchanged; supplied objects and arrays replace the whole field.
390
+ If the Definition or its Project configuration changes during validation, returns 409 definition_changed without saving the rejected update. Retrieve the current Definition and Project, reconcile your changes,
391
+ and submit a new request with a new Idempotency-Key if using one.
392
+
393
+ See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag and If-Match.
348
394
 
349
395
  | Argument or flag | In | Type | Required | Description |
350
396
  | --- | --- | --- | --- | --- |
351
397
  | `<definition_id>` | path | `string` | yes | — |
352
398
  | `--source` | body | `json` | no | — |
353
- | `--patches` | body | `array` | no | — |
354
- | `--graphql` | body | `json` | no | — |
399
+ | `--patches` | body | `array` | no | Replace all patches in order. An empty array removes every patch; null is invalid. |
400
+ | `--graphql` | body | `json` | no | Replace all GraphQL settings. Null or an empty object clears them. |
355
401
  | `--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. |
402
+ | `--if-match` | header | `string` | no | ETag from a preceding response. The write applies only if the resource still has that version; otherwise it returns 412 precondition_failed without changes. Omit to write the current version. See https://typeship.dev/docs/typeship-api#conditional-writes. |
403
+ | `--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, If-Match header, and JSON body replays the original response. Reusing the key with changed intent returns 409. After expiry the key starts a new write. |
357
404
 
358
405
  Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
359
406
 
360
407
  ```sh
361
- typeship definitions update def_2p8m4q7k1v9d6h3c
408
+ typeship definitions update def_2p8m4q7k1v9d6h3c --source '{"kind":"url","url":"https://api.parcel.example/openapi.json"}'
362
409
  ```
363
410
 
364
411
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
@@ -378,8 +425,8 @@ Safety: **read** · Authentication: **required**
378
425
  | Argument or flag | In | Type | Required | Description |
379
426
  | --- | --- | --- | --- | --- |
380
427
  | `<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. |
428
+ | `--limit` | query | `number` | no | Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400 invalid_request. List query parameters must appear only once; unrecognized parameters also return 400. Default: 20. |
429
+ | `--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. Omit to start at the first page. Empty, malformed, or repeated cursors return 400 invalid_request. The page limit may change between requests. |
383
430
 
384
431
  ```sh
385
432
  typeship targets list prj_4f8k2m7x9q1v6b3n
@@ -397,26 +444,27 @@ Create an independently configured Target
397
444
 
398
445
  Safety: **write** · Authentication: **required**
399
446
 
400
- Several Targets may use the same generator with distinct configuration, Deliveries, and release streams.
447
+ Creates a Target with its own configuration, Deliveries, and release history. Multiple Targets can use the same generator.
401
448
 
402
449
  | Argument or flag | In | Type | Required | Description |
403
450
  | --- | --- | --- | --- | --- |
404
451
  | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
405
452
  | `--name` | body | `string` | yes | — |
406
453
  | `--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. |
454
+ | `--generator` | body | `string` | yes | Generator implementation selected by a Target. This is configuration, not identity; several Targets may use the same generator. cli is the TypeScript CLI; go-cli is the native Go CLI, a distinct product that imports one exact paired Go SDK module rather than a client of its own. |
408
455
  | `--state` | body | `string` | no | Default: "active". |
409
456
  | `--edition` | body | `string` | no | Default: "2026-08-24". |
410
457
  | `--release-channel` | body | `string` | no | Default: "stable". |
411
458
  | `--proposed-version` | body | `string` | no | Optional larger or prerelease SemVer for the next reviewed release. |
459
+ | `--checks` | body | `object` | no | Required checks run against the complete combined package. Generated checks and customer commands share one reproducible workflow; repository_required names existing repository checks. Supplying checks replaces all settings. Omitted generated restores build, package, and public_entrypoint; omitted repository_required and customer restore empty lists. An empty object restores these defaults. An empty array clears the corresponding list. |
412
460
  | `--config` | body | `json` | no | Target-specific overrides merged over Project.config. GraphQL settings are rejected here and belong to the Definition. |
413
461
  | `--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. |
462
+ | `--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, If-Match header, and JSON body replays the original response. Reusing the key with changed intent returns 409. After expiry the key starts a new write. |
415
463
 
416
464
  Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
417
465
 
418
466
  ```sh
419
- typeship targets create prj_4f8k2m7x9q1v6b3n --name example --definition-id def_2p8m4q7k1v9d6h3c --generator typescript-sdk
467
+ typeship targets create prj_4f8k2m7x9q1v6b3n --name 'Parcel CLI' --definition-id def_2p8m4q7k1v9d6h3c --generator cli --config '{"cli":{"command_name":"parcel"}}' --deliveries '[{"kind":"repository","repository":{"provider":"github","identifier":"parcel-example/parcel-client"},"package_name":"parcel-client","publish_on_merge":false}]'
420
468
  ```
421
469
 
422
470
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
@@ -451,11 +499,14 @@ Delete an unused Target
451
499
 
452
500
  Safety: **destructive** · Authentication: **required**
453
501
 
454
- Targets with Generation or release history, or an active release candidate, must be disabled instead.
502
+ Deletes a Target with no Generation history, release history, or active Draft. A `409 resource_has_dependencies` means one of those resources still depends on it. Retrieve the Target, disable it instead, or resolve the dependency before retrying.
503
+
504
+ See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag and If-Match.
455
505
 
456
506
  | Argument or flag | In | Type | Required | Description |
457
507
  | --- | --- | --- | --- | --- |
458
508
  | `<target_id>` | path | `string` | yes | — |
509
+ | `--if-match` | header | `string` | no | ETag from a preceding response. The write applies only if the resource still has that version; otherwise it returns 412 precondition_failed without changes. Omit to write the current version. See https://typeship.dev/docs/typeship-api#conditional-writes. |
459
510
 
460
511
  ```sh
461
512
  typeship targets delete tgt_5m8q2v7k1p9d4h6c --force
@@ -473,6 +524,14 @@ Update a Target, its Deliveries, or its next reviewed version
473
524
 
474
525
  Safety: **write** · Authentication: **required**
475
526
 
527
+ Omitted fields keep their current values. Supplied config, checks, and deliveries replace their complete stored values.
528
+ Omitting If-Match applies the update to the current resource; with If-Match, a stale ETag returns 412 precondition_failed without saving.
529
+ Send proposed_version by itself; use the Draft endpoint to select a version directly.
530
+
531
+ A `409 target_busy` means the Target is publishing; wait for it to finish. A `409 delivery_conflict` means another Target owns the requested repository tree; retrieve both Targets, choose a free destination, and retry.
532
+ A `502` response means the update was saved, but retiring an obsolete review or regenerating a version selection failed. Retrieve the Target and follow the error's retryable and suggested_action fields. Repeating an unfinished version selection resumes generation; repeating a completed selection starts no new work.
533
+ See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag and If-Match.
534
+
476
535
  | Argument or flag | In | Type | Required | Description |
477
536
  | --- | --- | --- | --- | --- |
478
537
  | `<target_id>` | path | `string` | yes | — |
@@ -480,14 +539,16 @@ Safety: **write** · Authentication: **required**
480
539
  | `--state` | body | `string` | no | — |
481
540
  | `--edition` | body | `string` | no | — |
482
541
  | `--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 | — |
542
+ | `--proposed-version` | body | `string` | no | Send only this field to select an exact SemVer, or null for automatic selection. The Target and Draft endpoints both support an optional If-Match precondition. |
543
+ | `--checks` | body | `object` | no | Required checks run against the complete combined package. Generated checks and customer commands share one reproducible workflow; repository_required names existing repository checks. Supplying checks replaces all settings. Omitted generated restores build, package, and public_entrypoint; omitted repository_required and customer restore empty lists. An empty object restores these defaults. An empty array clears the corresponding list. |
544
+ | `--config` | body | `json` | no | Replaces the complete stored override object. Send null or an empty object to resume Project inheritance. Effective values merge over Project.config; GraphQL settings belong to the Definition. |
545
+ | `--deliveries` | body | `array` | no | Replaces the Delivery set; include each kind you want to keep. Retained kinds preserve their ID, creation time, and hosted URL. Each supplied Delivery replaces its configuration, so omitted optional settings reset to their defaults. Omit deliveries to keep the existing set, or send [] to remove all Deliveries. Removing and later recreating a kind allocates a new ID and, for hosted_mcp, a new URL. |
546
+ | `--if-match` | header | `string` | no | ETag from a preceding response. The write applies only if the resource still has that version; otherwise it returns 412 precondition_failed without changes. Omit to write the current version. See https://typeship.dev/docs/typeship-api#conditional-writes. |
486
547
 
487
548
  Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
488
549
 
489
550
  ```sh
490
- typeship targets update tgt_5m8q2v7k1p9d4h6c
551
+ typeship targets update tgt_5m8q2v7k1p9d4h6c --state disabled
491
552
  ```
492
553
 
493
554
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
@@ -505,8 +566,8 @@ Safety: **read** · Authentication: **required**
505
566
  | Argument or flag | In | Type | Required | Description |
506
567
  | --- | --- | --- | --- | --- |
507
568
  | `<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. |
569
+ | `--limit` | query | `number` | no | Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400 invalid_request. List query parameters must appear only once; unrecognized parameters also return 400. Default: 20. |
570
+ | `--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. Omit to start at the first page. Empty, malformed, or repeated cursors return 400 invalid_request. The page limit may change between requests. |
510
571
 
511
572
  ```sh
512
573
  typeship targets list-releases tgt_5m8q2v7k1p9d4h6c
@@ -524,7 +585,7 @@ Retrieve a Target's rolling Draft release
524
585
 
525
586
  Safety: **read** · Authentication: **required**
526
587
 
527
- Returns Current, the cumulative Draft version and readiness, its exact head, and the optimistic release revision.
588
+ Returns the Draft's status and its one next step, Current's version, the proposed version, readiness, checks, and conflict counts. Every status is described on `status`. The response carries an `ETag`; send it in `If-Match` when updating the Draft to avoid changing a newer version selection.
528
589
 
529
590
  | Argument or flag | In | Type | Required | Description |
530
591
  | --- | --- | --- | --- | --- |
@@ -546,18 +607,24 @@ Select an exact Draft version or return to automatic versioning
546
607
 
547
608
  Safety: **write** · Authentication: **required**
548
609
 
549
- Validates the selection against the cumulative required bump and regenerates the same rolling Draft pull request.
610
+ Checks your version choice against the required version bump, then regenerates the existing Draft pull request.
611
+
612
+ Send the Draft's `ETag` in `If-Match` to reject an intervening change with 412 precondition_failed before saving or regenerating. Omitting `If-Match` applies the selection to the current Draft. Version is required; null restores automatic selection.
613
+
614
+ A `502` response means the selected version was saved, but regeneration failed. Follow the error's retryable and suggested_action fields. Repeating an unfinished selection resumes generation; repeating a completed selection starts no new work. If using If-Match, retrieve the Draft and confirm the saved selection before retrying with its current ETag.
615
+ A `409 target_busy` means the Target is publishing; wait and retry. A `409 version_occupied` means the version is already released; retrieve the Draft and releases, choose a new version, and retry.
616
+ See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag and If-Match.
550
617
 
551
618
  | Argument or flag | In | Type | Required | Description |
552
619
  | --- | --- | --- | --- | --- |
553
620
  | `<target_id>` | path | `string` | yes | — |
554
621
  | `--body-version` | body | `string` | yes | Exact SemVer, or null to return to automatic selection. |
555
- | `--expected-revision` | body | `number` | no | — |
622
+ | `--if-match` | header | `string` | no | ETag from a preceding response. The write applies only if the resource still has that version; otherwise it returns 412 precondition_failed without changes. Omit to write the current version. See https://typeship.dev/docs/typeship-api#conditional-writes. |
556
623
 
557
624
  Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
558
625
 
559
626
  ```sh
560
- typeship targets update-draft tgt_5m8q2v7k1p9d4h6c --body-version 1.0.0
627
+ typeship targets update-draft tgt_5m8q2v7k1p9d4h6c --body-version 1.1.0
561
628
  ```
562
629
 
563
630
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
@@ -572,19 +639,19 @@ Adopt a verified existing package as Current
572
639
 
573
640
  Safety: **write** · Authentication: **required**
574
641
 
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.
642
+ Checks the repository tag, package metadata, and registry artifact, then records the package as an Imported Current release. Opens the first Typeship Draft at the next major version; review it to establish the baseline for preserving existing code.
576
643
 
577
644
  | Argument or flag | In | Type | Required | Description |
578
645
  | --- | --- | --- | --- | --- |
579
646
  | `<target_id>` | path | `string` | yes | — |
580
647
  | `--body-version` | body | `string` | yes | Exact already-published package version to make Current. |
581
648
  | `--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. |
649
+ | `--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, If-Match header, and JSON body replays the original response. Reusing the key with changed intent returns 409. After expiry the key starts a new write. |
583
650
 
584
651
  Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
585
652
 
586
653
  ```sh
587
- typeship targets adopt-release tgt_5m8q2v7k1p9d4h6c --body-version 1.0.0 --tag value
654
+ typeship targets adopt-release tgt_5m8q2v7k1p9d4h6c --body-version 1.0.0 --tag v1.0.0
588
655
  ```
589
656
 
590
657
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
@@ -595,7 +662,7 @@ Read the full command contract with `typeship docs targets adopt-release --json`
595
662
 
596
663
  Retrieve an immutable Target release
597
664
 
598
- `GET /target_releases/{target_release_id}`
665
+ `GET /target-releases/{target_release_id}`
599
666
 
600
667
  Safety: **read** · Authentication: **required**
601
668
 
@@ -615,16 +682,18 @@ Read the full command contract with `typeship docs targets retrieve-release --js
615
682
 
616
683
  Retry publication of an exact Target release
617
684
 
618
- `POST /target_releases/{target_release_id}/republish`
685
+ `POST /target-releases/{target_release_id}/republish`
619
686
 
620
687
  Safety: **write** · Authentication: **required**
621
688
 
622
- Dispatches the repository-owned republish workflow for this immutable version and accepted commit. It never selects the latest Draft or release.
689
+ Retries publication of the specified release through its repository workflow. Uses that release's version and accepted commit, even if a newer Draft or release exists.
690
+
691
+ A `502` response means the repository publication workflow could not be dispatched.
623
692
 
624
693
  | Argument or flag | In | Type | Required | Description |
625
694
  | --- | --- | --- | --- | --- |
626
695
  | `<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. |
696
+ | `--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, If-Match header, and JSON body replays the original response. Reusing the key with changed intent returns 409. After expiry the key starts a new write. |
628
697
 
629
698
  ```sh
630
699
  typeship targets republish-release rel_7m2q8v4k1p9d5h6c
@@ -634,6 +703,186 @@ Output: the response payload as JSON on stdout. A successful response without a
634
703
 
635
704
  Read the full command contract with `typeship docs targets republish-release --json`.
636
705
 
706
+ ### `typeship targets list-draft-files <target_id> [flags]`
707
+
708
+ List customized and conflicted files on a Draft
709
+
710
+ `GET /targets/{target_id}/draft/files`
711
+
712
+ Safety: **read** · Authentication: **required**
713
+
714
+ Lists the Draft's files that differ from the last accepted package or need a conflict decision, ordered by path, without file content. Each conflict names its kind, where the incoming version comes from, the saved decision, and the sides you can read with retrieveDraftFileContent. With `filter=history`, lists the files affected by a default-branch history rewrite instead; the list is empty when none is pending.
715
+
716
+ Returns `409 stale_draft` while Typeship has not integrated the Draft's latest commit (Draft status generating or branch_changed), or when the Draft changes between pages.
717
+
718
+ | Argument or flag | In | Type | Required | Description |
719
+ | --- | --- | --- | --- | --- |
720
+ | `<target_id>` | path | `string` | yes | — |
721
+ | `--filter` | query | `string` | no | conflicted: conflicts only. customized: files that differ from the last accepted package. history: files affected by a default-branch history rewrite. Omit for conflicted and customized files. |
722
+ | `--limit` | query | `number` | no | Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400 invalid_request. List query parameters must appear only once; unrecognized parameters also return 400. Default: 20. |
723
+ | `--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. Omit to start at the first page. Empty, malformed, or repeated cursors return 400 invalid_request. The page limit may change between requests. |
724
+
725
+ ```sh
726
+ typeship targets list-draft-files tgt_5m8q2v7k1p9d4h6c
727
+ ```
728
+
729
+ 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.
730
+
731
+ Read the full command contract with `typeship docs targets list-draft-files --json`.
732
+
733
+ ### `typeship targets retrieve-draft-file-content <target_id> [flags]`
734
+
735
+ Read one side of a Draft file
736
+
737
+ `GET /targets/{target_id}/draft/files/content`
738
+
739
+ Safety: **read** · Authentication: **required**
740
+
741
+ Returns up to 24 KiB of one side of a conflicted or history-affected file: text as UTF-8, binary content as base64. Follow `next_cursor` with the same path and side to read the rest, and concatenate the chunks in order. A side where the file is absent returns 404.
742
+
743
+ | Argument or flag | In | Type | Required | Description |
744
+ | --- | --- | --- | --- | --- |
745
+ | `<target_id>` | path | `string` | yes | — |
746
+ | `--path` | query | `string` | yes | File path from listDraftFiles. |
747
+ | `--side` | query | `string` | yes | A side listed for the file. |
748
+ | `--cursor` | query | `string` | no | next_cursor from the preceding chunk of the same path and side. |
749
+
750
+ ```sh
751
+ typeship targets retrieve-draft-file-content tgt_5m8q2v7k1p9d4h6c --path src/index.ts --side base
752
+ ```
753
+
754
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
755
+
756
+ Read the full command contract with `typeship docs targets retrieve-draft-file-content --json`.
757
+
758
+ ### `typeship targets resolve-draft-conflicts <target_id> [flags]`
759
+
760
+ Resolve selected Draft conflicts
761
+
762
+ `POST /targets/{target_id}/draft/conflicts/resolve`
763
+
764
+ Safety: **write** · Authentication: **required**
765
+
766
+ Saves decisions for conflicts on the Draft's head_revision: keep the repository or incoming version, or supply the final content as text or, for binary files, base64. Decisions save together or not at all, and a decision can be replaced until it is applied. Use `dry_run` to validate them first.
767
+
768
+ Saving changes no files. When every conflict has a decision, `remaining_conflicts` is 0 and the Draft status becomes `needs_generation`: generate the Target to apply the decisions and run its checks. Applying them can report conflicts from the next merge stage.
769
+
770
+ | Argument or flag | In | Type | Required | Description |
771
+ | --- | --- | --- | --- | --- |
772
+ | `<target_id>` | path | `string` | yes | — |
773
+ | `--expected-head-revision` | body | `string` | yes | The Draft's head_revision. A newer Draft commit returns 409 stale_draft without saving. |
774
+ | `--resolutions` | body | `array` | yes | Unique current conflict paths. Final file content must total at most 2 MiB. Decisions save together or not at all. |
775
+ | `--dry-run` | body | `boolean` | no | Validate the decisions and return the planned files without saving. Default: false. |
776
+
777
+ Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
778
+
779
+ ```sh
780
+ typeship targets resolve-draft-conflicts tgt_5m8q2v7k1p9d4h6c --expected-head-revision 0123456789abcdef0123456789abcdef01234567 --resolutions '[{"path":"src/index.ts","keep":"content","mode":"100644","content":"export { ParcelClient } from \"./client.js\";\nexport type { Shipment, Label } from \"./types.js\";\nexport { createParcelClient } from \"./helper.js\";\n"}]'
781
+ ```
782
+
783
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
784
+
785
+ Read the full command contract with `typeship docs targets resolve-draft-conflicts --json`.
786
+
787
+ ### `typeship targets discard-draft-customizations <target_id> [flags]`
788
+
789
+ Discard selected Draft customizations
790
+
791
+ `POST /targets/{target_id}/draft/customizations/discard`
792
+
793
+ Safety: **write** · Authentication: **required**
794
+
795
+ Replaces the listed customized paths that are not conflicts with the generated files, in one commit on the Draft branch. A listed file that exists only on the Draft is deleted. Use `dry_run` to see the planned writes and deletions first. Resolve conflicts with resolveDraftConflicts.
796
+
797
+ After the commit, the Draft status is `branch_changed` until Typeship integrates it from the repository's pull request event and reruns the checks; you do not need to generate the Target.
798
+
799
+ | Argument or flag | In | Type | Required | Description |
800
+ | --- | --- | --- | --- | --- |
801
+ | `<target_id>` | path | `string` | yes | — |
802
+ | `--expected-head-revision` | body | `string` | yes | The Draft's head_revision. A newer Draft commit returns 409 stale_draft without committing. |
803
+ | `--paths` | body | `array` | yes | Customized paths that are not conflicts, to replace with the generated files. A listed file that exists only on the Draft is deleted. |
804
+ | `--dry-run` | body | `boolean` | no | Return the planned writes and deletions without committing. Default: false. |
805
+
806
+ Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
807
+
808
+ ```sh
809
+ typeship targets discard-draft-customizations tgt_5m8q2v7k1p9d4h6c --expected-head-revision 0123456789abcdef0123456789abcdef01234567 --paths '["src/helper.ts"]' --dry-run true
810
+ ```
811
+
812
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
813
+
814
+ Read the full command contract with `typeship docs targets discard-draft-customizations --json`.
815
+
816
+ ### `typeship targets recover-draft-history <target_id> [flags]`
817
+
818
+ Approve recovery from rewritten default-branch history
819
+
820
+ `POST /targets/{target_id}/draft/history/recover`
821
+
822
+ Safety: **write** · Authentication: **required**
823
+
824
+ When the Draft status is `history_rewritten`, review the affected files with `listDraftFiles` and `filter=history`, then approve with the Draft's `history_recovery` revisions. Approval saves the recovery without changing Git, and the Draft status becomes `needs_generation`: generate the Target to open a new Draft from the rewritten default branch. The previous Draft branch stays available, and overlapping code comes back as conflicts to resolve. A rewritten Draft branch alone needs no approval.
825
+
826
+ | Argument or flag | In | Type | Required | Description |
827
+ | --- | --- | --- | --- | --- |
828
+ | `<target_id>` | path | `string` | yes | — |
829
+ | `--expected-default-revision` | body | `string` | yes | The Draft's history_recovery.default_revision. |
830
+ | `--expected-head-revision` | body | `string` | yes | The Draft's history_recovery.head_revision; null when the Draft branch is absent. |
831
+
832
+ Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
833
+
834
+ ```sh
835
+ typeship targets recover-draft-history tgt_5m8q2v7k1p9d4h6c --expected-default-revision 89abcdef0123456789abcdef0123456789abcdef --expected-head-revision 0123456789abcdef0123456789abcdef01234567
836
+ ```
837
+
838
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
839
+
840
+ Read the full command contract with `typeship docs targets recover-draft-history --json`.
841
+
842
+ ### `typeship targets retrieve-delivery <delivery_id> [flags]`
843
+
844
+ Retrieve a Delivery
845
+
846
+ `GET /deliveries/{delivery_id}`
847
+
848
+ Safety: **read** · Authentication: **required**
849
+
850
+ Returns the configured repository or hosted MCP Delivery for a Target. A Delivery in another organization returns 404 not_found.
851
+
852
+ | Argument or flag | In | Type | Required | Description |
853
+ | --- | --- | --- | --- | --- |
854
+ | `<delivery_id>` | path | `string` | yes | — |
855
+
856
+ ```sh
857
+ typeship targets retrieve-delivery dlv_4q8m2v7k1p9d5h6c
858
+ ```
859
+
860
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
861
+
862
+ Read the full command contract with `typeship docs targets retrieve-delivery --json`.
863
+
864
+ ### `typeship targets retrieve-publication <publication_id> [flags]`
865
+
866
+ Retrieve a Publication
867
+
868
+ `GET /publications/{publication_id}`
869
+
870
+ Safety: **read** · Authentication: **required**
871
+
872
+ Returns the current registry publication state for a Target Release. A Publication in another organization returns 404 not_found.
873
+
874
+ | Argument or flag | In | Type | Required | Description |
875
+ | --- | --- | --- | --- | --- |
876
+ | `<publication_id>` | path | `string` | yes | — |
877
+
878
+ ```sh
879
+ typeship targets retrieve-publication pub_2m8q4v7k1p9d5h6c
880
+ ```
881
+
882
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
883
+
884
+ Read the full command contract with `typeship docs targets retrieve-publication --json`.
885
+
637
886
  ## generations
638
887
 
639
888
  ### `typeship generations retrieve <generation_id> [flags]`
@@ -644,7 +893,7 @@ Retrieve a generation
644
893
 
645
894
  Safety: **read** · Authentication: **required**
646
895
 
647
- Includes the generated files when the generation succeeded.
896
+ Returns the current Generation status. `queued` and `running` mean generation is still in progress. `succeeded` means generated files are saved, not that repository delivery or a Draft is complete. Successful results include files, or a file index when the package is too large to inline.
648
897
 
649
898
  | Argument or flag | In | Type | Required | Description |
650
899
  | --- | --- | --- | --- | --- |
@@ -666,7 +915,7 @@ Fetch one file from a generation
666
915
 
667
916
  Safety: **read** · Authentication: **required**
668
917
 
669
- Raw file content, for generations whose target was too large to inline (files_omitted true). The generation's files_index lists valid paths.
918
+ Returns one file's raw content. Use a path from `files_index` when the Generation reports `files_omitted: true`.
670
919
 
671
920
  | Argument or flag | In | Type | Required | Description |
672
921
  | --- | --- | --- | --- | --- |
@@ -674,7 +923,7 @@ Raw file content, for generations whose target was too large to inline (files_om
674
923
  | `--path` | query | `string` | yes | Repo-relative path inside the generated package. |
675
924
 
676
925
  ```sh
677
- typeship generations retrieve-file gen_7h2p5d9c3m8w1k6q --path openapi.yaml
926
+ typeship generations retrieve-file gen_7h2p5d9c3m8w1k6q --path README.md
678
927
  ```
679
928
 
680
929
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
@@ -691,13 +940,13 @@ List Definition Revisions
691
940
 
692
941
  Safety: **read** · Authentication: **required**
693
942
 
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.
943
+ Lists the Definition's revisions, newest first. Source content is not included; retrieve the revision content or individual documents separately.
695
944
 
696
945
  | Argument or flag | In | Type | Required | Description |
697
946
  | --- | --- | --- | --- | --- |
698
947
  | `<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. |
948
+ | `--limit` | query | `number` | no | Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400 invalid_request. List query parameters must appear only once; unrecognized parameters also return 400. Default: 20. |
949
+ | `--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. Omit to start at the first page. Empty, malformed, or repeated cursors return 400 invalid_request. The page limit may change between requests. |
701
950
 
702
951
  ```sh
703
952
  typeship definition-revisions list def_2p8m4q7k1v9d6h3c
@@ -711,11 +960,11 @@ Read the full command contract with `typeship docs definition-revisions list --j
711
960
 
712
961
  Retrieve a Definition Revision
713
962
 
714
- `GET /definition_revisions/{definition_revision_id}`
963
+ `GET /definition-revisions/{definition_revision_id}`
715
964
 
716
965
  Safety: **read** · Authentication: **required**
717
966
 
718
- Metadata for one immutable resolved document graph. Fetch its canonical content or individual source documents from the content endpoints.
967
+ Returns metadata for a saved Definition Revision. Retrieve its resolved content or individual source documents separately.
719
968
 
720
969
  | Argument or flag | In | Type | Required | Description |
721
970
  | --- | --- | --- | --- | --- |
@@ -733,11 +982,11 @@ Read the full command contract with `typeship docs definition-revisions retrieve
733
982
 
734
983
  Retrieve a Definition Revision's canonical content
735
984
 
736
- `GET /definition_revisions/{definition_revision_id}/content`
985
+ `GET /definition-revisions/{definition_revision_id}/content`
737
986
 
738
987
  Safety: **read** · Authentication: **required**
739
988
 
740
- Returns the exact canonical resolved content identified by the revision's graph digest, suitable for saving or piping into a diff.
989
+ Returns the saved, resolved content for this revision. Save it locally or compare it with another revision.
741
990
 
742
991
  | Argument or flag | In | Type | Required | Description |
743
992
  | --- | --- | --- | --- | --- |
@@ -755,7 +1004,7 @@ Read the full command contract with `typeship docs definition-revisions retrieve
755
1004
 
756
1005
  Retrieve one source document from a Definition Revision
757
1006
 
758
- `GET /definition_revisions/{definition_revision_id}/documents/{document_id}/content`
1007
+ `GET /definition-revisions/{definition_revision_id}/documents/{document_id}/content`
759
1008
 
760
1009
  Safety: **read** · Authentication: **required**
761
1010
 
@@ -772,6 +1021,28 @@ Output: the response payload as JSON on stdout. A successful response without a
772
1021
 
773
1022
  Read the full command contract with `typeship docs definition-revisions retrieve-document-content --json`.
774
1023
 
1024
+ ### `typeship definition-revisions retrieve-document <definition_document_id> [flags]`
1025
+
1026
+ Retrieve a Definition Document
1027
+
1028
+ `GET /definition-documents/{definition_document_id}`
1029
+
1030
+ Safety: **read** · Authentication: **required**
1031
+
1032
+ Returns metadata for one source document captured in a Definition Revision. Retrieve its content through the revision's document content endpoint. A document in another organization returns 404 not_found.
1033
+
1034
+ | Argument or flag | In | Type | Required | Description |
1035
+ | --- | --- | --- | --- | --- |
1036
+ | `<definition_document_id>` | path | `string` | yes | — |
1037
+
1038
+ ```sh
1039
+ typeship definition-revisions retrieve-document doc_8q2m5v1k9p4d7h3c
1040
+ ```
1041
+
1042
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
1043
+
1044
+ Read the full command contract with `typeship docs definition-revisions retrieve-document --json`.
1045
+
775
1046
  ## account
776
1047
 
777
1048
  ### `typeship account retrieve [flags]`
@@ -782,8 +1053,7 @@ The account behind the presented credentials
782
1053
 
783
1054
  Safety: **read** · Authentication: **required**
784
1055
 
785
- Returns the account that owns the presented API key. This is also the
786
- identity endpoint the generated typeship CLI's `whoami` calls.
1056
+ Returns the account associated with your credential. The Typeship CLI uses this endpoint for `whoami`.
787
1057
 
788
1058
  ```sh
789
1059
  typeship account retrieve
@@ -799,16 +1069,16 @@ Read the full command contract with `typeship docs account retrieve --json`.
799
1069
 
800
1070
  List API keys
801
1071
 
802
- `GET /api_keys`
1072
+ `GET /api-keys`
803
1073
 
804
1074
  Safety: **read** · Authentication: **required**
805
1075
 
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.
1076
+ Lists key metadata and the last four characters of each key. Full keys are not returned. Create keys in the Console.
807
1077
 
808
1078
  | Argument or flag | In | Type | Required | Description |
809
1079
  | --- | --- | --- | --- | --- |
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. |
1080
+ | `--limit` | query | `number` | no | Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400 invalid_request. List query parameters must appear only once; unrecognized parameters also return 400. Default: 20. |
1081
+ | `--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. Omit to start at the first page. Empty, malformed, or repeated cursors return 400 invalid_request. The page limit may change between requests. |
812
1082
 
813
1083
  ```sh
814
1084
  typeship api-keys list
@@ -818,22 +1088,48 @@ Output: JSON with `items` and `hasMore`; when another page exists, `nextPage` co
818
1088
 
819
1089
  Read the full command contract with `typeship docs api-keys list --json`.
820
1090
 
1091
+ ### `typeship api-keys retrieve <api_key_id> [flags]`
1092
+
1093
+ Retrieve an API key
1094
+
1095
+ `GET /api-keys/{api_key_id}`
1096
+
1097
+ Safety: **read** · Authentication: **required**
1098
+
1099
+ Returns the key summary and its ETag for conditional revocation.
1100
+
1101
+ | Argument or flag | In | Type | Required | Description |
1102
+ | --- | --- | --- | --- | --- |
1103
+ | `<api_key_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via api_keys_list). IDs come from api_keys_list. |
1104
+
1105
+ ```sh
1106
+ typeship api-keys retrieve apikey_2nY8mR6pQ4vK9cH3
1107
+ ```
1108
+
1109
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
1110
+
1111
+ Read the full command contract with `typeship docs api-keys retrieve --json`.
1112
+
821
1113
  ### `typeship api-keys revoke <api_key_id> [flags]`
822
1114
 
823
1115
  Revoke an API key
824
1116
 
825
- `DELETE /api_keys/{api_key_id}`
1117
+ `DELETE /api-keys/{api_key_id}`
826
1118
 
827
1119
  Safety: **destructive** · Authentication: **required**
828
1120
 
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.
1121
+ Revokes a key. Repeating the request returns the same result.
1122
+
1123
+ With OAuth, members can revoke their own keys; organization admins can revoke any key. Organization API keys can revoke any key in their account.
1124
+ See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag and If-Match.
830
1125
 
831
1126
  | Argument or flag | In | Type | Required | Description |
832
1127
  | --- | --- | --- | --- | --- |
833
1128
  | `<api_key_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via api_keys_list). IDs come from api_keys_list. |
1129
+ | `--if-match` | header | `string` | no | ETag from a preceding response. The write applies only if the resource still has that version; otherwise it returns 412 precondition_failed without changes. Omit to write the current version. See https://typeship.dev/docs/typeship-api#conditional-writes. |
834
1130
 
835
1131
  ```sh
836
- typeship api-keys revoke api_key_123 --force
1132
+ typeship api-keys revoke apikey_2nY8mR6pQ4vK9cH3 --force
837
1133
  ```
838
1134
 
839
1135
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.