@typeship-ax/cli 0.10.0 → 0.21.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 (109) hide show
  1. package/AGENTS.md +10 -5
  2. package/README.md +5 -5
  3. package/api.json +9773 -4501
  4. package/api.md +501 -271
  5. package/dist/api-identity.d.ts.map +1 -1
  6. package/dist/api-identity.js +6 -1
  7. package/dist/cli-agent.d.ts +5 -5
  8. package/dist/cli-agent.d.ts.map +1 -1
  9. package/dist/cli-agent.js +14 -10
  10. package/dist/cli.js +158 -82
  11. package/dist/core/http.d.ts +29 -16
  12. package/dist/core/http.d.ts.map +1 -1
  13. package/dist/core/http.js +108 -25
  14. package/dist/core/pagination.d.ts +8 -8
  15. package/dist/core/pagination.d.ts.map +1 -1
  16. package/dist/core/pagination.js +7 -16
  17. package/dist/errors.d.ts +20 -13
  18. package/dist/errors.d.ts.map +1 -1
  19. package/dist/errors.js +29 -20
  20. package/dist/index.d.ts +37 -19
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +42 -18
  23. package/dist/ops.d.ts +5 -1
  24. package/dist/ops.d.ts.map +1 -1
  25. package/dist/ops.js +42 -35
  26. package/dist/polling-login.d.ts.map +1 -1
  27. package/dist/polling-login.js +11 -1
  28. package/dist/resources/api-keys.d.ts +44 -18
  29. package/dist/resources/api-keys.d.ts.map +1 -1
  30. package/dist/resources/api-keys.js +46 -14
  31. package/dist/resources/deliveries.d.ts +46 -0
  32. package/dist/resources/deliveries.d.ts.map +1 -0
  33. package/dist/resources/deliveries.js +70 -0
  34. package/dist/resources/drafts.d.ts +155 -0
  35. package/dist/resources/drafts.d.ts.map +1 -0
  36. package/dist/resources/drafts.js +230 -0
  37. package/dist/resources/files.d.ts +23 -0
  38. package/dist/resources/files.d.ts.map +1 -0
  39. package/dist/resources/files.js +38 -0
  40. package/dist/resources/generate.d.ts +49 -20
  41. package/dist/resources/generate.d.ts.map +1 -1
  42. package/dist/resources/generate.js +56 -14
  43. package/dist/resources/generations.d.ts +70 -18
  44. package/dist/resources/generations.d.ts.map +1 -1
  45. package/dist/resources/generations.js +84 -16
  46. package/dist/resources/organization.d.ts +18 -0
  47. package/dist/resources/organization.d.ts.map +1 -0
  48. package/dist/resources/organization.js +32 -0
  49. package/dist/resources/projects.d.ts +87 -124
  50. package/dist/resources/projects.d.ts.map +1 -1
  51. package/dist/resources/projects.js +70 -173
  52. package/dist/resources/publications.d.ts +46 -0
  53. package/dist/resources/publications.d.ts.map +1 -0
  54. package/dist/resources/publications.js +70 -0
  55. package/dist/resources/releases.d.ts +66 -0
  56. package/dist/resources/releases.d.ts.map +1 -0
  57. package/dist/resources/releases.js +101 -0
  58. package/dist/resources/spec-revisions.d.ts +85 -0
  59. package/dist/resources/spec-revisions.d.ts.map +1 -0
  60. package/dist/resources/spec-revisions.js +116 -0
  61. package/dist/resources/specs.d.ts +72 -0
  62. package/dist/resources/specs.d.ts.map +1 -0
  63. package/dist/resources/specs.js +107 -0
  64. package/dist/resources/targets.d.ts +85 -105
  65. package/dist/resources/targets.d.ts.map +1 -1
  66. package/dist/resources/targets.js +70 -163
  67. package/dist/schemas.d.ts +1 -0
  68. package/dist/schemas.d.ts.map +1 -1
  69. package/dist/schemas.js +194 -139
  70. package/dist/types.d.ts +2626 -1141
  71. package/dist/types.d.ts.map +1 -1
  72. package/dist/types.js +90 -11
  73. package/package.json +3 -3
  74. package/src/api-identity.ts +6 -2
  75. package/src/cli-agent.ts +17 -13
  76. package/src/cli.ts +145 -77
  77. package/src/core/http.ts +106 -30
  78. package/src/core/pagination.ts +13 -23
  79. package/src/errors.ts +30 -20
  80. package/src/index.ts +46 -24
  81. package/src/ops.ts +47 -36
  82. package/src/polling-login.ts +10 -1
  83. package/src/resources/api-keys.ts +87 -19
  84. package/src/resources/deliveries.ts +139 -0
  85. package/src/resources/drafts.ts +422 -0
  86. package/src/resources/files.ts +68 -0
  87. package/src/resources/generate.ts +81 -19
  88. package/src/resources/generations.ts +167 -29
  89. package/src/resources/organization.ts +53 -0
  90. package/src/resources/projects.ts +129 -322
  91. package/src/resources/publications.ts +139 -0
  92. package/src/resources/releases.ts +199 -0
  93. package/src/resources/spec-revisions.ts +237 -0
  94. package/src/resources/specs.ts +200 -0
  95. package/src/resources/targets.ts +135 -304
  96. package/src/schemas.ts +195 -140
  97. package/src/types.ts +2793 -1177
  98. package/dist/resources/account.d.ts +0 -18
  99. package/dist/resources/account.d.ts.map +0 -1
  100. package/dist/resources/account.js +0 -27
  101. package/dist/resources/definition-revisions.d.ts +0 -58
  102. package/dist/resources/definition-revisions.d.ts.map +0 -1
  103. package/dist/resources/definition-revisions.js +0 -114
  104. package/dist/resources/definitions.d.ts +0 -35
  105. package/dist/resources/definitions.d.ts.map +0 -1
  106. package/dist/resources/definitions.js +0 -60
  107. package/src/resources/account.ts +0 -46
  108. package/src/resources/definition-revisions.ts +0 -207
  109. package/src/resources/definitions.ts +0 -122
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.21.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 Spec
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","coverage","warnings","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 `coverage` 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
+ | `--spec` | body | `json` | yes | A Spec 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 Targets. 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.type 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 Spec, 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 Spec itself. One-shot generation also accepts GraphQL settings here; stored projects keep those settings on their Spec. |
41
+ | `--idempotency-key` | header | `string` | no | Identifies one logical write for 24 hours. The key is scoped to the authenticated organization and operation; generation without an organization 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 --spec '{"url":"https://typeship.dev/examples/petstore/openapi.yaml"}' --target '{"type":"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 organization, 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,49 +105,51 @@ 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 Spec.
109
+ Automatic generation is enabled by default for a saved Project.
110
+
111
+ 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
112
 
84
113
  | Argument or flag | In | Type | Required | Description |
85
114
  | --- | --- | --- | --- | --- |
86
115
  | `--name` | body | `string` | yes | — |
