@tenderprompt/cli 0.1.1 → 0.1.3

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 (3) hide show
  1. package/README.md +16 -16
  2. package/dist/index.js +274 -231
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Tender CLI
2
2
 
3
- Command-line tools for managing Tender Apps from a local checkout.
3
+ Command-line tools for managing Tender App projects from a local checkout.
4
4
 
5
5
  The CLI is built for humans and local coding agents. The agent runs locally,
6
6
  edits files locally, and uses normal Git plus explicit Tender API commands for
@@ -24,15 +24,15 @@ tender --help
24
24
  ```bash
25
25
  tender auth login --device --profile edit-preview --artifact artifact_123 --ttl 7d
26
26
 
27
- tender artifacts git setup artifact_123 --dir ./widget
27
+ tender app git setup artifact_123 --dir ./widget
28
28
 
29
29
  cd ./widget
30
30
  npm run check
31
31
  git push tender main
32
32
 
33
- tender artifacts preview watch artifact_123 --commit "$(git rev-parse HEAD)" --stream --json
33
+ tender app preview artifact_123 --commit "$(git rev-parse HEAD)" --stream --json
34
34
 
35
- tender artifacts publish artifact_123 --commit "$(git rev-parse HEAD)" --confirm publish --stream --json
35
+ tender app publish artifact_123 --commit "$(git rev-parse HEAD)" --confirm publish --stream --json
36
36
  ```
37
37
 
38
38
  ## Auth
@@ -60,23 +60,23 @@ Tender source movement uses Git:
60
60
  git push tender main
61
61
  ```
62
62
 
63
- A push updates artifact source and can trigger preview work. Publishing remains
63
+ A push updates app source and can trigger preview work. Publishing remains
64
64
  an explicit lifecycle command so local agents do not accidentally publish
65
65
  production changes.
66
66
 
67
67
  ## Useful Commands
68
68
 
69
69
  ```bash
70
- tender artifacts list --json
71
- tender artifacts create --name "Exit Intent Widget" --json
72
- tender artifacts update artifact_123 --name "Sale Widget" --json
73
- tender artifacts init artifact_123 --dir ./widget --json
74
- tender artifacts context status artifact_123 --dir ./widget --json
75
- tender artifacts doctor --dir ./widget --json
76
- tender artifacts validate artifact_123 --json
77
- tender artifacts build artifact_123 --commit "$(git rev-parse HEAD)" --json
78
- tender artifacts preview rebuild artifact_123 --commit "$(git rev-parse HEAD)" --stream --json
79
- tender artifacts publish artifact_123 --dry-run --json
70
+ tender app list --json
71
+ tender app create --name "Exit Intent Widget" --json
72
+ tender app update artifact_123 --name "Sale Widget" --json
73
+ tender app init artifact_123 --dir ./widget --json
74
+ tender app context status artifact_123 --dir ./widget --json
75
+ tender app doctor --dir ./widget --json
76
+ tender app validate artifact_123 --json
77
+ tender app build artifact_123 --commit "$(git rev-parse HEAD)" --json
78
+ tender app preview artifact_123 --commit "$(git rev-parse HEAD)" --stream --json
79
+ tender app publish artifact_123 --dry-run --json
80
80
  ```
81
81
 
82
82
  ## Safety Model
@@ -85,7 +85,7 @@ tender artifacts publish artifact_123 --dry-run --json
85
85
  - Source moves through artifact Git.
86
86
  - Preview, build, and publish are explicit API lifecycle operations.
87
87
  - `write` lets a token edit and preview; `publish` must be explicitly granted.
88
- - `tender artifacts publish` requires `--dry-run` or `--confirm publish`.
88
+ - `tender app publish` requires `--dry-run` or `--confirm publish`.
89
89
  - Tokens are stored outside the project checkout and are not written into Git
90
90
  remote URLs.
91
91
 
package/dist/index.js CHANGED
@@ -23,58 +23,61 @@ Commands:
23
23
  tender auth login --device
24
24
  Authorize this machine with a browser-approved device flow
25
25
  tender auth status Show whether a Tender API token is available
26
- tender artifacts list List artifacts visible to the current token
27
- tender artifacts create --name <name>
28
- Create a new artifact in the current account
29
- tender artifacts update <artifact-id> --name <name>
30
- Update artifact metadata
31
- tender artifacts init <artifact-id>
26
+ tender app list List Tender App records visible to the current token
27
+ tender app create --name <name>
28
+ Create a new Tender App in the current account
29
+ tender app update <app-id> --name <name>
30
+ Update app metadata
31
+ tender app init <app-id>
32
32
  Bootstrap a checkout for local agent work
33
- tender artifacts validate <artifact-id>
34
- Validate the server-side artifact workspace
35
- tender artifacts build <artifact-id>
36
- Build the current artifact workspace
37
- tender artifacts preview rebuild <artifact-id>
33
+ tender app validate <app-id>
34
+ Validate the server-side app workspace
35
+ tender app build <app-id>
36
+ Build the current app workspace
37
+ tender app preview <app-id>
38
38
  Rebuild the preview from the current workspace
39
- tender artifacts preview status <artifact-id>
39
+ tender app preview status <app-id>
40
40
  Show the latest or commit-pinned preview job
41
- tender artifacts preview watch <artifact-id>
41
+ tender app preview watch <app-id>
42
42
  Stream or print lifecycle events for a preview job
43
- tender artifacts publish <artifact-id>
43
+ tender app publish <app-id>
44
44
  Publish after explicit confirmation
45
- tender artifacts publish status <artifact-id>
45
+ tender app publish status <app-id>
46
46
  Show publish job status by job id
47
- tender artifacts publish watch <artifact-id>
47
+ tender app publish watch <app-id>
48
48
  Stream or print lifecycle events for a publish job
49
- tender artifacts context fetch <artifact-id>
49
+ tender app context fetch <app-id>
50
50
  Fetch managed agent context into a checkout
51
- tender artifacts context status <artifact-id>
51
+ tender app context status <app-id>
52
52
  Report whether managed context is stale
53
- tender artifacts context refresh <artifact-id>
53
+ tender app context refresh <app-id>
54
54
  Refresh managed context files
55
- tender artifacts git setup <artifact-id>
56
- Configure a checkout to push to the artifact remote
57
- tender artifacts doctor Validate a local Tender App checkout
55
+ tender app git setup <app-id>
56
+ Configure a checkout to push to the app remote
57
+ tender app doctor Validate a local Tender App checkout
58
+
59
+ Compatibility:
60
+ tender artifacts ... Legacy alias for Tender App commands
58
61
 
59
62
  Examples:
60
63
  tender auth login --device --profile edit-preview --artifact artifact_123 --ttl 7d
61
64
  tender auth status --json
62
- tender artifacts list --json
63
- tender artifacts create --name "Exit Intent Widget" --json
64
- tender artifacts update artifact_123 --name "Sale Widget" --json
65
- tender artifacts init artifact_123 --dir ./widget --json
66
- tender artifacts validate artifact_123 --json
67
- tender artifacts build artifact_123 --commit $(git rev-parse HEAD) --json
68
- tender artifacts preview rebuild artifact_123 --commit $(git rev-parse HEAD) --stream --json
69
- tender artifacts preview status artifact_123 --commit $(git rev-parse HEAD) --json
70
- tender artifacts preview watch artifact_123 --job job_123 --stream --json
71
- tender artifacts publish artifact_123 --commit $(git rev-parse HEAD) --confirm publish --stream --json
72
- tender artifacts context fetch artifact_123 --dir ./widget --dry-run --json
73
- tender artifacts context status artifact_123 --dir ./widget --json
74
- tender artifacts context refresh artifact_123 --dir ./widget --dry-run --json
75
- tender artifacts git setup artifact_123 --dir ./widget --json
76
- tender artifacts doctor --dir ./widget
77
- tender artifacts doctor --dir ./widget --json`;
65
+ tender app list --json
66
+ tender app create --name "Exit Intent Widget" --json
67
+ tender app update artifact_123 --name "Sale Widget" --json
68
+ tender app init artifact_123 --dir ./widget --json
69
+ tender app validate artifact_123 --json
70
+ tender app build artifact_123 --commit $(git rev-parse HEAD) --json
71
+ tender app preview artifact_123 --commit $(git rev-parse HEAD) --stream --json
72
+ tender app preview status artifact_123 --commit $(git rev-parse HEAD) --json
73
+ tender app preview watch artifact_123 --job job_123 --stream --json
74
+ tender app publish artifact_123 --commit $(git rev-parse HEAD) --confirm publish --stream --json
75
+ tender app context fetch artifact_123 --dir ./widget --dry-run --json
76
+ tender app context status artifact_123 --dir ./widget --json
77
+ tender app context refresh artifact_123 --dir ./widget --dry-run --json
78
+ tender app git setup artifact_123 --dir ./widget --json
79
+ tender app doctor --dir ./widget
80
+ tender app doctor --dir ./widget --json`;
78
81
  }
79
82
  function authHelp() {
80
83
  return `Usage: tender auth <command> [options]
