bdy 1.25.31 → 1.25.33-dev

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.25.31",
4
+ "version": "1.25.33-dev",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "homepage": "https://buddy.works/docs/cli",
@@ -750,6 +750,67 @@ class ApiClient {
750
750
  ...line,
751
751
  });
752
752
  }
753
+ // Variable methods
754
+ variableScopeQuery(scope) {
755
+ const query = {};
756
+ if (scope.project)
757
+ query.project_name = scope.project;
758
+ if (scope.pipelineId)
759
+ query.pipeline_id = scope.pipelineId.toString();
760
+ if (scope.environmentId)
761
+ query.environment_id = scope.environmentId;
762
+ if (scope.sandboxId)
763
+ query.sandbox_id = scope.sandboxId;
764
+ return query;
765
+ }
766
+ async getVariables(workspace, scope = {}) {
767
+ return await this.request({
768
+ method: 'GET',
769
+ path: `/workspaces/${encodeURIComponent(workspace)}/variables`,
770
+ query: this.variableScopeQuery(scope),
771
+ parseResponseBody: true,
772
+ });
773
+ }
774
+ async getVariable(workspace, variableId) {
775
+ return await this.request({
776
+ method: 'GET',
777
+ path: `/workspaces/${encodeURIComponent(workspace)}/variables/${encodeURIComponent(variableId)}`,
778
+ parseResponseBody: true,
779
+ });
780
+ }
781
+ // The scope goes in the body as the owning object, not as query params
782
+ async createVariable(workspace, scope, body) {
783
+ const data = { ...body };
784
+ if (scope.pipelineId)
785
+ data.pipeline = { id: scope.pipelineId };
786
+ else if (scope.environmentId)
787
+ data.environment = { id: scope.environmentId };
788
+ else if (scope.sandboxId)
789
+ data.sandbox = { id: scope.sandboxId };
790
+ else if (scope.project)
791
+ data.project = { name: scope.project };
792
+ return await this.request({
793
+ method: 'POST',
794
+ path: `/workspaces/${encodeURIComponent(workspace)}/variables`,
795
+ body: data,
796
+ parseResponseBody: true,
797
+ });
798
+ }
799
+ async updateVariable(workspace, variableId, body) {
800
+ return await this.request({
801
+ method: 'PATCH',
802
+ path: `/workspaces/${encodeURIComponent(workspace)}/variables/${encodeURIComponent(variableId)}`,
803
+ body,
804
+ parseResponseBody: true,
805
+ });
806
+ }
807
+ async deleteVariable(workspace, variableId) {
808
+ return await this.request({
809
+ method: 'DELETE',
810
+ path: `/workspaces/${encodeURIComponent(workspace)}/variables/${encodeURIComponent(variableId)}`,
811
+ parseResponseBody: false,
812
+ });
813
+ }
753
814
  // Environment methods