87
- | `--definition` | body | `object` | yes | — |
116
+ | `--spec` | body | `object` | yes | — |
88
117
  | `--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. |
118
+ | `--auto-generate` | body | `boolean` | no | Whether Typeship should regenerate automatically when the source or saved configuration changes. Default: true. |
119
+ | `--config` | body | `json` | no | Shared defaults inherited by every Target. GraphQL settings belong in spec.graphql. |
120
+ | `--idempotency-key` | header | `string` | no | Identifies one logical write for 24 hours. The key is scoped to the authenticated organization and operation; generation without an organization 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' --spec '{"source":{"type":"url","url":{"url":"https://api.parcel.example/openapi.json"}}}' --targets '[{"name":"Parcel CLI","type":"cli","deliveries":[{"type":"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}`.
101
129
 
102
130
  Read the full command contract with `typeship docs projects create --json`.
103
131
 
104
- ### `typeship projects retrieve <project_id> [flags]`
132
+ ### `typeship projects get <project_id> [flags]`
105
133
 
106
- Retrieve a project
134
+ Get a project
107
135
 
108
136
  `GET /projects/{project_id}`
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 Spec ID. List its Targets separately to retrieve Target configuration and Deliveries.
113
141
 
114
142
  | Argument or flag | In | Type | Required | Description |
115
143
  | --- | --- | --- | --- | --- |
116
144
  | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
117
145
 
118
146
  ```sh
119
- typeship projects retrieve prj_4f8k2m7x9q1v6b3n
147
+ typeship projects get prj_4f8k2m7x9q1v6b3n
120
148
  ```
121
149
 
122
150
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
123
151
 
124
- Read the full command contract with `typeship docs projects retrieve --json`.
152
+ Read the full command contract with `typeship docs projects get --json`.
125
153
 
126
154
  ### `typeship projects delete <project_id> [flags]`
127
155
 
@@ -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,281 +183,273 @@ 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
+ With auto_generate enabled, changing shared config queues a Generation for each Target whose effective config changes. A queued or running Target reuses that Generation.
188
+ Omitting If-Match applies the update to the current resource; with If-Match, a stale ETag returns 412 precondition_failed without saving.
189
+
190
+ A `409 target_busy` means a Target is publishing. Retrieve the Project, wait for publishing to finish, reconcile your update, and retry.
191
+ 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.
192
+ See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag and If-Match.
193
+
154
194
  | Argument or flag | In | Type | Required | Description |
155
195
  | --- | --- | --- | --- | --- |
156
196
  | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
157
197
  | `--name` | body | `string` | no | — |
158
198
  | `--auto-generate` | body | `boolean` | no | — |
159
- | `--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 false
166
206
  ```
167
207
 
168
208
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
169
209
 
170
210
  Read the full command contract with `typeship docs projects update --json`.
171
211
 
172
- ### `typeship projects retrieve-diagnostics <project_id> [flags]`
212
+ ### `typeship projects generate <project_id> [flags]`
173
213
 
174
- Analyze a project's latest Definition Revision
214
+ Start generation for active Targets
175
215
 
176
- `GET /projects/{project_id}/diagnostics`
216
+ `POST /projects/{project_id}/generate`
177
217
 
178
- Safety: **read** · Authentication: **required**
218
+ Safety: **write** · 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
+ Queues one Generation per active Target and returns their IDs. Retrieve each Generation until its status moves from `queued` to `running` and then `completed` or `failed`. `completed` 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.
221
+
222
+ If the package already matches a destination and no Draft is open, delivery creates no commit, branch, or pull request. An existing Draft stays open. Automatic generation uses the same workflow.
181
223
 
182
224
  | Argument or flag | In | Type | Required | Description |
183
225
  | --- | --- | --- | --- | --- |
184
226
  | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
227
+ | `--target-id` | body | `string` | no | Stable identifier for one configured generated product. Accepts an ID or an exact name (resolved via targets_list). IDs come from targets_list. |
228
+ | `--idempotency-key` | header | `string` | no | Identifies one logical write for 24 hours. The key is scoped to the authenticated organization and operation; generation without an organization 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. |
229
+
230
+ Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
185
231
 
186
232
  ```sh
187
- typeship projects retrieve-diagnostics prj_4f8k2m7x9q1v6b3n
233
+ typeship projects generate prj_4f8k2m7x9q1v6b3n --target-id tgt_5m8q2v7k1p9d4h6c
188
234
  ```
189
235
 
190
236
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
191
237
 
192
- Read the full command contract with `typeship docs projects retrieve-diagnostics --json`.
238
+ Read the full command contract with `typeship docs projects generate --json`.
193
239
 
194
- ### `typeship projects refresh-diagnostics <project_id> [flags]`
240
+ ## specs
195
241
 
196
- Refresh a project's Diagnostics from its configured source
242
+ ### `typeship specs get <spec_id> [flags]`
197
243
 
198
- `POST /projects/{project_id}/diagnostics`
244
+ Get a Spec
199
245
 
200
- Safety: **write** · Authentication: **required**
246
+ `GET /specs/{spec_id}`
201
247
 
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.
248
+ Safety: **read** · Authentication: **required**
203
249
 
204
250
  | Argument or flag | In | Type | Required | Description |
205
251
  | --- | --- | --- | --- | --- |
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. |
252
+ | `<spec_id>` | path | `string` | yes | — |
208
253
 
209
254
  ```sh
210
- typeship projects refresh-diagnostics prj_4f8k2m7x9q1v6b3n
255
+ typeship specs get spec_2p8m4q7k1v9d6h3c
211
256
  ```
212
257
 
213
258
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
214
259
 
215
- Read the full command contract with `typeship docs projects refresh-diagnostics --json`.
260
+ Read the full command contract with `typeship docs specs get --json`.
216
261
 
217
- ### `typeship projects remediate-diagnostics <project_id> [flags]`
262
+ ### `typeship specs update <spec_id> [flags]`
218
263
 
219
- Apply exact, reviewed diagnostic remediations
264
+ Update and resolve a Spec
220
265
 
221
- `POST /projects/{project_id}/diagnostics/remediations`
266
+ `PATCH /specs/{spec_id}`
222
267
 
223
268
  Safety: **write** · Authentication: **required**
224
269
 
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.
270
+ Resolves the source files before saving the update and records a new Spec Revision when the source changes.
271
+ Omitted fields remain unchanged; supplied objects and arrays replace the whole field.
272
+ If the Spec or its Project configuration changes during validation, returns 409 resource_changed without saving the rejected update. Retrieve the current Spec and Project, reconcile your changes,
273
+ and submit a new request with a new Idempotency-Key if using one.
274
+
275
+ See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag and If-Match.
226
276
 
227
277
  | Argument or flag | In | Type | Required | Description |
228
278
  | --- | --- | --- | --- | --- |
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. |
279
+ | `<spec_id>` | path | `string` | yes | — |
280
+ | `--source` | body | `json` | no | — |
281
+ | `--patches` | body | `array` | no | Replace all patches in order. An empty array removes every patch; null is invalid. |
282
+ | `--graphql` | body | `json` | no | Replace all GraphQL settings. Null or an empty object clears them. |
283
+ | `--diagnostic-policy` | body | `object` | no | Source pull-request enforcement threshold, new-versus-complete baseline, and explicitly reviewed rule or location exceptions. |
284
+ | `--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. |
285
+ | `--idempotency-key` | header | `string` | no | Identifies one logical write for 24 hours. The key is scoped to the authenticated organization and operation; generation without an organization 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
286
 
233
287
  Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
234
288
 
235
289
  ```sh