@@ -117,68 +120,74 @@ Examples:
117
120
  tender auth status
118
121
  tender auth status --profile publish --json`;
119
122
  }
120
- function artifactsHelp() {
121
- return `Usage: tender artifacts <command> [options]
123
+ function appHelp() {
124
+ return `Usage: tender app <command> [options]
122
125
 
123
126
  Commands:
124
- tender artifacts list List artifacts visible to the current token
125
- tender artifacts create --name <name>
126
- Create a new artifact in the current account
127
- tender artifacts update <artifact-id> --name <name>
128
- Update artifact metadata
129
- tender artifacts init <artifact-id>
127
+ tender app list List Tender App records visible to the current token
128
+ tender app create --name <name>
129
+ Create a new Tender App in the current account
130
+ tender app update <app-id> --name <name>
131
+ Update app metadata
132
+ tender app init <app-id>
130
133
  Bootstrap context files and the tender Git remote
131
- tender artifacts validate <artifact-id>
132
- Validate the server-side artifact workspace
133
- tender artifacts build <artifact-id>
134
- Build the current artifact workspace
135
- tender artifacts preview rebuild <artifact-id>
134
+ tender app validate <app-id>
135
+ Validate the server-side app workspace
136
+ tender app build <app-id>
137
+ Build the current app workspace
138
+ tender app preview <app-id>
136
139
  Rebuild the preview and optionally stream lifecycle events
137
- tender artifacts preview status <artifact-id>
140
+ tender app preview status <app-id>
138
141
  Show preview job status by latest, commit, or job id
139
- tender artifacts preview watch <artifact-id>
142
+ tender app preview watch <app-id>
140
143
  Replay lifecycle events by latest, commit, or job id
141
- tender artifacts publish <artifact-id>
144
+ tender app publish <app-id>
142
145
  Publish after dry-run or explicit confirmation
143
- tender artifacts publish status <artifact-id>
146
+ tender app publish status <app-id>
144
147
  Show publish job status by job id
145
- tender artifacts publish watch <artifact-id>
148
+ tender app publish watch <app-id>
146
149
  Replay lifecycle events for a publish job id
147
- tender artifacts context fetch <artifact-id>
150
+ tender app context fetch <app-id>
148
151
  Fetch AGENTS.md, skills, and Tender App scaffold files
149
- tender artifacts context status <artifact-id>
152
+ tender app context status <app-id>
150
153
  Show managed context freshness for a checkout
151
- tender artifacts context refresh <artifact-id>
154
+ tender app context refresh <app-id>
152
155
  Refresh managed context files in a checkout
153
- tender artifacts git setup <artifact-id>
156
+ tender app git setup <app-id>
154
157
  Configure the tender Git remote and credential helper
155
- tender artifacts doctor Validate local context, TypeScript scaffold, and Tender App rules
156
- tender artifacts git remote <artifact-id>
158
+ tender app doctor Validate local context, TypeScript scaffold, and Tender App rules
159
+ tender app git remote <app-id>
157
160
  Show Tender-hosted Git remote metadata
158
161
 
159
162
  Examples:
160
- tender artifacts list --json
161
- tender artifacts create --name "Exit Intent Widget" --json
162
- tender artifacts update artifact_123 --name "Sale Widget" --json
163
- tender artifacts init artifact_123 --dir ./widget --json
164
- tender artifacts validate artifact_123 --json
165
- tender artifacts build artifact_123 --commit $(git rev-parse HEAD) --json
166
- tender artifacts preview rebuild artifact_123 --commit $(git rev-parse HEAD) --stream --json
167
- tender artifacts preview status artifact_123 --commit $(git rev-parse HEAD) --json
168
- tender artifacts preview watch artifact_123 --job job_123 --stream --json
169
- tender artifacts publish artifact_123 --dry-run --json
170
- tender artifacts publish status artifact_123 --job job_123 --json
171
- tender artifacts publish watch artifact_123 --job job_123 --stream --json
172
- tender artifacts context fetch artifact_123 --dir ./widget --dry-run --json
173
- tender artifacts context status artifact_123 --dir ./widget --json
174
- tender artifacts context refresh artifact_123 --dir ./widget --dry-run --json
175
- tender artifacts git setup artifact_123 --dir ./widget --json
176
- tender artifacts doctor --dir ./widget
177
- tender artifacts doctor --json
178
- tender artifacts git remote artifact_123 --ttl 7d --json`;
163
+ tender app list --json
164
+ tender app create --name "Exit Intent Widget" --json
165
+ tender app update artifact_123 --name "Sale Widget" --json
166
+ tender app init artifact_123 --dir ./widget --json
167
+ tender app validate artifact_123 --json
168
+ tender app build artifact_123 --commit $(git rev-parse HEAD) --json
169
+ tender app preview artifact_123 --commit $(git rev-parse HEAD) --stream --json
170
+ tender app preview status artifact_123 --commit $(git rev-parse HEAD) --json
171
+ tender app preview watch artifact_123 --job job_123 --stream --json
172
+ tender app publish artifact_123 --dry-run --json
173
+ tender app publish status artifact_123 --job job_123 --json
174
+ tender app publish watch artifact_123 --job job_123 --stream --json
175
+ tender app context fetch artifact_123 --dir ./widget --dry-run --json
176
+ tender app context status artifact_123 --dir ./widget --json
177
+ tender app context refresh artifact_123 --dir ./widget --dry-run --json
178
+ tender app git setup artifact_123 --dir ./widget --json
179
+ tender app doctor --dir ./widget
180
+ tender app doctor --json
181
+ tender app git remote artifact_123 --ttl 7d --json`;
182
+ }
183
+ function artifactsHelp() {
184
+ return `${appHelp()}
185
+
186
+ Legacy alias:
187
+ tender artifacts ... continues to work for existing automation. Prefer tender app ... for new workflows.`;
179
188
  }
180
189
  function artifactsListHelp() {
181
- return `Usage: tender artifacts list [--base-url <url>] [--token <token>] [--profile <name>] [--json]
190
+ return `Usage: tender app list [--base-url <url>] [--token <token>] [--profile <name>] [--json]
182
191
 
183
192
  Options:
184
193
  --base-url <url> Tender base URL. Defaults to TENDER_BASE_URL, saved profile base URL, or https://app.tenderprompt.com.
@@ -187,15 +196,15 @@ Options:
187
196
  --json Emit stable JSON for coding agents.
188
197
 
189
198
  Examples:
190
- tender artifacts list --json
191
- tender artifacts list --profile account --json
192
- TENDER_API_TOKEN=tpat_... tender artifacts list --base-url https://app.tenderprompt.com --json`;
199
+ tender app list --json
200
+ tender app list --profile account --json
201
+ TENDER_API_TOKEN=tpat_... tender app list --base-url https://app.tenderprompt.com --json`;
193
202
  }
194
203
  function artifactsCreateHelp() {
195
- return `Usage: tender artifacts create --name <name> [--target-pack <id>] [--target-pack-version <version>] [--base-url <url>] [--token <token>] [--profile <name>] [--json]
204
+ return `Usage: tender app create --name <name> [--target-pack <id>] [--target-pack-version <version>] [--base-url <url>] [--token <token>] [--profile <name>] [--json]
196
205
 
197
206
  Options:
198
- --name <name> Artifact name.
207
+ --name <name> App name.
199
208
  --target-pack <id> Target pack id. Defaults to the API default.
200
209
  --target-pack-version <value> Target pack version. Defaults to the API default.
201
210
  --base-url <url> Tender base URL. Defaults to TENDER_BASE_URL, saved profile base URL, or https://app.tenderprompt.com.
@@ -204,24 +213,24 @@ Options:
204
213
  --json Emit stable JSON for coding agents.
205
214
 
206
215
  Examples:
207
- tender artifacts create --name "Exit Intent Widget" --json
208
- tender artifacts create --name "Exit Intent Widget" --profile account --json`;
216
+ tender app create --name "Exit Intent Widget" --json
217
+ tender app create --name "Exit Intent Widget" --profile account --json`;
209
218
  }