754
815
  async getEnvironments(workspace, project) {
755
816
  const query = {};
@@ -28,6 +28,7 @@ const distro_1 = __importDefault(require("./command/distro"));
28
28
  const target_1 = __importDefault(require("./command/target"));
29
29
  const environment_1 = __importDefault(require("./command/environment"));
30
30
  const integration_1 = __importDefault(require("./command/integration"));
31
+ const variable_1 = __importDefault(require("./command/variable"));
31
32
  const register_1 = __importDefault(require("./command/register"));
32
33
  const mcp_1 = __importDefault(require("./command/mcp"));
33
34
  const discover_1 = __importDefault(require("./command/discover"));
@@ -68,6 +69,7 @@ function cliIndex() {
68
69
  program.addCommand(target_1.default);
69
70
  program.addCommand(environment_1.default);
70
71
  program.addCommand(integration_1.default);
72
+ program.addCommand(variable_1.default);
71
73
  program.addCommand(login_1.default);
72
74
  program.addCommand(register_1.default);
73
75
  program.addCommand(whoami_1.default);
@@ -5,314 +5,434 @@ exports.INTEGRATION_TYPE_CATALOG = [
5
5
  {
6
6
  type: 'GIT_HUB',
7
7
  name: 'GitHub',
8
- group: 'GIT',
8
+ groups: ['GIT'],
9
9
  description: 'GitHub repositories as project sources, PR and commit statuses',
10
10
  },
11
11
  {
12
12
  type: 'GIT_HUB_ENTERPRISE',
13
13
  name: 'GitHub EE',
14
- group: 'GIT',
14
+ groups: ['GIT'],
15
15
  description: 'Self-hosted GitHub Enterprise repositories as project sources',
16
16
  },
17
17
  {
18
18
  type: 'GIT_LAB',
19
19
  name: 'GitLab',
20
- group: 'GIT',
20
+ groups: ['GIT', 'MCP'],
21
21
  description: 'GitLab repositories as project sources',
22
22
  },
23
23
  {
24
24
  type: 'GIT_LAB_ENTERPRISE',
25
25
  name: 'GitLab EE/CE',
26
- group: 'GIT',
26
+ groups: ['GIT'],
27
27
  description: 'Self-hosted GitLab repositories as project sources',
28
28
  },
29
29
  {
30
30
  type: 'BITBUCKET',
31
31
  name: 'Bitbucket',
32
- group: 'GIT',
32
+ groups: ['GIT', 'MCP'],
33
33
  description: 'Bitbucket repositories as project sources',
34
34
  },
35
35
  {
36
36
  type: 'AMAZON',
37
37
  name: 'Amazon Web Services',
38
- group: 'IAAS',
38
+ groups: ['IAAS'],
39
39
  description: 'Deploy to AWS: S3, EC2, ECS, EKS, Lambda, Elastic Beanstalk, CloudFront and more',
40
40
  },
41
41
  {
42
42
  type: 'AZURE_CLOUD',
43
43
  name: 'Azure',
44
- group: 'IAAS',
44
+ groups: ['IAAS'],
45
45
  description: 'Deploy to Microsoft Azure: App Service, AKS, Storage, Azure CLI',
46
46
  },
47
47
  {
48
48
  type: 'GOOGLE_SERVICE_ACCOUNT',
49
49
  name: 'Google Cloud',
50
- group: 'IAAS',
50
+ groups: ['IAAS'],
51
51
  description: 'Deploy to Google Cloud: GKE, Cloud Run, App Engine, Cloud Storage, gcloud CLI',
52
52
  },
53
53
  {
54
54
  type: 'GOOGLE_PLAY_STORE',
55
55
  name: 'Google Play Store',
56
- group: 'IAAS',
56
+ groups: ['IAAS'],
57
57
  description: 'Publish Android apps to Google Play',
58
58
  },
59
59
  {
60
60
  type: 'DIGITAL_OCEAN',
61
61
  name: 'DigitalOcean',
62
- group: 'IAAS',
62
+ groups: ['IAAS', 'MCP'],
63
63
  description: 'Deploy to DigitalOcean droplets, Kubernetes and App Platform',
64
64
  },
65
65
  {
66
66
  type: 'VULTR',
67
67
  name: 'Vultr',
68
- group: 'IAAS',
68
+ groups: ['IAAS'],
69
69
  description: 'Deploy to Vultr servers',
70
70
  },
71
71
  {
72
72
  type: 'UPCLOUD',
73
73
  name: 'UpCloud',
74
- group: 'IAAS',
74
+ groups: ['IAAS'],
75
75
  description: 'Deploy to UpCloud servers',
76
76
  },
77
77
  {
78
78
  type: 'BACKBLAZE',
79
79
  name: 'Backblaze',
80
- group: 'IAAS',
80
+ groups: ['IAAS'],
81
81
  description: 'Upload files to Backblaze B2 storage',
82
82
  },
83
83
  {
84
84
  type: 'HEROKU',
85
85
  name: 'Heroku',
86
- group: 'PAAS',
86
+ groups: ['PAAS'],
87
87
  description: 'Deploy apps to Heroku',
88
88
  },
89
89
  {
90
90
  type: 'NETLIFY',
91
91
  name: 'Netlify',
92
- group: 'PAAS',
92
+ groups: ['PAAS', 'MCP'],
93
93
  description: 'Deploy sites to Netlify',
94
94
  },
95
95
  {
96
96
  type: 'CLOUDFLARE',
97
97
  name: 'Cloudflare',
98
- group: 'PAAS',
98
+ groups: ['PAAS', 'MCP'],
99
99
  description: 'Purge Cloudflare cache, deploy Workers and Pages',
100
100
  },
101
101
  {
102
102
  type: 'FIREBASE',
103
103
  name: 'Firebase',
104
- group: 'PAAS',
104
+ groups: ['PAAS'],
105
105
  description: 'Deploy to Firebase Hosting and run the Firebase CLI',
106
106
  },
107
107
  {
108
108
  type: 'DO_SPACES',
109
109
  name: 'DigitalOcean Spaces',
110
- group: 'PAAS',
110
+ groups: ['PAAS'],
111
111
  description: 'Upload files to DigitalOcean Spaces',
112
112
  },
113
113
  {
114
114
  type: 'RACKSPACE',
115
115
  name: 'Rackspace',
116
- group: 'PAAS',
116
+ groups: ['PAAS'],
117
117
  description: 'Upload files to Rackspace Cloud Files',
118
118
  },
119
119
  {
120
120
  type: 'SHOPIFY',
121
121
  name: 'Shopify',
122
- group: 'PAAS',
122
+ groups: ['PAAS'],
123
123
  description: 'Deploy themes to Shopify stores',
124
124
  },
125
125
  {
126
126
  type: 'CONTENTFUL',
127
127
  name: 'Contentful',
128
- group: 'PAAS',
128
+ groups: ['PAAS', 'MCP'],
129
129
  description: 'Run Contentful CLI and migrations, trigger pipelines on content changes',
130
130
  },
131
131
  {
132
132
  type: 'JIRA',
133
133
  name: 'Jira',
134
- group: 'PAAS',
134
+ groups: ['PAAS', 'MCP'],
135
135
  description: 'Update Jira issues from pipelines',
136
136
  },
137
137
  {
138
138
  type: 'BLACKFIRE',
139
139
  name: 'Blackfire',
140
- group: 'PAAS',
140
+ groups: ['PAAS'],
141
141
  description: 'Run Blackfire performance tests',
142
142
  },
143
+ {
144
+ type: 'WIX',
145
+ name: 'Wix',
146
+ groups: ['PAAS', 'MCP'],
147
+ description: 'Wix MCP server for AI actions',
148
+ },
149
+ {
150
+ type: 'WEBFLOW',
151
+ name: 'Webflow',
152
+ groups: ['PAAS', 'MCP'],
153
+ description: 'Webflow MCP server for AI actions',
154
+ },
155
+ {
156
+ type: 'NEON',
157
+ name: 'Neon',
158
+ groups: ['PAAS', 'MCP'],
159
+ description: 'Neon MCP server for AI actions',
160
+ },
161
+ {
162
+ type: 'VERCEL',
163
+ name: 'Vercel',
164
+ groups: ['PAAS', 'MCP'],
165
+ description: 'Vercel MCP server for AI actions',
166
+ },
167
+ {
168
+ type: 'SUPABASE',
169
+ name: 'Supabase',
170
+ groups: ['PAAS', 'MCP'],
171
+ description: 'Supabase MCP server for AI actions',
172
+ },
143
173
  {
144
174
  type: 'SLACK',
145
175
  name: 'Slack',
146
- group: 'NOTIFICATION',
176
+ groups: ['NOTIFICATION'],
147
177
  description: 'Send pipeline notifications to Slack channels',
148
178
  },
149
179
  {
150
180
  type: 'TELEGRAM',
151
181
  name: 'Telegram',
152
- group: 'NOTIFICATION',
182
+ groups: ['NOTIFICATION'],
153
183
  description: 'Send pipeline notifications to Telegram chats',
154
184
  },
155
185
  {
156
186
  type: 'PUSHOVER',
157
187
  name: 'Pushover',
158
- group: 'NOTIFICATION',
188
+ groups: ['NOTIFICATION'],
159
189
  description: 'Send push notifications through Pushover',
160
190
  },
161
191
  {
162
192
  type: 'PUSHBULLET',
163
193
  name: 'Pushbullet',
164
- group: 'NOTIFICATION',
194
+ groups: ['NOTIFICATION'],
165
195
  description: 'Send push notifications through Pushbullet',
166
196
  },
167
197
  {
168
198
  type: 'SENTRY',
169
199
  name: 'Sentry',
170
- group: 'MONITORING',
200
+ groups: ['MONITORING', 'MCP'],
171
201
  description: 'Create Sentry releases, trigger pipelines on Sentry events',
172
202
  },
173
203
  {
174
204
  type: 'SENTRY_ENTERPRISE',
175
205
  name: 'Sentry Self-Hosted',
176
- group: 'MONITORING',
206
+ groups: ['MONITORING'],
177
207
  description: 'Create releases in a self-hosted Sentry',
178
208
  },
179
209
  {
180
210
  type: 'NEW_RELIC',
181
211
  name: 'New Relic',
182
- group: 'MONITORING',
212
+ groups: ['MONITORING'],
183
213
  description: 'Record deployments in New Relic',
184
214
  },
185
215
  {
186
216
  type: 'ROLLBAR',
187
217
  name: 'Rollbar',
188
- group: 'MONITORING',
218
+ groups: ['MONITORING'],
189
219
  description: 'Record deployments in Rollbar',
190
220
  },
191
221
  {
192
222
  type: 'DATADOG',
193
223
  name: 'Datadog',
194
- group: 'MONITORING',
224
+ groups: ['MONITORING'],
195
225
  description: 'Send deployment events to Datadog',
196
226
  },
197
227
  {
198
228
  type: 'HONEYBADGER',
199
229
  name: 'Honeybadger',
200
- group: 'MONITORING',
230
+ groups: ['MONITORING'],
201
231
  description: 'Record deployments in Honeybadger',
202
232
  },
203
233
  {
204
234
  type: 'LOGGLY',
205
235
  name: 'Loggly',
206
- group: 'MONITORING',
236
+ groups: ['MONITORING'],
207
237
  description: 'Send pipeline logs and events to Loggly',
208
238
  },
239
+ {
240
+ type: 'AMPLITUDE',
241
+ name: 'Amplitude',
242
+ groups: ['MONITORING', 'MCP'],
243
+ description: 'Amplitude MCP server for AI actions',
244
+ },
245
+ {
246
+ type: 'POSTHOG',
247
+ name: 'PostHog',
248
+ groups: ['MONITORING', 'MCP'],
249
+ description: 'PostHog MCP server for AI actions',
250
+ },
209
251
  {
210
252
  type: 'ANTHROPIC',
211
253
  name: 'Anthropic',
212
- group: 'AI',
254
+ groups: ['AI'],
213
255
  description: 'Claude API key for AI actions and agents',
214
256
  },
215
257
  {
216
258
  type: 'OPEN_AI',
217
259
  name: 'OpenAI',
218
- group: 'AI',
260
+ groups: ['AI'],
219
261
  description: 'OpenAI API key for AI actions and agents',
220
262
  },
221
263
  {
222
264
  type: 'GOOGLE_GEMINI',
223
265
  name: 'Google Gemini',
224
- group: 'AI',
266
+ groups: ['AI'],
225
267
  description: 'Gemini API key for AI actions and agents',
226
268
  },
227
269
  {
228
270
  type: 'GROK',
229
271
  name: 'Grok',
230
- group: 'AI',
272
+ groups: ['AI'],
231
273
  description: 'xAI Grok API key for AI actions and agents',
232
274
  },
233
275
  {
234
276
  type: 'CURSOR',
235
277
  name: 'Cursor',
236
- group: 'AI',
278
+ groups: ['AI'],
237
279
  description: 'Cursor API key for Cursor agents in pipelines',
238
280
  },
239
281
  {
240
282
  type: 'OPENCODE',
241
283
  name: 'opencode',
242
- group: 'AI',
284
+ groups: ['AI'],
243
285
  description: 'opencode API key for opencode agents in pipelines',
244
286
  },
245
287
  {
246
288
  type: 'TYPESAFE',
247
289
  name: 'TypeSafe',
248
- group: 'AI',
290
+ groups: ['AI'],
249
291
  description: 'TypeSafe API key for AI judgments in pipelines',
250
292
  },
251
293
  {
252
294
  type: 'DOCKER_HUB',
253
295
  name: 'Docker Hub',
254
- group: 'OTHER',
296
+ groups: ['OTHER'],
255
297
  description: 'Pull and push images in Docker Hub',
256
298
  },
257
299
  {
258
300
  type: 'NPM_REGISTRY',
259
301
  name: 'npm',
260
- group: 'OTHER',
302
+ groups: ['OTHER'],
261
303
  description: 'Publish and install packages from an npm registry',
262
304
  },
263
305
  {
264
306
  type: 'APP_STORE',
265
307
  name: 'App Store',
266
- group: 'OTHER',
308
+ groups: ['OTHER'],
267
309
  description: 'Publish iOS apps to App Store Connect and TestFlight',
268
310
  },
269
311
  {
270
312
  type: 'SNYK',
271
313
  name: 'Snyk',
272
- group: 'OTHER',
314
+ groups: ['OTHER'],
273
315
  description: 'Scan code and dependencies for vulnerabilities with Snyk',
274
316
  },
275
317
  {
276
318
  type: 'STACK_HAWK',
277
319
  name: 'StackHawk',
278
- group: 'OTHER',
320
+ groups: ['OTHER'],
279
321
  description: 'Run StackHawk security scans',
280
322
  },
281
323
  {
282
324
  type: 'GHOST_INSPECTOR',
283
325
  name: 'Ghost Inspector',
284
- group: 'OTHER',
326
+ groups: ['OTHER'],
285
327
  description: 'Run Ghost Inspector browser tests',
286
328
  },
287
329
  {
288
330
  type: 'ATOP',
289
331
  name: 'ATOP',
290
- group: 'OTHER',
332
+ groups: ['OTHER'],
291
333
  description: 'Connect pipelines to an ATOP instance (API key and secret)',
292
334
  },
293
335
  {
294
336
  type: 'CLICKUP',
295
337
  name: 'ClickUp',
296
- group: 'OTHER',
338
+ groups: ['OTHER', 'MCP'],
297
339
  description: 'Update ClickUp tasks from pipelines, MCP server access',
298
340
  },
299
341
  {
300
342
  type: 'OKTA',
301
343
  name: 'Okta',
302
- group: 'OTHER',
344
+ groups: ['OTHER'],
303
345
  description: 'Single sign-on to the workspace with Okta',
304
346
  },
305
347
  {
306
348
  type: 'ONE_LOGIN',
307
349
  name: 'OneLogin',
308
- group: 'OTHER',
350
+ groups: ['OTHER'],
309
351
  description: 'Single sign-on to the workspace with OneLogin',
310
352
  },
311
353
  {
312
354
  type: 'BUDDY',
313
355
  name: 'Buddy',
314
- group: 'OTHER',
356
+ groups: ['OTHER'],
315
357
  description: 'Access another Buddy workspace from pipelines',
316
358
  },
359
+ {
360
+ type: 'LINEAR',
361
+ name: 'Linear',
362
+ groups: ['OTHER', 'MCP'],
363
+ description: 'Linear MCP server for AI actions',
364
+ },
365
+ {
366
+ type: 'NOTION',
367
+ name: 'Notion',
368
+ groups: ['OTHER', 'MCP'],
369
+ description: 'Notion MCP server for AI actions',
370
+ },
371
+ {
372
+ type: 'STRIPE',
373
+ name: 'Stripe',
374
+ groups: ['OTHER', 'MCP'],
375
+ description: 'Stripe MCP server for AI actions',
376
+ },
377
+ {
378
+ type: 'FIGMA',
379
+ name: 'Figma',
380
+ groups: ['OTHER', 'MCP'],
381
+ description: 'Figma MCP server for AI actions',
382
+ },
383
+ {
384
+ type: 'HUGGING_FACE',
385
+ name: 'Hugging Face',
386
+ groups: ['OTHER', 'MCP'],
387
+ description: 'Hugging Face MCP server for AI actions',
388
+ },
389
+ {
390
+ type: 'MONDAY',
391
+ name: 'monday.com',
392
+ groups: ['OTHER', 'MCP'],
393
+ description: 'monday.com MCP server for AI actions',
394
+ },
395
+ {
396
+ type: 'ZAPIER',
397
+ name: 'Zapier',
398
+ groups: ['OTHER', 'MCP'],
399
+ description: 'Zapier MCP server for AI actions',
400
+ },
401
+ {
402
+ type: 'MIRO',
403
+ name: 'Miro',
404
+ groups: ['OTHER', 'MCP'],
405
+ description: 'Miro MCP server for AI actions',
406
+ },
407
+ {
408
+ type: 'PAYPAL',
409
+ name: 'PayPal',
410
+ groups: ['OTHER', 'MCP'],
411
+ description: 'PayPal MCP server for AI actions',
412
+ },
413
+ {
414
+ type: 'POSTMAN',
415
+ name: 'Postman',
416
+ groups: ['OTHER', 'MCP'],
417
+ description: 'Postman MCP server for AI actions',
418
+ },
419
+ {
420
+ type: 'GRANOLA',
421
+ name: 'Granola',
422
+ groups: ['OTHER', 'MCP'],
423
+ description: 'Granola MCP server for AI actions',
424
+ },
425
+ {
426
+ type: 'INTERCOM',
427
+ name: 'Intercom',
428
+ groups: ['OTHER', 'MCP'],
429
+ description: 'Intercom MCP server for AI actions',
430
+ },
431
+ {
432
+ type: 'CONTEXT7',
433
+ name: 'Context7',
434
+ groups: ['OTHER', 'MCP'],
435
+ description: 'Context7 MCP server for AI actions',
436
+ },
317
437
  ];
318
438
  exports.INTEGRATION_TYPES = exports.INTEGRATION_TYPE_CATALOG.map((t) => t.type);
@@ -39,6 +39,9 @@ commandIntegrationGet.action(async (identifier, options) => {
39
39
  if (integration.project_name) {
40
40
  data.push(['Project', integration.project_name]);
41
41
  }
42
+ if (integration.mcp_server_url) {
43
+ data.push(['MCP server URL', integration.mcp_server_url]);
44
+ }
42
45
  data.push([
43
46
  'Pipelines',
44
47
  integration.all_pipelines_allowed
@@ -16,7 +16,7 @@ commandIntegrationTypes.option('--group <group>', texts_1.OPTION_INTEGRATION_TYP
16
16
  commandIntegrationTypes.option('--format <text|json>', texts_1.OPTION_FORMAT);
17
17
  commandIntegrationTypes.action(async (options) => {
18
18
  const group = options.group?.toUpperCase();
19
- const types = catalog_1.INTEGRATION_TYPE_CATALOG.filter((t) => !group || t.group === group);
19
+ const types = catalog_1.INTEGRATION_TYPE_CATALOG.filter((t) => !group || t.groups.includes(group));
20
20
  if (options.format === 'json') {
21
21
  output_1.default.json(types);
22
22
  }
@@ -24,9 +24,9 @@ commandIntegrationTypes.action(async (options) => {
24
24
  if (types.length === 0) {
25
25
  output_1.default.exitNormal(texts_1.TXT_INTEGRATION_TYPES_NOT_FOUND);
26
26
  }
27
- const data = [['TYPE', 'NAME', 'GROUP', 'DESCRIPTION']];
27
+ const data = [['TYPE', 'NAME', 'GROUPS', 'DESCRIPTION']];
28
28
  for (const t of types) {
29
- data.push([t.type, t.name, t.group, t.description]);
29
+ data.push([t.type, t.name, t.groups.join(', '), t.description]);
30
30
  }
31
31
  output_1.default.table(data);
32
32
  }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const utils_1 = require("../../utils");
7
+ const texts_1 = require("../../texts");
8
+ const output_1 = __importDefault(require("../../output"));
9
+ const input_1 = __importDefault(require("../../input"));
10
+ const scope_1 = require("./scope");
11
+ const commandVariableCreate = (0, utils_1.newCommand)('create', texts_1.DESC_COMMAND_VARIABLE_CREATE, {
12
+ requiredScopes: [utils_1.REST_API_SCOPE.VARIABLE_WRITE],
13
+ examples: texts_1.EXAMPLE_VARIABLE_CREATE,
14
+ });
15
+ commandVariableCreate.alias('add');
16
+ commandVariableCreate.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
17
+ commandVariableCreate.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
18
+ commandVariableCreate.option('--pipeline <identifier>', texts_1.OPTION_VARIABLE_PIPELINE);
19
+ commandVariableCreate.option('--environment <identifier>', texts_1.OPTION_VARIABLE_ENVIRONMENT);
20
+ commandVariableCreate.option('--sandbox <identifier>', texts_1.OPTION_VARIABLE_SANDBOX);
21
+ commandVariableCreate.option('--scope <scope>', texts_1.OPT_COMMAND_VARIABLE_SCOPE);
22
+ commandVariableCreate.option('--file <path>', texts_1.OPTION_VARIABLE_FILE);
23
+ commandVariableCreate.option('--encrypted', texts_1.OPTION_VARIABLE_ENCRYPTED);
24
+ commandVariableCreate.option('--settable', texts_1.OPTION_VARIABLE_SETTABLE);
25
+ commandVariableCreate.option('--disable', texts_1.OPTION_VARIABLE_DISABLE);
26
+ commandVariableCreate.option('--note <note>', texts_1.OPT_COMMAND_NOTE);
27
+ commandVariableCreate.option('--agent-note <note>', texts_1.OPT_COMMAND_AGENT_NOTE);
28
+ commandVariableCreate.option('--format <text|json>', texts_1.OPTION_FORMAT);
29
+ commandVariableCreate.argument('<key>', texts_1.OPTION_VARIABLE_KEY);
30
+ commandVariableCreate.argument('[value]', texts_1.OPTION_VARIABLE_VALUE);
31
+ commandVariableCreate.action(async (key, value, options) => {
32
+ const workspace = input_1.default.restApiWorkspace(options.workspace);
33
+ const { project, scope } = (0, scope_1.variableScope)(options);
34
+ const body = {
35
+ key,
36
+ value: input_1.default.variableValue(value, options.file) ?? '',
37
+ encrypted: !!options.encrypted,
38
+ settable: !!options.settable,
39
+ };
40
+ if (options.disable)
41
+ body.disabled = true;
42
+ if (options.note !== undefined)
43
+ body.note = options.note;
44
+ if (options.agentNote !== undefined)
45
+ body.agent_note = options.agentNote;
46
+ const client = input_1.default.restApiTokenClient();
47
+ const params = await (0, scope_1.resolveVariableScope)(client, workspace, project, scope, options);
48
+ const result = await client.createVariable(workspace, params, body);
49
+ if (options.format === 'json') {
50
+ output_1.default.json(result);
51
+ output_1.default.exitNormal();
52
+ }
53
+ output_1.default.exitSuccess((0, texts_1.TXT_VARIABLE_CREATED)(result.key, (0, scope_1.variableScopeOf)(result)));
54
+ });
55
+ exports.default = commandVariableCreate;