236
- typeship projects remediate-diagnostics prj_4f8k2m7x9q1v6b3n --diagnostic-ids '["value"]'
290
+ typeship specs update spec_2p8m4q7k1v9d6h3c --source '{"type":"url","url":{"url":"https://api.parcel.example/openapi.json"}}'
237
291
  ```
238
292
 
239
293
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
240
294
 
241
- Read the full command contract with `typeship docs projects remediate-diagnostics --json`.
295
+ Read the full command contract with `typeship docs specs update --json`.
242
296
 
243
- ### `typeship projects retrieve-integration-health <project_id> [flags]`
297
+ ### `typeship specs refresh <spec_id> [flags]`
244
298
 
245
- Diagnose a project's repository integrations
299
+ Refresh a Spec from its configured source
246
300
 
247
- `GET /projects/{project_id}/integration-health`
301
+ `POST /specs/{spec_id}/refresh`
248
302
 
249
- Safety: **read** · Authentication: **required**
303
+ Safety: **write** · Authentication: **required**
250
304
 
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.
305
+ Fetches the configured source now and creates a new Spec Revision only when its content changes. Diagnostics then reads that revision. If automatic generation is enabled, refresh queues generation for active Targets even when the source is unchanged.
252
306
 
253
307
  | Argument or flag | In | Type | Required | Description |
254
308
  | --- | --- | --- | --- | --- |
255
- | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
309
+ | `<spec_id>` | path | `string` | yes | — |
310
+ | `--idempotency-key` | header | `string` | no | Identifies one logical write for 24 hours. The key is scoped to the authenticated organization and operation; generation without an organization 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. |
256
311
 
257
312
  ```sh
258
- typeship projects retrieve-integration-health prj_4f8k2m7x9q1v6b3n
313
+ typeship specs refresh spec_2p8m4q7k1v9d6h3c
259
314
  ```
260
315
 
261
316
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
262
317
 
263
- Read the full command contract with `typeship docs projects retrieve-integration-health --json`.
318
+ Read the full command contract with `typeship docs specs refresh --json`.
319
+
320
+ ## specRevisions
264
321
 
265
- ### `typeship projects list-generations <project_id> [flags]`
322
+ ### `typeship spec-revisions list [flags]`
266
323
 
267
- List a project's generations
324
+ List Spec Revisions
268
325
 
269
- `GET /projects/{project_id}/generations`
326
+ `GET /spec-revisions`
270
327
 
271
328
  Safety: **read** · Authentication: **required**
272
329
 
330
+ Lists Spec Revisions, newest first. Source content is not included; list a revision's files with listSpecRevisionFiles.
331
+
273
332
  | Argument or flag | In | Type | Required | Description |
274
333
  | --- | --- | --- | --- | --- |
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. |
334
+ | `--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. |
335
+ | `--cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. Valid only for the same organization, 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. |
336
+ | `--spec-id` | query | `string` | no | Only revisions of this Spec. |
279
337
 
280
338
  ```sh
281
- typeship projects list-generations prj_4f8k2m7x9q1v6b3n
339
+ typeship spec-revisions list
282
340
  ```
283
341
 
284
342
  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
343
 
286
- Read the full command contract with `typeship docs projects list-generations --json`.
344
+ Read the full command contract with `typeship docs spec-revisions list --json`.
287
345
 
288
- ### `typeship projects generate <project_id> [flags]`
346
+ ### `typeship spec-revisions get <spec_revision_id> [flags]`
289
347
 
290
- Generate targets and open pull requests
348
+ Get a Spec Revision
291
349
 
292
- `POST /projects/{project_id}/generations`
350
+ `GET /spec-revisions/{spec_revision_id}`
293
351
 
294
- Safety: **write** · Authentication: **required**
352
+ Safety: **read** · Authentication: **required**
295
353
 
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.
354
+ Returns metadata for a saved Spec Revision with a Diagnostics summary. Pass `include=diagnostics` to add every Diagnostic, evaluated with the Spec's current patches and Diagnostic policy. List its source files and resolved document with listSpecRevisionFiles.
303
355
 
304
356
  | Argument or flag | In | Type | Required | Description |
305
357
  | --- | --- | --- | --- | --- |
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. |
358
+ | `<spec_revision_id>` | path | `string` | yes | — |
359
+ | `--include` | query | `string` | no | Add related data to the response. `diagnostics` adds the `diagnostics` and `patch_diagnostics` arrays. |
308
360
 
309
361
  ```sh
310
- typeship projects generate prj_4f8k2m7x9q1v6b3n
362
+ typeship spec-revisions get srev_6m1q8v4k2p9d7h3c
311
363
  ```
312
364
 
313
365
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
314
366
 
315
- Read the full command contract with `typeship docs projects generate --json`.
316
-
317
- ## definitions
367
+ Read the full command contract with `typeship docs spec-revisions get --json`.
318
368
 
319
- ### `typeship definitions retrieve <definition_id> [flags]`
369
+ ### `typeship spec-revisions list-files <spec_revision_id> [flags]`
320
370
 
321
- Retrieve a Definition
371
+ List a Spec Revision's files
322
372
 
323
- `GET /definitions/{definition_id}`
373
+ `GET /spec-revisions/{spec_revision_id}/files`
324
374
 
325
375
  Safety: **read** · Authentication: **required**
326
376
 
327
- | Argument or flag | In | Type | Required | Description |
328
- | --- | --- | --- | --- | --- |
329
- | `<definition_id>` | path | `string` | yes | — |
330
-
331
- ```sh
332
- typeship definitions retrieve def_2p8m4q7k1v9d6h3c
333
- ```
334
-
335
- Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
336
-
337
- Read the full command contract with `typeship docs definitions retrieve --json`.
338
-
339
- ### `typeship definitions update <definition_id> [flags]`
340
-
341
- Update and resolve a Definition
342
-
343
- `PATCH /definitions/{definition_id}`
344
-
345
- Safety: **write** · Authentication: **required**
346
-
347
- Resolves the complete document graph and records a new immutable revision before saving.
377
+ Lists the captured source files and the resolved document Typeship generated from, ordered by path. Read content with getFile.
348
378
 
349
379
  | Argument or flag | In | Type | Required | Description |
350
380
  | --- | --- | --- | --- | --- |
351
- | `<definition_id>` | path | `string` | yes | — |
352
- | `--source` | body | `json` | no | — |
353
- | `--patches` | body | `array` | no | — |
354
- | `--graphql` | body | `json` | no | — |
355
- | `--diagnostic-policy` | body | `object` | no | Source pull-request enforcement threshold, new-versus-complete baseline, and explicitly reviewed rule or location exceptions. |
356
- | `--idempotency-key` | header | `string` | no | Identifies one logical write for 24 hours. The key is scoped to the authenticated account and operation; account-less generation uses a hashed network identity. Retrying the same method, path, query, and JSON body replays the original response. Reusing the key with changed intent returns 409. After expiry the key starts a new write. |
357
-
358
- Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
381
+ | `<spec_revision_id>` | path | `string` | yes | — |
382
+ | `--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. |
383
+ | `--cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. Valid only for the same organization, 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. |
359
384
 
360
385
  ```sh