210
219
  function artifactsUpdateHelp() {
211
- return `Usage: tender artifacts update <artifact-id> --name <name> [--base-url <url>] [--token <token>] [--profile <name>] [--json]
220
+ return `Usage: tender app update <app-id> --name <name> [--base-url <url>] [--token <token>] [--profile <name>] [--json]
212
221
 
213
222
  Options:
214
- --name <name> New artifact name.
223
+ --name <name> New app name.
215
224
  --base-url <url> Tender base URL. Defaults to TENDER_BASE_URL, saved profile base URL, or https://app.tenderprompt.com.
216
225
  --token <token> Tender API token. Defaults to TENDER_API_TOKEN or the saved profile token.
217
226
  --profile <name> Local config profile name. Defaults to the saved default profile.
218
227
  --json Emit stable JSON for coding agents.
219
228
 
220
229
  Examples:
221
- tender artifacts update artifact_123 --name "Sale Widget" --json`;
230
+ tender app update artifact_123 --name "Sale Widget" --json`;
222
231
  }
223
232
  function artifactsInitHelp() {
224
- return `Usage: tender artifacts init <artifact-id> [--dir <path>] [--remote <name>] [--base-url <url>] [--token <token>] [--profile <name>] [--ttl <7d|14d|30d>] [--dry-run] [--force] [--json]
233
+ return `Usage: tender app init <app-id> [--dir <path>] [--remote <name>] [--base-url <url>] [--token <token>] [--profile <name>] [--ttl <7d|14d|30d>] [--dry-run] [--force] [--json]
225
234
 
226
235
  Options:
227
236
  --dir <path> Local checkout directory to create/update. Defaults to current directory.
@@ -235,12 +244,12 @@ Options:
235
244
  --json Emit stable JSON for coding agents.
236
245
 
237
246
  Examples:
238
- tender artifacts init artifact_123 --dir ./widget --dry-run --json
239
- tender artifacts init artifact_123 --dir ./widget --json
240
- tender artifacts init artifact_123 --dir ./widget --force --json`;
247
+ tender app init artifact_123 --dir ./widget --dry-run --json
248
+ tender app init artifact_123 --dir ./widget --json
249
+ tender app init artifact_123 --dir ./widget --force --json`;
241
250
  }
242
251
  function artifactsContextFetchHelp() {
243
- return `Usage: tender artifacts context fetch <artifact-id> [--dir <path>] [--base-url <url>] [--token <token>] [--profile <name>] [--dry-run] [--force] [--json]
252
+ return `Usage: tender app context fetch <app-id> [--dir <path>] [--base-url <url>] [--token <token>] [--profile <name>] [--dry-run] [--force] [--json]
244
253
 
245
254
  Options:
246
255
  --dir <path> Local checkout to update. Defaults to current directory.
@@ -252,12 +261,12 @@ Options:
252
261
  --json Emit stable JSON for coding agents.
253
262
 
254
263
  Examples:
255
- tender artifacts context fetch artifact_123 --dir ./widget --dry-run --json
256
- tender artifacts context fetch artifact_123 --dir ./widget --force
257
- tender artifacts context fetch artifact_123 --profile agent --json`;
264
+ tender app context fetch artifact_123 --dir ./widget --dry-run --json
265
+ tender app context fetch artifact_123 --dir ./widget --force
266
+ tender app context fetch artifact_123 --profile agent --json`;
258
267
  }
259
268
  function artifactsContextStatusHelp() {
260
- return `Usage: tender artifacts context status <artifact-id> [--dir <path>] [--base-url <url>] [--token <token>] [--profile <name>] [--json]
269
+ return `Usage: tender app context status <app-id> [--dir <path>] [--base-url <url>] [--token <token>] [--profile <name>] [--json]
261
270
 
262
271
  Options:
263
272
  --dir <path> Local checkout to inspect. Defaults to current directory.
@@ -267,10 +276,10 @@ Options:
267
276
  --json Emit stable JSON for coding agents.
268
277
 
269
278
  Examples:
270
- tender artifacts context status artifact_123 --dir ./widget --json`;
279
+ tender app context status artifact_123 --dir ./widget --json`;
271
280
  }
272
281
  function artifactsContextRefreshHelp() {
273
- return `Usage: tender artifacts context refresh <artifact-id> [--dir <path>] [--base-url <url>] [--token <token>] [--profile <name>] [--dry-run] [--force] [--json]
282
+ return `Usage: tender app context refresh <app-id> [--dir <path>] [--base-url <url>] [--token <token>] [--profile <name>] [--dry-run] [--force] [--json]
274
283
 
275
284
  Options:
276
285
  --dir <path> Local checkout to update. Defaults to current directory.
@@ -282,22 +291,22 @@ Options:
282
291
  --json Emit stable JSON for coding agents.
283
292
 
284
293
  Examples:
285
- tender artifacts context refresh artifact_123 --dir ./widget --dry-run --json
286
- tender artifacts context refresh artifact_123 --dir ./widget --force`;
294
+ tender app context refresh artifact_123 --dir ./widget --dry-run --json
295
+ tender app context refresh artifact_123 --dir ./widget --force`;
287
296
  }
288
297
  function doctorHelp() {
289
- return `Usage: tender artifacts doctor [--dir <path>] [--json]
298
+ return `Usage: tender app doctor [--dir <path>] [--json]
290
299
 
291
300
  Options:
292
301
  --dir <path> Local Tender App checkout to inspect. Defaults to current directory.
293
302
  --json Emit stable JSON for coding agents.
294
303
 
295
304
  Examples:
296
- tender artifacts doctor --dir ./widget
297
- tender artifacts doctor --dir ./widget --json`;
305
+ tender app doctor --dir ./widget
306
+ tender app doctor --dir ./widget --json`;
298
307
  }
299
308
  function gitRemoteHelp() {
300
- return `Usage: tender artifacts git remote <artifact-id> [--base-url <url>] [--token <token>] [--profile <name>] [--ttl <7d|14d|30d>] [--json]
309
+ return `Usage: tender app git remote <app-id> [--base-url <url>] [--token <token>] [--profile <name>] [--ttl <7d|14d|30d>] [--json]
301
310
 
302
311
  Options:
303
312
  --base-url <url> Tender base URL. Defaults to TENDER_BASE_URL, saved profile base URL, or https://app.tenderprompt.com.
@@ -307,12 +316,12 @@ Options:
307
316
  --json Emit stable JSON for coding agents.
308
317
 
309
318
  Examples:
310
- tender artifacts git remote artifact_123 --ttl 7d --json
311
- tender artifacts git remote artifact_123 --profile publish --ttl 7d --json
312
- TENDER_API_TOKEN=tp_... tender artifacts git remote artifact_123 --base-url https://app.tenderprompt.com --json`;
319
+ tender app git remote artifact_123 --ttl 7d --json
320
+ tender app git remote artifact_123 --profile publish --ttl 7d --json
321
+ TENDER_API_TOKEN=tp_... tender app git remote artifact_123 --base-url https://app.tenderprompt.com --json`;
313
322
  }
314
323
  function gitSetupHelp() {
315
- return `Usage: tender artifacts git setup <artifact-id> [--dir <path>] [--remote <name>] [--base-url <url>] [--token <token>] [--profile <name>] [--ttl <7d|14d|30d>] [--dry-run] [--json]
324
+ return `Usage: tender app git setup <app-id> [--dir <path>] [--remote <name>] [--base-url <url>] [--token <token>] [--profile <name>] [--ttl <7d|14d|30d>] [--dry-run] [--json]
316
325
 
317
326
  Options:
318
327
  --dir <path> Local Git checkout to configure. Defaults to current directory.
@@ -325,26 +334,26 @@ Options:
325
334
  --json Emit stable JSON for coding agents.
326
335
 
327
336
  Examples:
328
- tender artifacts git setup artifact_123 --dir ./widget --json
329
- tender artifacts git setup artifact_123 --dir ./widget --remote tender --ttl 7d
330
- tender artifacts git setup artifact_123 --dir ./widget --dry-run --json`;
337
+ tender app git setup artifact_123 --dir ./widget --json
338
+ tender app git setup artifact_123 --dir ./widget --remote tender --ttl 7d
339
+ tender app git setup artifact_123 --dir ./widget --dry-run --json`;
331
340
  }