361
- typeship definitions update def_2p8m4q7k1v9d6h3c
386
+ typeship spec-revisions list-files srev_6m1q8v4k2p9d7h3c
362
387
  ```
363
388
 
364
- Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
389
+ 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.
365
390
 
366
- Read the full command contract with `typeship docs definitions update --json`.
391
+ Read the full command contract with `typeship docs spec-revisions list-files --json`.
367
392
 
368
393
  ## targets
369
394
 
370
- ### `typeship targets list <project_id> [flags]`
395
+ ### `typeship targets list [flags]`
371
396
 
372
- List a project's Targets
397
+ List Targets
373
398
 
374
- `GET /projects/{project_id}/targets`
399
+ `GET /targets`
375
400
 
376
401
  Safety: **read** · Authentication: **required**
377
402
 
378
403
  | Argument or flag | In | Type | Required | Description |
379
404
  | --- | --- | --- | --- | --- |
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. |
405
+ | `--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. |
406
+ | `--cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. Valid only for the same organization, 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. |
407
+ | `--project-id` | query | `string` | no | Only Targets in this Project. Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
383
408
 
384
409
  ```sh
385
- typeship targets list prj_4f8k2m7x9q1v6b3n
410
+ typeship targets list
386
411
  ```
387
412
 
388
413
  Output: JSON with `items` and `hasMore`; when another page exists, `nextPage` contains its arguments and `nextCommand` contains the command to fetch it. Use `--all` to stream every item from every page as NDJSON.
389
414
 
390
415
  Read the full command contract with `typeship docs targets list --json`.
391
416
 
392
- ### `typeship targets create <project_id> [flags]`
417
+ ### `typeship targets create [flags]`
393
418
 
394
419
  Create an independently configured Target
395
420
 
396
- `POST /projects/{project_id}/targets`
421
+ `POST /targets`
397
422
 
398
423
  Safety: **write** · Authentication: **required**
399
424
 
400
- Several Targets may use the same generator with distinct configuration, Deliveries, and release streams.
425
+ Creates a Target with its own configuration, Deliveries, and release history. Multiple Targets can use the same generator.
401
426
 
402
427
  | Argument or flag | In | Type | Required | Description |
403
428
  | --- | --- | --- | --- | --- |
404
- | `<project_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
429
+ | `--project-id` | body | `string` | yes | Unique identifier for a project. Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
405
430
  | `--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". |
431
+ | `--spec-id` | body | `string` | yes | Unique identifier for a project's logical API Spec. |
432
+ | `--type` | 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. |
433
+ | `--status` | body | `string` | no | Default: "active". |
410
434
  | `--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. |
435
+ | `--checks` | body | `object` | no | Required checks run against the code in the Draft. 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. |
436
+ | `--config` | body | `json` | no | Target-specific overrides merged over Project.config. GraphQL settings are rejected here and belong to the Spec. |
413
437
  | `--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. |
438
+ | `--idempotency-key` | header | `string` | no | Identifies one logical write for 24 hours. The key is scoped to the authenticated organization and operation; generation without an organization 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
439
 
416
440
  Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
417
441
 
418
442
  ```sh
419
- typeship targets create prj_4f8k2m7x9q1v6b3n --name example --definition-id def_2p8m4q7k1v9d6h3c --generator typescript-sdk
443
+ typeship targets create --project-id prj_4f8k2m7x9q1v6b3n --name 'Parcel CLI' --spec-id spec_2p8m4q7k1v9d6h3c --type cli --config '{"cli":{"command_name":"parcel"}}' --deliveries '[{"type":"repository","repository":{"provider":"github","identifier":"parcel-example/parcel-client","package_name":"parcel-client","publish_on_merge":false}}]'
420
444
  ```
421
445
 
422
446
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
423
447
 
424
448
  Read the full command contract with `typeship docs targets create --json`.
425
449
 
426
- ### `typeship targets retrieve <target_id> [flags]`
450
+ ### `typeship targets get <target_id> [flags]`
427
451
 
428
- Retrieve a Target
452
+ Get a Target
429
453
 
430
454
  `GET /targets/{target_id}`
431
455
 
@@ -433,15 +457,15 @@ Safety: **read** · Authentication: **required**
433
457
 
434
458
  | Argument or flag | In | Type | Required | Description |
435
459
  | --- | --- | --- | --- | --- |
436
- | `<target_id>` | path | `string` | yes | — |
460
+ | `<target_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via targets_list). IDs come from targets_list. |
437
461
 
438
462
  ```sh
439
- typeship targets retrieve tgt_5m8q2v7k1p9d4h6c
463
+ typeship targets get tgt_5m8q2v7k1p9d4h6c
440
464
  ```
441
465
 
442
466
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
443
467
 
444
- Read the full command contract with `typeship docs targets retrieve --json`.
468
+ Read the full command contract with `typeship docs targets get --json`.
445
469
 
446
470
  ### `typeship targets delete <target_id> [flags]`
447
471
 
@@ -451,11 +475,14 @@ Delete an unused Target
451
475
 
452
476
  Safety: **destructive** · Authentication: **required**
453
477
 
454
- Targets with Generation or release history, or an active release candidate, must be disabled instead.
478
+ 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.
479
+
480
+ See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag and If-Match.
455
481
 
456
482
  | Argument or flag | In | Type | Required | Description |
457
483
  | --- | --- | --- | --- | --- |
458
- | `<target_id>` | path | `string` | yes | — |
484
+ | `<target_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via targets_list). IDs come from targets_list. |
485
+ | `--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
486
 
460
487
  ```sh
461
488
  typeship targets delete tgt_5m8q2v7k1p9d4h6c --force
@@ -467,331 +494,508 @@ Read the full command contract with `typeship docs targets delete --json`.
467
494
 
468
495
  ### `typeship targets update <target_id> [flags]`
469
496
 
470
- Update a Target, its Deliveries, or its next reviewed version
497
+ Update a Target or its Deliveries
471
498
 
472
499
  `PATCH /targets/{target_id}`
473
500
 
474
501
  Safety: **write** · Authentication: **required**
475
502
 
503
+ Omitted fields keep their current values. Supplied config, checks, and deliveries replace their complete stored values.
504
+ With Project auto_generate enabled, changing Target config, checks, or Deliveries queues that Target's Generation. A queued or running Target reuses that Generation.
505
+ Omitting If-Match applies the update to the current resource; with If-Match, a stale ETag returns 412 precondition_failed without saving.
506
+ Select the next version through PATCH /drafts/{draft_id} on the Target's draft_id.
507
+
508
+ 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.
509
+ A `502` response means the update was saved, but retiring an obsolete review or regenerating the Target failed. Retrieve the Target and follow the error's retryable and suggested_action fields.
510
+ See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag and If-Match.
511
+
476
512
  | Argument or flag | In | Type | Required | Description |
477
513
  | --- | --- | --- | --- | --- |
478
- | `<target_id>` | path | `string` | yes | — |
514
+ | `<target_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via targets_list). IDs come from targets_list. |
479
515
  | `--name` | body | `string` | no | — |
480
- | `--state` | body | `string` | no | — |
481
- | `--edition` | body | `string` | no | — |
516
+ | `--status` | body | `string` | no | — |
482
517
  | `--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 | — |
518
+ | `--checks` | body | `object` | no | Required checks run against the code in the Draft. 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. |
519
+ | `--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 Spec. |
520
+ | `--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. |
521
+ | `--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
522
 
487
523
  Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
488
524
 
489
525
  ```sh
490
- typeship targets update tgt_5m8q2v7k1p9d4h6c
526
+ typeship targets update tgt_5m8q2v7k1p9d4h6c --status disabled
491
527
  ```
492
528
 
493
529
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
494
530
 
495
531
  Read the full command contract with `typeship docs targets update --json`.
496
532
 
497
- ### `typeship targets list-releases <target_id> [flags]`
533
+ ### `typeship targets adopt <target_id> [flags]`
498
534
 
499
- List immutable releases for a Target
535
+ Adopt a verified existing package as the latest release
500
536
 
501
- `GET /targets/{target_id}/releases`
537
+ `POST /targets/{target_id}/adopt`
538
+
539
+ Safety: **write** · Authentication: **required**
540
+
541
+ Checks the repository tag, package metadata, and registry artifact, then records the package as an Imported latest release. Opens the first Typeship Draft at the next major version; review it to establish the baseline for preserving existing code.
542
+
543
+ | Argument or flag | In | Type | Required | Description |
544
+ | --- | --- | --- | --- | --- |
545
+ | `<target_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via targets_list). IDs come from targets_list. |
546
+ | `--body-version` | body | `string` | yes | Exact already-published package version to make the latest release. |
547
+ | `--tag` | body | `string` | yes | Immutable repository tag containing the matching package source. |
548
+ | `--idempotency-key` | header | `string` | no | Identifies one logical write for 24 hours. The key is scoped to the authenticated organization and operation; generation without an organization 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. |
549
+
550
+ Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
551
+
552
+ ```sh
553
+ typeship targets adopt tgt_5m8q2v7k1p9d4h6c --body-version 1.0.0 --tag v1.0.0
554
+ ```
555
+
556
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
557
+
558
+ Read the full command contract with `typeship docs targets adopt --json`.
559
+
560
+ ## drafts
561
+
562
+ ### `typeship drafts list [flags]`
563
+
564
+ List Drafts
565
+
566
+ `GET /drafts`
502
567
 
503
568
  Safety: **read** · Authentication: **required**
504
569
 
570
+ Lists open and merged Drafts, newest first. Each Target has one open Draft; each merge adds a merged Draft.
571
+
505
572
  | Argument or flag | In | Type | Required | Description |
506
573
  | --- | --- | --- | --- | --- |
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. |
574
+ | `--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. |
575
+ | `--cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. Valid only for the same organization, 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. |
576
+ | `--target-id` | query | `string` | no | Only Drafts of this Target. Accepts an ID or an exact name (resolved via targets_list). IDs come from targets_list. |
577
+ | `--status` | query | `string` | no | Only Drafts with this status. |
510
578
 
511
579
  ```sh
512
- typeship targets list-releases tgt_5m8q2v7k1p9d4h6c
580
+ typeship drafts list
513
581
  ```
514
582
 
515
583
  Output: JSON with `items` and `hasMore`; when another page exists, `nextPage` contains its arguments and `nextCommand` contains the command to fetch it. Use `--all` to stream every item from every page as NDJSON.
516
584
 
517
- Read the full command contract with `typeship docs targets list-releases --json`.
585
+ Read the full command contract with `typeship docs drafts list --json`.
518
586
 
519
- ### `typeship targets retrieve-draft <target_id> [flags]`
587
+ ### `typeship drafts get <draft_id> [flags]`
520
588
 
521
- Retrieve a Target's rolling Draft release
589
+ Get a Draft
522
590
 
523
- `GET /targets/{target_id}/draft`
591
+ `GET /drafts/{draft_id}`
524
592
 
525
593
  Safety: **read** · Authentication: **required**
526
594
 
527
- Returns Current, the cumulative Draft version and readiness, its exact head, and the optimistic release revision.
595
+ Returns the Draft's status. An open Draft also reports its typed reason when action is required, next version and its source, readiness, checks, and conflict counts. The response carries an `ETag`; send it in `If-Match` when updating the Draft to avoid changing a newer version selection.
528
596
 
529
597
  | Argument or flag | In | Type | Required | Description |
530
598
  | --- | --- | --- | --- | --- |
531
- | `<target_id>` | path | `string` | yes | — |
599
+ | `<draft_id>` | path | `string` | yes | — |
532
600
 
533
601
  ```sh
534
- typeship targets retrieve-draft tgt_5m8q2v7k1p9d4h6c
602
+ typeship drafts get drf_3q7m1v8k2p5d9h4c
535
603
  ```
536
604
 
537
605
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
538
606
 
539
- Read the full command contract with `typeship docs targets retrieve-draft --json`.
607
+ Read the full command contract with `typeship docs drafts get --json`.
540
608
 
541
- ### `typeship targets update-draft <target_id> [flags]`
609
+ ### `typeship drafts update <draft_id> [flags]`
542
610
 
543
611
  Select an exact Draft version or return to automatic versioning
544
612
 
545
- `PATCH /targets/{target_id}/draft`
613
+ `PATCH /drafts/{draft_id}`
546
614
 
547
615
  Safety: **write** · Authentication: **required**
548
616
 
549
- Validates the selection against the cumulative required bump and regenerates the same rolling Draft pull request.
617
+ Checks your version choice against the required version bump, then regenerates the existing Draft pull request.
618
+
619
+ 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_next is required; null restores automatic selection.
620
+
621
+ 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.
622
+ A `409 draft_merged` means the Draft merged; retrieve the Target and select a version on its `draft_id`. 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.
623
+ See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag and If-Match.
550
624
 
551
625
  | Argument or flag | In | Type | Required | Description |
552
626
  | --- | --- | --- | --- | --- |
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 | — |
627
+ | `<draft_id>` | path | `string` | yes | — |
628
+ | `--version-next` | body | `string` | yes | Exact SemVer, or null to return to automatic selection. |
629
+ | `--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
630
 
557
631
  Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
558
632
 
559
633
  ```sh
560
- typeship targets update-draft tgt_5m8q2v7k1p9d4h6c --body-version 1.0.0
634
+ typeship drafts update drf_3q7m1v8k2p5d9h4c --version-next 1.1.0
561
635
  ```
562
636
 
563
637
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
564
638
 
565
- Read the full command contract with `typeship docs targets update-draft --json`.
639
+ Read the full command contract with `typeship docs drafts update --json`.
566
640
 
567
- ### `typeship targets adopt-release <target_id> [flags]`
641
+ ### `typeship drafts list-files <draft_id> [flags]`
568
642
 
569
- Adopt a verified existing package as Current
643
+ List customized and conflicted files on a Draft
570
644
 