332
341
  function gitCredentialHelp() {
333
- return `Usage: tender artifacts git credential <artifact-id> [get|store|erase] [--base-url <url>] [--token <token>] [--profile <name>] [--ttl <7d|14d|30d>] [--remote-url <url>]
342
+ return `Usage: tender app git credential <app-id> [get|store|erase] [--base-url <url>] [--token <token>] [--profile <name>] [--ttl <7d|14d|30d>] [--remote-url <url>]
334
343
 
335
344
  This command is intended for Git's credential.helper protocol. It prints a
336
345
  Tender API-token username/password pair only for matching get requests. Do not
337
346
  run it manually unless you are debugging Git credential-helper behavior.
338
347
 
339
348
  Examples:
340
- tender artifacts git credential artifact_123 get
341
- tender artifacts git credential artifact_123 get --remote-url https://app.tenderprompt.com/git/artifacts/artifact_123.git`;
349
+ tender app git credential artifact_123 get
350
+ tender app git credential artifact_123 get --remote-url https://app.tenderprompt.com/git/artifacts/artifact_123.git`;
342
351
  }
343
352
  function previewRebuildHelp() {
344
- return `Usage: tender artifacts preview rebuild <artifact-id> [--commit <sha>] [--base-url <url>] [--token <token>] [--profile <name>] [--stream] [--json]
353
+ return `Usage: tender app preview rebuild <app-id> [--commit <sha>] [--base-url <url>] [--token <token>] [--profile <name>] [--stream] [--json]
345
354
 
346
355
  Options:
347
- --commit <sha> Rebuild preview only if the artifact workspace is at this Git commit.
356
+ --commit <sha> Rebuild preview only if the app workspace is at this Git commit.
348
357
  --base-url <url> Tender base URL. Defaults to TENDER_BASE_URL, saved profile base URL, or https://app.tenderprompt.com.
349
358
  --token <token> Tender API token. Defaults to TENDER_API_TOKEN or the saved profile token.
350
359
  --profile <name> Local config profile name. Defaults to the saved default profile.
@@ -352,11 +361,11 @@ Options:
352
361
  --json Emit stable JSON for coding agents.
353
362
 
354
363
  Examples:
355
- tender artifacts preview rebuild artifact_123 --commit $(git rev-parse HEAD) --stream --json
356
- tender artifacts preview rebuild artifact_123 --json`;
364
+ tender app preview rebuild artifact_123 --commit $(git rev-parse HEAD) --stream --json
365
+ tender app preview rebuild artifact_123 --json`;
357
366
  }
358
367
  function validateHelp() {
359
- return `Usage: tender artifacts validate <artifact-id> [--base-url <url>] [--token <token>] [--profile <name>] [--stream] [--json]
368
+ return `Usage: tender app validate <app-id> [--base-url <url>] [--token <token>] [--profile <name>] [--stream] [--json]
360
369
 
361
370
  Options:
362
371
  --base-url <url> Tender base URL. Defaults to TENDER_BASE_URL, saved profile base URL, or https://app.tenderprompt.com.
@@ -366,14 +375,14 @@ Options:
366
375
  --json Emit stable JSON for coding agents.
367
376
 
368
377
  Examples:
369
- tender artifacts validate artifact_123 --json
370
- tender artifacts validate artifact_123 --stream --json`;
378
+ tender app validate artifact_123 --json
379
+ tender app validate artifact_123 --stream --json`;
371
380
  }
372
381
  function buildHelp() {
373
- return `Usage: tender artifacts build <artifact-id> [--commit <sha>] [--base-url <url>] [--token <token>] [--profile <name>] [--stream] [--json]
382
+ return `Usage: tender app build <app-id> [--commit <sha>] [--base-url <url>] [--token <token>] [--profile <name>] [--stream] [--json]
374
383
 
375
384
  Options:
376
- --commit <sha> Build only if the artifact workspace is at this Git commit.
385
+ --commit <sha> Build only if the app workspace is at this Git commit.
377
386
  --base-url <url> Tender base URL. Defaults to TENDER_BASE_URL, saved profile base URL, or https://app.tenderprompt.com.
378
387
  --token <token> Tender API token. Defaults to TENDER_API_TOKEN or the saved profile token.
379
388
  --profile <name> Local config profile name. Defaults to the saved default profile.
@@ -381,11 +390,11 @@ Options:
381
390
  --json Emit stable JSON for coding agents.
382
391
 
383
392
  Examples:
384
- tender artifacts build artifact_123 --commit $(git rev-parse HEAD) --json
385
- tender artifacts build artifact_123 --stream --json`;
393
+ tender app build artifact_123 --commit $(git rev-parse HEAD) --json
394
+ tender app build artifact_123 --stream --json`;
386
395
  }
387
396
  function previewStatusHelp() {
388
- return `Usage: tender artifacts preview status <artifact-id> [--commit <sha> | --job <job-id>] [--base-url <url>] [--token <token>] [--profile <name>] [--json]
397
+ return `Usage: tender app preview status <app-id> [--commit <sha> | --job <job-id>] [--base-url <url>] [--token <token>] [--profile <name>] [--json]
389
398
 
390
399
  Options:
391
400
  --commit <sha> Show the latest preview job for one artifact Git commit.
@@ -396,11 +405,11 @@ Options:
396
405
  --json Emit stable JSON for coding agents.
397
406
 
398
407
  Examples:
399
- tender artifacts preview status artifact_123 --commit $(git rev-parse HEAD) --json
400
- tender artifacts preview status artifact_123 --job job_123 --json`;
408
+ tender app preview status artifact_123 --commit $(git rev-parse HEAD) --json
409
+ tender app preview status artifact_123 --job job_123 --json`;
401
410
  }
402
411
  function previewWatchHelp() {
403
- return `Usage: tender artifacts preview watch <artifact-id> [--commit <sha> | --job <job-id>] [--base-url <url>] [--token <token>] [--profile <name>] [--stream] [--json]
412
+ return `Usage: tender app preview watch <app-id> [--commit <sha> | --job <job-id>] [--base-url <url>] [--token <token>] [--profile <name>] [--stream] [--json]
404
413
 
405
414
  Options:
406
415
  --commit <sha> Watch the latest preview job for one artifact Git commit.
@@ -412,16 +421,16 @@ Options:
412
421
  --json Emit lifecycle events as JSON lines.
413
422
 
414
423
  Examples:
415
- tender artifacts preview watch artifact_123 --commit $(git rev-parse HEAD) --stream --json
416
- tender artifacts preview watch artifact_123 --job job_123 --stream --json`;
424
+ tender app preview watch artifact_123 --commit $(git rev-parse HEAD) --stream --json
425
+ tender app preview watch artifact_123 --job job_123 --stream --json`;
417
426
  }
418
427
  function publishHelp() {
419
- return `Usage: tender artifacts publish <artifact-id> (--dry-run | --confirm publish) [--commit <sha>] [--message <text>] [--base-url <url>] [--token <token>] [--profile <name>] [--stream] [--json]
428
+ return `Usage: tender app publish <app-id> (--dry-run | --confirm publish) [--commit <sha>] [--message <text>] [--base-url <url>] [--token <token>] [--profile <name>] [--stream] [--json]
420
429
 
421
430
  Options:
422
431
  --dry-run Show the publish request without calling the API.
423
432
  --confirm publish Required to call the production-facing publish API.
424
- --commit <sha> Publish only if the artifact workspace is at this Git commit.
433
+ --commit <sha> Publish only if the app workspace is at this Git commit.
425
434
  --message <text> Human audit message returned in CLI output.
426
435
  --base-url <url> Tender base URL. Defaults to TENDER_BASE_URL, saved profile base URL, or https://app.tenderprompt.com.
427
436
  --token <token> Tender API token. Defaults to TENDER_API_TOKEN or the saved profile token.
@@ -430,11 +439,11 @@ Options:
430
439
  --json Emit stable JSON for coding agents.
431
440
 
432
441
  Examples:
433
- tender artifacts publish artifact_123 --dry-run --json
434
- tender artifacts publish artifact_123 --commit $(git rev-parse HEAD) --confirm publish --stream --json`;
442
+ tender app publish artifact_123 --dry-run --json
443
+ tender app publish artifact_123 --commit $(git rev-parse HEAD) --confirm publish --stream --json`;
435
444
  }