571
- `POST /targets/{target_id}/adopt`
645
+ `GET /drafts/{draft_id}/files`
646
+
647
+ Safety: **read** · Authentication: **required**
648
+
649
+ Lists the Draft's files that differ from the last merged package or need a conflict decision, ordered by path, without file content. Each conflict names its kind, the saved decision, and the sides you can read with getFile. With `filter=history`, lists files affected by a default-branch history rewrite; the list is empty when none is pending.
650
+
651
+ Returns `409 resource_changed` while Typeship is carrying the Draft's latest commit forward (status working), or when the Draft changes between pages.
652
+
653
+ | Argument or flag | In | Type | Required | Description |
654
+ | --- | --- | --- | --- | --- |
655
+ | `<draft_id>` | path | `string` | yes | — |
656
+ | `--filter` | query | `string` | no | conflicted: conflicts only. customized: files that differ from the last merged package. history: files affected by a default-branch history rewrite. Omit for conflicted and customized files. |
657
+ | `--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. |
658
+ | `--cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. Valid only for the same organization, 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. |
659
+
660
+ ```sh
661
+ typeship drafts list-files drf_3q7m1v8k2p5d9h4c
662
+ ```
663
+
664
+ 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.
665
+
666
+ Read the full command contract with `typeship docs drafts list-files --json`.
667
+
668
+ ### `typeship drafts resolve <draft_id> [flags]`
669
+
670
+ Resolve selected Draft files
671
+
672
+ `POST /drafts/{draft_id}/resolve`
572
673
 
573
674
  Safety: **write** · Authentication: **required**
574
675
 
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.
676
+ Resolves conflicts on the Draft's head_sha: keep yours or generated, or supply final content as text or, for binary files, base64. Choosing generated for a customized path replaces it with the generated file, or deletes a Draft-only file.
677
+
678
+ Conflict decisions are saved together and can be replaced until applied. Choosing generated for customized paths commits those changes together on the Draft branch. Returns the Draft. When every conflict has a decision, `conflicts.decided` equals `conflicts.total` and Typeship continues the Draft and runs checks. Paths that already match the Draft change nothing.
576
679
 
577
680
  | Argument or flag | In | Type | Required | Description |
578
681
  | --- | --- | --- | --- | --- |
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. |
682
+ | `<draft_id>` | path | `string` | yes | — |
683
+ | `--expected-head-sha` | body | `string` | yes | The Draft's head_sha. A newer Draft commit returns 409 resource_changed without saving. |
684
+ | `--resolutions` | body | `array` | yes | Unique current conflict or customized paths. Choose generated to discard a customization, including a Draft-only file. Final file content must total at most 2 MiB. Decisions apply together or not at all. |
583
685
 
584
686
  Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
585
687
 
586
688
  ```sh
587
- typeship targets adopt-release tgt_5m8q2v7k1p9d4h6c --body-version 1.0.0 --tag value
689
+ typeship drafts resolve drf_3q7m1v8k2p5d9h4c --expected-head-sha 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"}]'
588
690
  ```
589
691
 
590
692
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
591
693
 
592
- Read the full command contract with `typeship docs targets adopt-release --json`.
694
+ Read the full command contract with `typeship docs drafts resolve --json`.
695
+
696
+ ### `typeship drafts recover <draft_id> [flags]`
593
697
 
594
- ### `typeship targets retrieve-release <target_release_id> [flags]`
698
+ Approve recovery from rewritten default-branch history
595
699
 
596
- Retrieve an immutable Target release
700
+ `POST /drafts/{draft_id}/recover`
701
+
702
+ Safety: **write** · Authentication: **required**
597
703
 
598
- `GET /target_releases/{target_release_id}`
704
+ When the Draft has status `action_required` and reason `history_rewritten`, review affected files with `listDraftFiles` and `filter=history`, then approve with the Draft's `history_recovery` revisions. Approval saves the recovery without changing Git and returns the Draft; the next generation rebuilds it 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.
705
+
706
+ | Argument or flag | In | Type | Required | Description |
707
+ | --- | --- | --- | --- | --- |
708
+ | `<draft_id>` | path | `string` | yes | — |
709
+ | `--expected-default-sha` | body | `string` | yes | The Draft's history_recovery.default_sha. |
710
+ | `--expected-head-sha` | body | `string` | yes | The Draft's history_recovery.head_sha; null when the Draft branch is absent. |
711
+
712
+ Use `--data '<json>'`, `--data @body.json`, or `--data -` to supply the request body. Field flags override matching body fields.
713
+
714
+ ```sh
715
+ typeship drafts recover drf_3q7m1v8k2p5d9h4c --expected-default-sha 89abcdef0123456789abcdef0123456789abcdef --expected-head-sha 0123456789abcdef0123456789abcdef01234567
716
+ ```
717
+
718
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
719
+
720
+ Read the full command contract with `typeship docs drafts recover --json`.
721
+
722
+ ## releases
723
+
724
+ ### `typeship releases list [flags]`
725
+
726
+ List releases
727
+
728
+ `GET /releases`
599
729
 
600
730
  Safety: **read** · Authentication: **required**
601
731
 
602
732
  | Argument or flag | In | Type | Required | Description |
603
733
  | --- | --- | --- | --- | --- |
604
- | `<target_release_id>` | path | `string` | yes | — |
734
+ | `--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. |
735
+ | `--cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. Valid only for the same organization, 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. |
736
+ | `--target-id` | query | `string` | no | Only releases of this Target. Accepts an ID or an exact name (resolved via targets_list). IDs come from targets_list. |
605
737
 
606
738
  ```sh
607
- typeship targets retrieve-release rel_7m2q8v4k1p9d5h6c
739
+ typeship releases list
740
+ ```
741
+
742
+ 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.
743
+
744
+ Read the full command contract with `typeship docs releases list --json`.
745
+
746
+ ### `typeship releases get <release_id> [flags]`
747
+
748
+ Get an immutable release
749
+
750
+ `GET /releases/{release_id}`
751
+
752
+ Safety: **read** · Authentication: **required**
753
+
754
+ | Argument or flag | In | Type | Required | Description |
755
+ | --- | --- | --- | --- | --- |
756
+ | `<release_id>` | path | `string` | yes | — |
757
+
758
+ ```sh
759
+ typeship releases get rel_7m2q8v4k1p9d5h6c
608
760
  ```
609
761
 
610
762
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
611
763
 
612
- Read the full command contract with `typeship docs targets retrieve-release --json`.
764
+ Read the full command contract with `typeship docs releases get --json`.
613
765
 
614
- ### `typeship targets republish-release <target_release_id> [flags]`
766
+ ### `typeship releases republish <release_id> [flags]`
615
767
 
616
- Retry publication of an exact Target release
768
+ Retry publishing an exact release
617
769
 
618
- `POST /target_releases/{target_release_id}/republish`
770
+ `POST /releases/{release_id}/republish`
619
771
 
620
772
  Safety: **write** · Authentication: **required**
621
773
 
622
- Dispatches the repository-owned republish workflow for this immutable version and accepted commit. It never selects the latest Draft or release.
774
+ Retries publishing the specified release through its repository workflow. Uses that release's version and accepted commit, even if a newer Draft or release exists.
775
+
776
+ A `502` response means the repository publishing workflow could not be dispatched.
623
777
 
624
778
  | Argument or flag | In | Type | Required | Description |
625
779
  | --- | --- | --- | --- | --- |
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. |
780
+ | `<release_id>` | path | `string` | yes | — |
781
+ | `--idempotency-key` | header | `string` | no | Identifies one logical write for 24 hours. The key is scoped to the authenticated organization and operation; generation without an organization 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
782
 
629
783
  ```sh
630
- typeship targets republish-release rel_7m2q8v4k1p9d5h6c
784
+ typeship releases republish rel_7m2q8v4k1p9d5h6c
631
785
  ```
632
786
 
633
787
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
634
788
 
635
- Read the full command contract with `typeship docs targets republish-release --json`.
789
+ Read the full command contract with `typeship docs releases republish --json`.
636
790
 
637
- ## generations
791
+ ## deliveries
638
792
 
639
- ### `typeship generations retrieve <generation_id> [flags]`
793
+ ### `typeship deliveries list [flags]`
640
794
 
641
- Retrieve a generation
795
+ List Deliveries
642
796
 
643
- `GET /generations/{generation_id}`
797
+ `GET /deliveries`
798
+
799
+ Safety: **read** · Authentication: **required**
800
+
801
+ | Argument or flag | In | Type | Required | Description |
802
+ | --- | --- | --- | --- | --- |
803
+ | `--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. |
804
+ | `--cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. Valid only for the same organization, 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. |
805
+ | `--target-id` | query | `string` | no | Only Deliveries of this Target. Accepts an ID or an exact name (resolved via targets_list). IDs come from targets_list. |
806
+
807
+ ```sh
808
+ typeship deliveries list
809
+ ```
810
+
811
+ 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.
812
+
813
+ Read the full command contract with `typeship docs deliveries list --json`.
814
+
815
+ ### `typeship deliveries get <delivery_id> [flags]`
816
+
817
+ Get a Delivery
818
+
819
+ `GET /deliveries/{delivery_id}`
644
820
 
645
821
  Safety: **read** · Authentication: **required**
646
822
 
647
- Includes the generated files when the generation succeeded.
823
+ Returns the configured repository or hosted MCP Delivery for a Target. A Delivery in another organization returns 404 not_found.
648
824
 
649
825
  | Argument or flag | In | Type | Required | Description |
650
826
  | --- | --- | --- | --- | --- |
651
- | `<generation_id>` | path | `string` | yes | — |
827
+ | `<delivery_id>` | path | `string` | yes | — |
652
828
 
653
829
  ```sh
654
- typeship generations retrieve gen_7h2p5d9c3m8w1k6q
830
+ typeship deliveries get dlv_4q8m2v7k1p9d5h6c
655
831
  ```
656
832
 
657
833
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
658
834
 
659
- Read the full command contract with `typeship docs generations retrieve --json`.
835
+ Read the full command contract with `typeship docs deliveries get --json`.
836
+
837
+ ## publications
660
838
 
661
- ### `typeship generations retrieve-file <generation_id> [flags]`
839
+ ### `typeship publications list [flags]`
662
840
 
663
- Fetch one file from a generation
841
+ List publications
664
842
 
665
- `GET /generations/{generation_id}/file`
843
+ `GET /publications`
666
844
 
667
845
  Safety: **read** · Authentication: **required**
668
846
 
669
- Raw file content, for generations whose target was too large to inline (files_omitted true). The generation's files_index lists valid paths.
847
+ | Argument or flag | In | Type | Required | Description |
848
+ | --- | --- | --- | --- | --- |
849
+ | `--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. |
850
+ | `--cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. Valid only for the same organization, 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. |
851
+ | `--release-id` | query | `string` | no | Only publications of this release. |
852
+
853
+ ```sh
854
+ typeship publications list
855
+ ```
856
+
857
+ 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.
858
+
859
+ Read the full command contract with `typeship docs publications list --json`.
860
+
861
+ ### `typeship publications get <publication_id> [flags]`
862
+
863
+ Get publishing status
864
+
865
+ `GET /publications/{publication_id}`
866
+
867
+ Safety: **read** · Authentication: **required**
868
+
869
+ Returns the registry publishing status for a release. A status in another organization returns 404 not_found.
670
870
 
671
871
  | Argument or flag | In | Type | Required | Description |
672
872
  | --- | --- | --- | --- | --- |
673
- | `<generation_id>` | path | `string` | yes | — |
674
- | `--path` | query | `string` | yes | Repo-relative path inside the generated package. |
873
+ | `<publication_id>` | path | `string` | yes | — |
675
874
 
676
875
  ```sh
677
- typeship generations retrieve-file gen_7h2p5d9c3m8w1k6q --path openapi.yaml
876
+ typeship publications get pub_2m8q4v7k1p9d5h6c
678
877
  ```
679
878
 
680
879
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
681
880
 
682
- Read the full command contract with `typeship docs generations retrieve-file --json`.
881
+ Read the full command contract with `typeship docs publications get --json`.
683
882
 
684
- ## definitionRevisions
883
+ ## generations
685
884
 
686
- ### `typeship definition-revisions list <definition_id> [flags]`
885
+ ### `typeship generations list [flags]`
687
886
 
688
- List Definition Revisions
887
+ List generations
689
888
 
690
- `GET /definitions/{definition_id}/revisions`
889
+ `GET /generations`
691
890
 
692
891
  Safety: **read** · Authentication: **required**
693
892
 
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.
695
-
696
893
  | Argument or flag | In | Type | Required | Description |
697
894
  | --- | --- | --- | --- | --- |
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. |
895
+ | `--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. |
896
+ | `--cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. Valid only for the same organization, 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. |
897
+ | `--project-id` | query | `string` | no | Only Generations in this Project. Accepts an ID or an exact name (resolved via projects_list). IDs come from projects_list. |
898
+ | `--target-id` | query | `string` | no | Only Generations of this Target. Accepts an ID or an exact name (resolved via targets_list). IDs come from targets_list. |
899
+ | `--status` | query | `string` | no | Only Generations with this status. |
701
900
 
702
901
  ```sh
703
- typeship definition-revisions list def_2p8m4q7k1v9d6h3c
902
+ typeship generations list
704
903
  ```
705
904
 
706
905
  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.
707
906
 
708
- Read the full command contract with `typeship docs definition-revisions list --json`.
907
+ Read the full command contract with `typeship docs generations list --json`.
709
908
 
710
- ### `typeship definition-revisions retrieve <definition_revision_id> [flags]`
909
+ ### `typeship generations get <generation_id> [flags]`
711
910
 
712
- Retrieve a Definition Revision
911
+ Get a generation
713
912
 
714
- `GET /definition_revisions/{definition_revision_id}`
913
+ `GET /generations/{generation_id}`
715
914
 
716
915
  Safety: **read** · Authentication: **required**
717
916
 
718
- Metadata for one immutable resolved document graph. Fetch its canonical content or individual source documents from the content endpoints.
917
+ Returns the status of that Generation. `queued` and `running` mean generation is still in progress. `completed` means generated files are saved, not that repository delivery or a Draft is complete. List its files with listGenerationFiles and read each with getFile.
719
918
 
720
919
  | Argument or flag | In | Type | Required | Description |
721
920
  | --- | --- | --- | --- | --- |
722
- | `<definition_revision_id>` | path | `string` | yes | — |
921
+ | `<generation_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via generations_list). IDs come from generations_list. |
723
922
 
724
923
  ```sh