436
445
  function publishStatusHelp() {
437
- return `Usage: tender artifacts publish status <artifact-id> --job <job-id> [--base-url <url>] [--token <token>] [--profile <name>] [--json]
446
+ return `Usage: tender app publish status <app-id> --job <job-id> [--base-url <url>] [--token <token>] [--profile <name>] [--json]
438
447
 
439
448
  Options:
440
449
  --job <job-id> Show one publish lifecycle job directly.
@@ -444,10 +453,10 @@ Options:
444
453
  --json Emit stable JSON for coding agents.
445
454
 
446
455
  Examples:
447
- tender artifacts publish status artifact_123 --job job_123 --json`;
456
+ tender app publish status artifact_123 --job job_123 --json`;
448
457
  }
449
458
  function publishWatchHelp() {
450
- return `Usage: tender artifacts publish watch <artifact-id> --job <job-id> [--base-url <url>] [--token <token>] [--profile <name>] [--stream] [--json]
459
+ return `Usage: tender app publish watch <app-id> --job <job-id> [--base-url <url>] [--token <token>] [--profile <name>] [--stream] [--json]
451
460
 
452
461
  Options:
453
462
  --job <job-id> Watch one publish lifecycle job directly.
@@ -458,7 +467,7 @@ Options:
458
467
  --json Emit lifecycle events as JSON lines.
459
468
 
460
469
  Examples:
461
- tender artifacts publish watch artifact_123 --job job_123 --stream --json`;
470
+ tender app publish watch artifact_123 --job job_123 --stream --json`;
462
471
  }
463
472
  function normalizeBaseUrl(value) {
464
473
  return (value ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
@@ -605,7 +614,7 @@ function parseGitRemoteArgs(args) {
605
614
  }
606
615
  const artifactId = args[0];
607
616
  if (!artifactId || artifactId.startsWith("-")) {
608
- throw new TenderCliUsageError("artifact id is required. Example: tender artifacts git remote <artifact-id> --json");
617
+ throw new TenderCliUsageError("app id is required. Example: tender app git remote <app-id> --json");
609
618
  }
610
619
  let baseUrl = null;
611
620
  let flagToken = null;
@@ -665,7 +674,7 @@ function parseGitSetupArgs(args) {
665
674
  }
666
675
  const artifactId = args[0];
667
676
  if (!artifactId || artifactId.startsWith("-")) {
668
- throw new TenderCliUsageError("artifact id is required. Example: tender artifacts git setup <artifact-id> --dir ./widget --json");
677
+ throw new TenderCliUsageError("app id is required. Example: tender app git setup <app-id> --dir ./widget --json");
669
678
  }
670
679
  let dir = ".";
671
680
  let remoteName = "tender";
@@ -758,7 +767,7 @@ function parseGitCredentialArgs(args) {
758
767
  }
759
768
  const artifactId = args[0];
760
769
  if (!artifactId || artifactId.startsWith("-")) {
761
- throw new TenderCliUsageError("artifact id is required. Example: tender artifacts git credential <artifact-id> get");
770
+ throw new TenderCliUsageError("app id is required. Example: tender app git credential <app-id> get");
762
771
  }
763
772
  const parsedOperation = parseGitCredentialOperation(args[1]);
764
773
  let operation = parsedOperation.operation;
@@ -832,7 +841,7 @@ function parseValidateArgs(args) {
832
841
  }
833
842
  const artifactId = args[0];
834
843
  if (!artifactId || artifactId.startsWith("-")) {
835
- throw new TenderCliUsageError("artifact id is required. Example: tender artifacts validate <artifact-id> --json");
844
+ throw new TenderCliUsageError("app id is required. Example: tender app validate <app-id> --json");
836
845
  }
837
846
  let baseUrl = null;
838
847
  let flagToken = null;
@@ -882,7 +891,7 @@ function parseBuildArgs(args) {
882
891
  }
883
892
  const artifactId = args[0];
884
893
  if (!artifactId || artifactId.startsWith("-")) {
885
- throw new TenderCliUsageError("artifact id is required. Example: tender artifacts build <artifact-id> --json");
894
+ throw new TenderCliUsageError("app id is required. Example: tender app build <app-id> --json");
886
895
  }
887
896
  let baseUrl = null;
888
897
  let flagToken = null;
@@ -943,7 +952,7 @@ function parsePreviewRebuildArgs(args) {
943
952
  }
944
953
  const artifactId = args[0];
945
954
  if (!artifactId || artifactId.startsWith("-")) {
946
- throw new TenderCliUsageError("artifact id is required. Example: tender artifacts preview rebuild <artifact-id> --stream --json");
955
+ throw new TenderCliUsageError("app id is required. Example: tender app preview rebuild <app-id> --stream --json");
947
956
  }
948
957
  let baseUrl = null;
949
958
  let flagToken = null;
@@ -1070,7 +1079,7 @@ function parsePreviewStatusArgs(args) {
1070
1079
  }
1071
1080
  const artifactId = args[0];
1072
1081
  if (!artifactId || artifactId.startsWith("-")) {
1073
- throw new TenderCliUsageError("artifact id is required. Example: tender artifacts preview status <artifact-id> --commit <sha> --json");
1082
+ throw new TenderCliUsageError("app id is required. Example: tender app preview status <app-id> --commit <sha> --json");
1074
1083
  }
1075
1084
  const options = readPreviewLookupOptions({
1076
1085
  args,
@@ -1078,7 +1087,7 @@ function parsePreviewStatusArgs(args) {
1078
1087
  commandName: "preview status",
1079
1088
  });
1080
1089
  if (options.stream) {
1081
- throw new TenderCliUsageError("preview status does not support --stream. Use tender artifacts preview watch.");
1090
+ throw new TenderCliUsageError("preview status does not support --stream. Use tender app preview watch.");
1082
1091
  }
1083
1092
  return {
1084
1093
  command: "artifacts preview status",
@@ -1097,7 +1106,7 @@ function parsePreviewWatchArgs(args) {
1097
1106
  }
1098
1107
  const artifactId = args[0];
1099
1108
  if (!artifactId || artifactId.startsWith("-")) {
1100
- throw new TenderCliUsageError("artifact id is required. Example: tender artifacts preview watch <artifact-id> --job <job-id> --stream --json");
1109
+ throw new TenderCliUsageError("app id is required. Example: tender app preview watch <app-id> --job <job-id> --stream --json");
1101
1110
  }
1102
1111
  const options = readPreviewLookupOptions({
1103
1112
  args,
@@ -1122,7 +1131,7 @@ function parsePublishArgs(args) {
1122
1131
  }
1123
1132
  const artifactId = args[0];
1124
1133
  if (!artifactId || artifactId.startsWith("-")) {
1125
- throw new TenderCliUsageError("artifact id is required. Example: tender artifacts publish <artifact-id> --dry-run --json");
1134
+ throw new TenderCliUsageError("app id is required. Example: tender app publish <app-id> --dry-run --json");
1126
1135
  }
1127
1136
  let baseUrl = null;
1128
1137
  let flagToken = null;
@@ -1269,7 +1278,7 @@ function parsePublishStatusArgs(args) {
1269
1278
  }
1270
1279
  const artifactId = args[0];
1271
1280
  if (!artifactId || artifactId.startsWith("-")) {
1272
- throw new TenderCliUsageError("artifact id is required. Example: tender artifacts publish status <artifact-id> --job <job-id> --json");
1281
+ throw new TenderCliUsageError("app id is required. Example: tender app publish status <app-id> --job <job-id> --json");
1273
1282
  }
1274
1283
  const options = readPublishJobLookupOptions({
1275
1284
  args,
@@ -1277,7 +1286,7 @@ function parsePublishStatusArgs(args) {
1277
1286
  commandName: "publish status",
1278
1287
  });
1279
1288
  if (options.stream) {
1280
- throw new TenderCliUsageError("publish status does not support --stream. Use tender artifacts publish watch.");
1289
+ throw new TenderCliUsageError("publish status does not support --stream. Use tender app publish watch.");
1281
1290
  }
1282
1291
  return {
1283
1292
  command: "artifacts publish status",
@@ -1295,7 +1304,7 @@ function parsePublishWatchArgs(args) {
1295
1304
  }
1296
1305
  const artifactId = args[0];
1297
1306
  if (!artifactId || artifactId.startsWith("-")) {
1298
- throw new TenderCliUsageError("artifact id is required. Example: tender artifacts publish watch <artifact-id> --job <job-id> --stream --json");
1307
+ throw new TenderCliUsageError("app id is required. Example: tender app publish watch <app-id> --job <job-id> --stream --json");
1299
1308
  }
1300
1309
  const options = readPublishJobLookupOptions({
1301
1310
  args,
@@ -1342,7 +1351,7 @@ function parseArtifactsListArgs(args) {
1342
1351
  index += 1;
1343
1352
  continue;
1344
1353
  }
1345
- throw new TenderCliUsageError(`Unknown artifacts list option: ${arg}`);
1354
+ throw new TenderCliUsageError(`Unknown app list option: ${arg}`);
1346
1355
  }
1347
1356
  return {
1348
1357
  command: "artifacts list",
@@ -1372,7 +1381,7 @@ function parseArtifactsCreateArgs(args) {
1372
1381
  if (arg === "--name") {
1373
1382
  const value = args[index + 1];
1374
1383
  if (!value || value.startsWith("-")) {
1375
- throw new TenderCliUsageError("--name requires an artifact name.");
1384
+ throw new TenderCliUsageError("--name requires an app name.");
1376
1385
  }
1377
1386
  name = value;
1378
1387
  index += 1;
@@ -1411,10 +1420,10 @@ function parseArtifactsCreateArgs(args) {
1411
1420
  index += 1;
1412
1421
  continue;
1413
1422
  }
1414
- throw new TenderCliUsageError(`Unknown artifacts create option: ${arg}`);
1423
+ throw new TenderCliUsageError(`Unknown app create option: ${arg}`);
1415
1424
  }
1416
1425
  if (!name.trim()) {
1417
- throw new TenderCliUsageError("--name is required. Example: tender artifacts create --name \"Exit Intent Widget\" --json");
1426
+ throw new TenderCliUsageError("--name is required. Example: tender app create --name \"Exit Intent Widget\" --json");
1418
1427
  }
1419
1428
  return {
1420
1429
  command: "artifacts create",
@@ -1433,7 +1442,7 @@ function parseArtifactsUpdateArgs(args) {
1433
1442
  }
1434
1443
  const artifactId = args[0];
1435
1444
  if (!artifactId || artifactId.startsWith("-")) {
1436
- throw new TenderCliUsageError("artifact id is required. Example: tender artifacts update <artifact-id> --name \"Sale Widget\" --json");
1445
+ throw new TenderCliUsageError("app id is required. Example: tender app update <app-id> --name \"Sale Widget\" --json");
1437
1446
  }
1438
1447
  let name = "";
1439
1448
  let baseUrl = null;
@@ -1449,7 +1458,7 @@ function parseArtifactsUpdateArgs(args) {
1449
1458
  if (arg === "--name") {
1450
1459
  const value = args[index + 1];
1451
1460
  if (!value || value.startsWith("-")) {
1452
- throw new TenderCliUsageError("--name requires an artifact name.");
1461
+ throw new TenderCliUsageError("--name requires an app name.");
1453
1462
  }
1454
1463
  name = value;
1455
1464
  index += 1;
@@ -1470,10 +1479,10 @@ function parseArtifactsUpdateArgs(args) {
1470
1479
  index += 1;
1471
1480
  continue;
1472
1481
  }
1473
- throw new TenderCliUsageError(`Unknown artifacts update option: ${arg}`);
1482
+ throw new TenderCliUsageError(`Unknown app update option: ${arg}`);
1474
1483
  }
1475
1484
  if (!name.trim()) {
1476
- throw new TenderCliUsageError("--name is required. Example: tender artifacts update artifact_123 --name \"Sale Widget\" --json");
1485
+ throw new TenderCliUsageError("--name is required. Example: tender app update artifact_123 --name \"Sale Widget\" --json");
1477
1486
  }
1478
1487
  return {
1479
1488
  command: "artifacts update",
@@ -1491,7 +1500,7 @@ function parseArtifactsInitArgs(args) {
1491
1500
  }
1492
1501
  const artifactId = args[0];
1493
1502
  if (!artifactId || artifactId.startsWith("-")) {
1494
- throw new TenderCliUsageError("artifact id is required. Example: tender artifacts init <artifact-id> --dir ./widget --json");
1503
+ throw new TenderCliUsageError("app id is required. Example: tender app init <app-id> --dir ./widget --json");
1495
1504
  }
1496
1505
  let dir = ".";
1497
1506
  let remoteName = "tender";
@@ -1550,7 +1559,7 @@ function parseArtifactsInitArgs(args) {
1550
1559
  index += 1;
1551
1560
  continue;
1552
1561
  }
1553
- throw new TenderCliUsageError(`Unknown artifacts init option: ${arg}`);
1562
+ throw new TenderCliUsageError(`Unknown app init option: ${arg}`);
1554
1563
  }
1555
1564
  return {
1556
1565
  command: "artifacts init",
@@ -1572,7 +1581,7 @@ function parseContextFetchArgs(args) {
1572
1581
  }
1573
1582
  const artifactId = args[0];
1574
1583
  if (!artifactId || artifactId.startsWith("-")) {
1575
- throw new TenderCliUsageError("artifact id is required. Example: tender artifacts context fetch <artifact-id> --dir ./widget --json");
1584
+ throw new TenderCliUsageError("app id is required. Example: tender app context fetch <app-id> --dir ./widget --json");
1576
1585
  }
1577
1586
  let dir = ".";
1578
1587
  let baseUrl = null;
@@ -1639,7 +1648,7 @@ function parseContextStatusArgs(args) {
1639
1648
  }
1640
1649
  const artifactId = args[0];
1641
1650
  if (!artifactId || artifactId.startsWith("-")) {
1642
- throw new TenderCliUsageError("artifact id is required. Example: tender artifacts context status <artifact-id> --dir ./widget --json");
1651
+ throw new TenderCliUsageError("app id is required. Example: tender app context status <app-id> --dir ./widget --json");
1643
1652
  }
1644
1653
  let dir = ".";
1645
1654
  let baseUrl = null;
@@ -1694,7 +1703,7 @@ function parseContextRefreshArgs(args) {
1694
1703
  }
1695
1704
  const artifactId = args[0];
1696
1705
  if (!artifactId || artifactId.startsWith("-")) {
1697
- throw new TenderCliUsageError("artifact id is required. Example: tender artifacts context refresh <artifact-id> --dir ./widget --dry-run --json");
1706
+ throw new TenderCliUsageError("app id is required. Example: tender app context refresh <app-id> --dir ./widget --dry-run --json");
1698
1707
  }
1699
1708
  let dir = ".";
1700
1709
  let baseUrl = null;
@@ -1889,81 +1898,95 @@ function parseTenderArgs(args) {
1889
1898
  }
1890
1899
  throw new TenderCliUsageError(`Unknown auth command: ${args[1]}`);
1891
1900
  }
1892
- if (args[0] !== "artifacts") {
1901
+ if (args[0] === "apps") {
1902
+ throw new TenderCliUsageError("Unknown command: apps. Use `tender app ...` for Tender App workflows.");
1903
+ }
1904
+ if (args[0] !== "artifacts" && args[0] !== "app") {
1893
1905
  throw new TenderCliUsageError(`Unknown command: ${args[0]}`);
1894
1906
  }
1895
- if (args[1] === undefined || args[1] === "--help" || args[1] === "-h") {
1907
+ const resourceArgs = normalizeAppArgs(args);
1908
+ const resourceName = args[0] === "app" ? "app" : "artifacts";
1909
+ if (resourceArgs[1] === undefined ||
1910
+ resourceArgs[1] === "--help" ||
1911
+ resourceArgs[1] === "-h") {
1896
1912
  return { command: "help", topic: "artifacts" };
1897
1913
  }
1898
- if (args[1] !== "doctor") {
1899
- if (args[1] === "list") {
1900
- return parseArtifactsListArgs(args.slice(2));
1914
+ if (resourceArgs[1] !== "doctor") {
1915
+ if (resourceArgs[1] === "list") {
1916
+ return parseArtifactsListArgs(resourceArgs.slice(2));
1901
1917
  }
1902
- if (args[1] === "create") {
1903
- return parseArtifactsCreateArgs(args.slice(2));
1918
+ if (resourceArgs[1] === "create") {
1919
+ return parseArtifactsCreateArgs(resourceArgs.slice(2));
1904
1920
  }
1905
- if (args[1] === "update") {
1906
- return parseArtifactsUpdateArgs(args.slice(2));
1921
+ if (resourceArgs[1] === "update") {
1922
+ return parseArtifactsUpdateArgs(resourceArgs.slice(2));
1907
1923
  }
1908
- if (args[1] === "init") {
1909
- return parseArtifactsInitArgs(args.slice(2));
1924
+ if (resourceArgs[1] === "init") {
1925
+ return parseArtifactsInitArgs(resourceArgs.slice(2));
1910
1926
  }
1911
- if (args[1] === "context" && args[2] === "fetch") {
1912
- return parseContextFetchArgs(args.slice(3));
1927
+ if (resourceArgs[1] === "context" && resourceArgs[2] === "fetch") {
1928
+ return parseContextFetchArgs(resourceArgs.slice(3));
1913
1929
  }
1914
- if (args[1] === "context" && args[2] === "status") {
1915
- return parseContextStatusArgs(args.slice(3));
1930
+ if (resourceArgs[1] === "context" && resourceArgs[2] === "status") {
1931
+ return parseContextStatusArgs(resourceArgs.slice(3));
1916
1932
  }
1917
- if (args[1] === "context" && args[2] === "refresh") {
1918
- return parseContextRefreshArgs(args.slice(3));
1933
+ if (resourceArgs[1] === "context" && resourceArgs[2] === "refresh") {
1934
+ return parseContextRefreshArgs(resourceArgs.slice(3));
1919
1935
  }
1920
- if (args[1] === "context" &&
1921
- (args[2] === undefined || args[2] === "--help" || args[2] === "-h")) {
1936
+ if (resourceArgs[1] === "context" &&
1937
+ (resourceArgs[2] === undefined ||
1938
+ resourceArgs[2] === "--help" ||
1939
+ resourceArgs[2] === "-h")) {
1922
1940
  return { command: "help", topic: "artifacts" };
1923
1941
  }
1924
- if (args[1] === "git" && args[2] === "remote") {
1925
- return parseGitRemoteArgs(args.slice(3));
1942
+ if (resourceArgs[1] === "git" && resourceArgs[2] === "remote") {
1943
+ return parseGitRemoteArgs(resourceArgs.slice(3));
1926
1944
  }
1927
- if (args[1] === "git" && args[2] === "setup") {
1928
- return parseGitSetupArgs(args.slice(3));
1945
+ if (resourceArgs[1] === "git" && resourceArgs[2] === "setup") {
1946
+ return parseGitSetupArgs(resourceArgs.slice(3));
1929
1947
  }
1930
- if (args[1] === "git" && args[2] === "credential") {
1931
- return parseGitCredentialArgs(args.slice(3));
1948
+ if (resourceArgs[1] === "git" && resourceArgs[2] === "credential") {
1949
+ return parseGitCredentialArgs(resourceArgs.slice(3));
1932
1950
  }
1933
- if (args[1] === "validate") {
1934
- return parseValidateArgs(args.slice(2));
1951
+ if (resourceArgs[1] === "validate") {
1952
+ return parseValidateArgs(resourceArgs.slice(2));
1935
1953
  }
1936
- if (args[1] === "build") {
1937
- return parseBuildArgs(args.slice(2));
1954
+ if (resourceArgs[1] === "build") {
1955
+ return parseBuildArgs(resourceArgs.slice(2));
1938
1956
  }
1939
- if (args[1] === "preview" && args[2] === "rebuild") {
1940
- return parsePreviewRebuildArgs(args.slice(3));
1957
+ if (resourceArgs[1] === "preview" && resourceArgs[2] === "rebuild") {
1958
+ return parsePreviewRebuildArgs(resourceArgs.slice(3));
1941
1959
  }
1942
- if (args[1] === "preview" && args[2] === "status") {
1943
- return parsePreviewStatusArgs(args.slice(3));
1960
+ if (resourceArgs[1] === "preview" && resourceArgs[2] === "status") {
1961
+ return parsePreviewStatusArgs(resourceArgs.slice(3));
1944
1962
  }
1945
- if (args[1] === "preview" && args[2] === "watch") {
1946
- return parsePreviewWatchArgs(args.slice(3));
1963
+ if (resourceArgs[1] === "preview" && resourceArgs[2] === "watch") {
1964
+ return parsePreviewWatchArgs(resourceArgs.slice(3));
1947
1965
  }
1948
- if (args[1] === "preview" &&
1949
- (args[2] === undefined || args[2] === "--help" || args[2] === "-h")) {
1966
+ if (resourceArgs[1] === "preview" &&
1967
+ (resourceArgs[2] === undefined ||
1968
+ resourceArgs[2] === "--help" ||
1969
+ resourceArgs[2] === "-h")) {
1950
1970
  return { command: "help", topic: "artifacts" };
1951
1971
  }
1952
- if (args[1] === "publish" && args[2] === "status") {
1953
- return parsePublishStatusArgs(args.slice(3));
1972
+ if (resourceArgs[1] === "publish" && resourceArgs[2] === "status") {
1973
+ return parsePublishStatusArgs(resourceArgs.slice(3));
1954
1974
  }
1955
- if (args[1] === "publish" && args[2] === "watch") {
1956
- return parsePublishWatchArgs(args.slice(3));
1975
+ if (resourceArgs[1] === "publish" && resourceArgs[2] === "watch") {
1976
+ return parsePublishWatchArgs(resourceArgs.slice(3));
1957
1977
  }
1958
- if (args[1] === "publish") {
1959
- return parsePublishArgs(args.slice(2));
1978
+ if (resourceArgs[1] === "publish") {
1979
+ return parsePublishArgs(resourceArgs.slice(2));
1960
1980
  }
1961
- if (args[1] === "git" && (args[2] === undefined || args[2] === "--help" || args[2] === "-h")) {
1981
+ if (resourceArgs[1] === "git" &&
1982
+ (resourceArgs[2] === undefined ||
1983
+ resourceArgs[2] === "--help" ||
1984
+ resourceArgs[2] === "-h")) {
1962
1985
  return { command: "help", topic: "artifacts" };
1963
1986
  }
1964
- throw new TenderCliUsageError(`Unknown artifacts command: ${args[1]}`);
1987
+ throw new TenderCliUsageError(`Unknown ${resourceName} command: ${resourceArgs[1]}`);
1965
1988
  }
1966
- const rest = args.slice(2);
1989
+ const rest = resourceArgs.slice(2);
1967
1990
  if (rest.includes("--help") || rest.includes("-h")) {
1968
1991
  return { command: "help", topic: "artifacts doctor" };
1969
1992
  }
@@ -1992,11 +2015,26 @@ function parseTenderArgs(args) {
1992
2015
  json,
1993
2016
  };
1994
2017
  }
2018
+ function normalizeAppArgs(args) {
2019
+ if (args[0] !== "app") {
2020
+ return args;
2021
+ }
2022
+ if (args[1] === "preview" &&
2023
+ args[2] &&
2024
+ args[2] !== "rebuild" &&
2025
+ args[2] !== "status" &&
2026
+ args[2] !== "watch" &&
2027
+ args[2] !== "--help" &&
2028
+ args[2] !== "-h") {
2029
+ return ["artifacts", "preview", "rebuild", ...args.slice(2)];
2030
+ }
2031
+ return ["artifacts", ...args.slice(1)];
2032
+ }
1995
2033
  function formatDoctorHuman(result) {
1996
2034
  if (result.diagnostics.length === 0) {
1997
2035
  return result.ok
1998
- ? "Tender artifacts doctor passed."
1999
- : "Tender artifacts doctor failed.";
2036
+ ? "Tender app doctor passed."
2037
+ : "Tender app doctor failed.";
2000
2038
  }
2001
2039
  return result.diagnostics
2002
2040
  .map((diagnostic) => {
@@ -2377,7 +2415,7 @@ async function runAuthStatus(command, io, runtime) {
2377
2415
  `base_url: ${profile.baseUrl}`,
2378
2416
  `token_prefix: ${profile.tokenPrefix ?? "(unknown)"}`,
2379
2417
  `tenant_id: ${profile.tenantId ?? "(unknown)"}`,
2380
- `artifact_id: ${profile.artifactId ?? "(account)"}`,
2418
+ `app_id: ${profile.artifactId ?? "(account)"}`,
2381
2419
  `permissions: ${(profile.permissions ?? []).join(" ") || "(unknown)"}`,
2382
2420
  `expires_at: ${formatExpiry(profile.expiresAt) ?? "(unknown)"}`,
2383
2421
  ].join("\n"));
@@ -2502,7 +2540,7 @@ async function runAuthLogin(command, io, runtime) {
2502
2540
  "authenticated: true",
2503
2541
  `profile: ${command.saveProfile}`,
2504
2542
  `tenant_id: ${result.tenantId ?? "(unknown)"}`,
2505
- `artifact_id: ${result.artifactId ?? "(account)"}`,
2543
+ `app_id: ${result.artifactId ?? "(account)"}`,
2506
2544
  `permissions: ${result.permissions.join(" ") || "(unknown)"}`,
2507
2545
  `expires_at: ${result.expiresAt ?? "(unknown)"}`,
2508
2546
  ].join("\n"));
@@ -2706,7 +2744,7 @@ async function runArtifactsList(command, io, runtime) {
2706
2744
  io.stdout(JSON.stringify(result, null, 2));
2707
2745
  }
2708
2746
  else if (payload.artifacts.length === 0) {
2709
- io.stdout("No artifacts found.");
2747
+ io.stdout("No Tender App records found.");
2710
2748
  }
2711
2749
  else {
2712
2750
  io.stdout(payload.artifacts
@@ -2758,10 +2796,11 @@ async function runArtifactsCreate(command, io, runtime) {
2758
2796
  authSource: credentials.source,
2759
2797
  profile: credentials.profileName,
2760
2798
  tenantId: payload.tenantId ?? null,
2799
+ appId: payload.artifact.artifactId,
2761
2800
  artifact: payload.artifact,
2762
2801
  next: {
2763
- contextFetch: `tender artifacts context fetch ${payload.artifact.artifactId} --dir .`,
2764
- gitSetup: `tender artifacts git setup ${payload.artifact.artifactId} --dir .`,
2802
+ contextFetch: `tender app context fetch ${payload.artifact.artifactId} --dir .`,
2803
+ gitSetup: `tender app git setup ${payload.artifact.artifactId} --dir .`,
2765
2804
  },
2766
2805
  };
2767
2806
  if (command.json) {
@@ -2769,7 +2808,7 @@ async function runArtifactsCreate(command, io, runtime) {
2769
2808
  }
2770
2809
  else {
2771
2810
  io.stdout([
2772
- `artifact_id: ${payload.artifact.artifactId}`,
2811
+ `app_id: ${payload.artifact.artifactId}`,
2773
2812
  `name: ${payload.artifact.name}`,
2774
2813
  `preview_url: ${payload.artifact.previewUrl ?? ""}`,
2775
2814
  `next: ${result.next.contextFetch}`,
@@ -2806,6 +2845,7 @@ async function runArtifactsUpdate(command, io, runtime) {
2806
2845
  authSource: credentials.source,
2807
2846
  profile: credentials.profileName,
2808
2847
  tenantId: payload.tenantId ?? null,
2848
+ appId: payload.artifact.artifactId,
2809
2849
  artifact: payload.artifact,
2810
2850
  };
2811
2851
  if (command.json) {
@@ -2813,7 +2853,7 @@ async function runArtifactsUpdate(command, io, runtime) {
2813
2853
  }
2814
2854
  else {
2815
2855
  io.stdout([
2816
- `artifact_id: ${payload.artifact.artifactId}`,
2856
+ `app_id: ${payload.artifact.artifactId}`,
2817
2857
  `name: ${payload.artifact.name}`,
2818
2858
  ].join("\n"));
2819
2859
  }
@@ -3508,6 +3548,7 @@ async function runArtifactsInit(command, io, runtime) {
3508
3548
  ok: true,
3509
3549
  command: command.command,
3510
3550
  artifactId: command.artifactId,
3551
+ appId: command.artifactId,
3511
3552
  revision: context.revision,
3512
3553
  dir: root,
3513
3554
  remoteName: command.remoteName,
@@ -3545,7 +3586,7 @@ async function runArtifactsInit(command, io, runtime) {
3545
3586
  }
3546
3587
  else {
3547
3588
  io.stdout([
3548
- `artifact_id: ${command.artifactId}`,
3589
+ `app_id: ${command.artifactId}`,
3549
3590
  `context_revision: ${context.revision}`,
3550
3591
  `dir: ${root}`,
3551
3592
  `remote: ${command.remoteName}`,
@@ -3608,6 +3649,7 @@ async function postLifecycle(input) {
3608
3649
  authSource: credentials.source,
3609
3650
  profile: credentials.profileName,
3610
3651
  artifactId: input.command.artifactId,
3652
+ appId: input.command.artifactId,
3611
3653
  operation: payload.operation ?? input.operation,
3612
3654
  job: payload.job ?? null,
3613
3655
  result: payload.result ?? null,
@@ -3617,7 +3659,7 @@ async function postLifecycle(input) {
3617
3659
  }
3618
3660
  else {
3619
3661
  input.io.stdout([
3620
- `artifact_id: ${input.command.artifactId}`,
3662
+ `app_id: ${input.command.artifactId}`,
3621
3663
  `operation: ${result.operation}`,
3622
3664
  "status: completed",
3623
3665
  ].join("\n"));
@@ -3731,7 +3773,7 @@ async function runPreviewStatus(command, io, runtime) {
3731
3773
  }
3732
3774
  else {
3733
3775
  io.stdout([
3734
- `artifact_id: ${command.artifactId}`,
3776
+ `app_id: ${command.artifactId}`,
3735
3777
  `job_id: ${job.jobId}`,
3736
3778
  `status: ${result.status ?? "unknown"}`,
3737
3779
  ...(result.previewUrl ? [`preview_url: ${result.previewUrl}`] : []),
@@ -3801,6 +3843,7 @@ async function runPublish(command, io, runtime) {
3801
3843
  ok: true,
3802
3844
  command: command.command,
3803
3845
  artifactId: command.artifactId,
3846
+ appId: command.artifactId,
3804
3847
  commitSha: command.commitSha,
3805
3848
  dryRun: true,
3806
3849
  confirmed: false,
@@ -3820,7 +3863,7 @@ async function runPublish(command, io, runtime) {
3820
3863
  }
3821
3864
  else {
3822
3865
  io.stdout([
3823
- `artifact_id: ${command.artifactId}`,
3866
+ `app_id: ${command.artifactId}`,
3824
3867
  "dry_run: true",
3825
3868
  "next: rerun with --confirm publish to publish.",
3826
3869
  ].join("\n"));
@@ -3880,7 +3923,7 @@ async function runPublishStatus(command, io, runtime) {
3880
3923
  }
3881
3924
  else {
3882
3925
  io.stdout([
3883
- `artifact_id: ${command.artifactId}`,
3926
+ `app_id: ${command.artifactId}`,
3884
3927
  `job_id: ${job.jobId}`,
3885
3928
  `status: ${result.status ?? "unknown"}`,
3886
3929
  ...(result.publishedUrl
@@ -4146,7 +4189,7 @@ export async function runTenderCli(args, io = {
4146
4189
  }
4147
4190
  const currentFile = fileURLToPath(import.meta.url);
4148
4191
  function shouldReadEntrypointStdin(args) {
4149
- return (args[0] === "artifacts" &&
4192
+ return ((args[0] === "artifacts" || args[0] === "app") &&
4150
4193
  args[1] === "git" &&
4151
4194
  args[2] === "credential");
4152
4195
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenderprompt/cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "tender": "./bin/tender.js"
@@ -23,7 +23,7 @@
23
23
  "prepack": "yarn build"
24
24
  },
25
25
  "dependencies": {
26
- "@tenderprompt/tender-app-validator": "0.1.1"
26
+ "@tenderprompt/tender-app-validator": "0.1.2"
27
27
  },
28
28
  "engines": {
29
29
  "node": ">=20"