725
- typeship definition-revisions retrieve drev_6m1q8v4k2p9d7h3c
924
+ typeship generations get gen_7h2p5d9c3m8w1k6q
726
925
  ```
727
926
 
728
927
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
729
928
 
730
- Read the full command contract with `typeship docs definition-revisions retrieve --json`.
929
+ Read the full command contract with `typeship docs generations get --json`.
731
930
 
732
- ### `typeship definition-revisions retrieve-content <definition_revision_id> [flags]`
931
+ ### `typeship generations list-files <generation_id> [flags]`
733
932
 
734
- Retrieve a Definition Revision's canonical content
933
+ List a Generation's files
735
934
 
736
- `GET /definition_revisions/{definition_revision_id}/content`
935
+ `GET /generations/{generation_id}/files`
737
936
 
738
937
  Safety: **read** · Authentication: **required**
739
938
 
740
- Returns the exact canonical resolved content identified by the revision's graph digest, suitable for saving or piping into a diff.
939
+ Lists the generated package's files, ordered by path. Read content with getFile.
741
940
 
742
941
  | Argument or flag | In | Type | Required | Description |
743
942
  | --- | --- | --- | --- | --- |
744
- | `<definition_revision_id>` | path | `string` | yes | — |
943
+ | `<generation_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via generations_list). IDs come from generations_list. |
944
+ | `--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. |
945
+ | `--cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. Valid only for the same organization, 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. |
745
946
 
746
947
  ```sh
747
- typeship definition-revisions retrieve-content drev_6m1q8v4k2p9d7h3c
948
+ typeship generations list-files gen_7h2p5d9c3m8w1k6q
748
949
  ```
749
950
 
750
- Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
951
+ 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.
952
+
953
+ Read the full command contract with `typeship docs generations list-files --json`.
751
954
 
752
- Read the full command contract with `typeship docs definition-revisions retrieve-content --json`.
955
+ ## files
753
956
 
754
- ### `typeship definition-revisions retrieve-document-content <definition_revision_id> <document_id> [flags]`
957
+ ### `typeship files get <file_id> [flags]`
755
958
 
756
- Retrieve one source document from a Definition Revision
959
+ Get a file
757
960
 
758
- `GET /definition_revisions/{definition_revision_id}/documents/{document_id}/content`
961
+ `GET /files/{file_id}`
759
962
 
760
963
  Safety: **read** · Authentication: **required**
761
964
 
965
+ Returns one bounded chunk of an immutable file: at most 24 KiB, as UTF-8 text or, for binary bytes, base64. When next_cursor is not null, repeat the request with cursor and concatenate the chunks in order. A file ID always returns the same bytes.
966
+
762
967
  | Argument or flag | In | Type | Required | Description |
763
968
  | --- | --- | --- | --- | --- |
764
- | `<definition_revision_id>` | path | `string` | yes | — |
765
- | `<document_id>` | path | `string` | yes | — |
969
+ | `<file_id>` | path | `string` | yes | — |
970
+ | `--cursor` | query | `string` | no | next_cursor from the preceding chunk of this file. |
766
971
 
767
972
  ```sh
768
- typeship definition-revisions retrieve-document-content drev_6m1q8v4k2p9d7h3c doc_8q2m5v1k9p4d7h3c
973
+ typeship files get file_4k8m2v7q1p9d5h6c
769
974
  ```
770
975
 
771
976
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
772
977
 
773
- Read the full command contract with `typeship docs definition-revisions retrieve-document-content --json`.
978
+ Read the full command contract with `typeship docs files get --json`.
774
979
 
775
- ## account
980
+ ## organization
776
981
 
777
- ### `typeship account retrieve [flags]`
982
+ ### `typeship organization get [flags]`
778
983
 
779
- The account behind the presented credentials
984
+ The organization behind the presented credentials
780
985
 
781
- `GET /me`
986
+ `GET /organization`
782
987
 
783
988
  Safety: **read** · Authentication: **required**
784
989
 
785
- Returns the account that owns the presented API key. This is also the
786
- identity endpoint the generated typeship CLI's `whoami` calls.
990
+ Returns the organization associated with your credential. The Typeship CLI uses this endpoint for `whoami`.
787
991
 
788
992
  ```sh
789
- typeship account retrieve
993
+ typeship organization get
790
994
  ```
791
995
 
792
996
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
793
997
 
794
- Read the full command contract with `typeship docs account retrieve --json`.
998
+ Read the full command contract with `typeship docs organization get --json`.
795
999
 
796
1000
  ## apiKeys
797
1001
 
@@ -799,16 +1003,16 @@ Read the full command contract with `typeship docs account retrieve --json`.
799
1003
 
800
1004
  List API keys
801
1005
 
802
- `GET /api_keys`
1006
+ `GET /api-keys`
803
1007
 
804
1008
  Safety: **read** · Authentication: **required**
805
1009
 
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.
1010
+ Lists key metadata and the last four characters of each key. Full keys are not returned. Create keys in the Console.
807
1011
 
808
1012
  | Argument or flag | In | Type | Required | Description |
809
1013
  | --- | --- | --- | --- | --- |
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. |
1014
+ | `--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. |
1015
+ | `--cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. Valid only for the same organization, 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
1016
 
813
1017
  ```sh
814
1018
  typeship api-keys list
@@ -818,22 +1022,48 @@ Output: JSON with `items` and `hasMore`; when another page exists, `nextPage` co
818
1022
 
819
1023
  Read the full command contract with `typeship docs api-keys list --json`.
820
1024
 
1025
+ ### `typeship api-keys get <api_key_id> [flags]`
1026
+
1027
+ Get an API key
1028
+
1029
+ `GET /api-keys/{api_key_id}`
1030
+
1031
+ Safety: **read** · Authentication: **required**
1032
+
1033
+ Returns the key summary and its ETag for conditional revocation.
1034
+
1035
+ | Argument or flag | In | Type | Required | Description |
1036
+ | --- | --- | --- | --- | --- |
1037
+ | `<api_key_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via api_keys_list). IDs come from api_keys_list. |
1038
+
1039
+ ```sh
1040
+ typeship api-keys get apikey_2nY8mR6pQ4vK9cH3
1041
+ ```
1042
+
1043
+ Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.
1044
+
1045
+ Read the full command contract with `typeship docs api-keys get --json`.
1046
+
821
1047
  ### `typeship api-keys revoke <api_key_id> [flags]`
822
1048
 
823
1049
  Revoke an API key
824
1050
 
825
- `DELETE /api_keys/{api_key_id}`
1051
+ `DELETE /api-keys/{api_key_id}`
826
1052
 
827
1053
  Safety: **destructive** · Authentication: **required**
828
1054
 
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.
1055
+ Revokes a key. Repeating the request returns the same result.
1056
+
1057
+ With OAuth, members can revoke their own keys; organization admins can revoke any key. Organization API keys can revoke any key in their organization.
1058
+ See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag and If-Match.
830
1059
 
831
1060
  | Argument or flag | In | Type | Required | Description |
832
1061
  | --- | --- | --- | --- | --- |
833
1062
  | `<api_key_id>` | path | `string` | yes | Accepts an ID or an exact name (resolved via api_keys_list). IDs come from api_keys_list. |
1063
+ | `--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
1064
 
835
1065
  ```sh
836
- typeship api-keys revoke api_key_123 --force
1066
+ typeship api-keys revoke apikey_2nY8mR6pQ4vK9cH3 --force
837
1067
  ```
838
1068
 
839
1069
  Output: the response payload as JSON on stdout. A successful response without a body produces `{"ok": true}`.