@capawesome/cli 3.2.0 → 3.2.1

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [3.2.1](https://github.com/capawesome-team/cli/compare/v3.2.0...v3.2.1) (2025-09-26)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * add missing CI checks ([#84](https://github.com/capawesome-team/cli/issues/84)) ([617e89c](https://github.com/capawesome-team/cli/commit/617e89c6b69c907573b61b5e685a2f05cdab2d62))
11
+ * **apps:bundles:create:** add CI check for channel prompt ([5d89cff](https://github.com/capawesome-team/cli/commit/5d89cffad756b6d5b9017c8797dc8c2e8cd2d5f8))
12
+ * **apps:bundles:create:** add CI checks for path and app ID prompts ([e96f567](https://github.com/capawesome-team/cli/commit/e96f5674293a01a8d87eb293dffdf06b4a59f43f))
13
+
5
14
  ## [3.2.0](https://github.com/capawesome-team/cli/compare/v3.1.0...v3.2.0) (2025-09-21)
6
15
 
7
16
 
@@ -15,6 +15,7 @@ import zip from '../../../utils/zip.js';
15
15
  import { defineCommand, defineOptions } from '@robingenz/zli';
16
16
  import consola from 'consola';
17
17
  import { createReadStream } from 'fs';
18
+ import { isCI } from 'std-env';
18
19
  import { z } from 'zod';
19
20
  export default defineCommand({
20
21
  description: 'Create a new app bundle.',
@@ -103,13 +104,19 @@ export default defineCommand({
103
104
  }
104
105
  // Check that either a path or a url is provided
105
106
  if (!path && !url) {
106
- path = await prompt('Enter the path to the app bundle:', {
107
- type: 'text',
108
- });
109
- if (!path) {
110
- consola.error('You must provide a path to the app bundle.');
107
+ if (isCI) {
108
+ consola.error('You must provide either a path or a url when running in CI mode.');
111
109
  process.exit(1);
112
110
  }
111
+ else {
112
+ path = await prompt('Enter the path to the app bundle:', {
113
+ type: 'text',
114
+ });
115
+ if (!path) {
116
+ consola.error('You must provide a path to the app bundle.');
117
+ process.exit(1);
118
+ }
119
+ }
113
120
  }
114
121
  if (path) {
115
122
  // Check if the path exists when a path is provided
@@ -150,6 +157,10 @@ export default defineCommand({
150
157
  process.exit(1);
151
158
  }
152
159
  if (!appId) {
160
+ if (isCI) {
161
+ consola.error('You must provide an app ID when running in CI mode.');
162
+ process.exit(1);
163
+ }
153
164
  const organizations = await organizationsService.findAll();
154
165
  if (organizations.length === 0) {
155
166
  consola.error('You must create an organization before creating a bundle.');
@@ -181,7 +192,7 @@ export default defineCommand({
181
192
  process.exit(1);
182
193
  }
183
194
  }
184
- if (!channel) {
195
+ if (!channel && !isCI) {
185
196
  const promptChannel = await prompt('Do you want to deploy to a specific channel?', {
186
197
  type: 'select',
187
198
  options: ['Yes', 'No'],
@@ -5,6 +5,7 @@ import organizationsService from '../../../services/organizations.js';
5
5
  import { prompt } from '../../../utils/prompt.js';
6
6
  import { defineCommand, defineOptions } from '@robingenz/zli';
7
7
  import consola from 'consola';
8
+ import { isCI } from 'std-env';
8
9
  import { z } from 'zod';
9
10
  export default defineCommand({
10
11
  description: 'Delete an app bundle.',
@@ -20,6 +21,10 @@ export default defineCommand({
20
21
  }
21
22
  // Prompt for missing arguments
22
23
  if (!appId) {
24
+ if (isCI) {
25
+ consola.error('You must provide an app ID when running in CI mode.');
26
+ process.exit(1);
27
+ }
23
28
  const organizations = await organizationsService.findAll();
24
29
  if (organizations.length === 0) {
25
30
  consola.error('You must create an organization before deleting a bundle.');
@@ -48,16 +53,22 @@ export default defineCommand({
48
53
  });
49
54
  }
50
55
  if (!bundleId) {
56
+ if (isCI) {
57
+ consola.error('You must provide the bundle ID when running in CI mode.');
58
+ process.exit(1);
59
+ }
51
60
  bundleId = await prompt('Enter the bundle ID:', {
52
61
  type: 'text',
53
62
  });
54
63
  }
55
64
  // Confirm deletion
56
- const confirmed = await prompt('Are you sure you want to delete this bundle?', {
57
- type: 'confirm',
58
- });
59
- if (!confirmed) {
60
- return;
65
+ if (!isCI) {
66
+ const confirmed = await prompt('Are you sure you want to delete this bundle?', {
67
+ type: 'confirm',
68
+ });
69
+ if (!confirmed) {
70
+ return;
71
+ }
61
72
  }
62
73
  // Delete bundle
63
74
  await appBundlesService.delete({
@@ -11,6 +11,9 @@ vi.mock('@/utils/user-config.js');
11
11
  vi.mock('@/utils/prompt.js');
12
12
  vi.mock('@/services/authorization-service.js');
13
13
  vi.mock('consola');
14
+ vi.mock('std-env', () => ({
15
+ isCI: false,
16
+ }));
14
17
  describe('apps-bundles-delete', () => {
15
18
  const mockUserConfig = vi.mocked(userConfig);
16
19
  const mockPrompt = vi.mocked(prompt);
@@ -5,6 +5,7 @@ import organizationsService from '../../../services/organizations.js';
5
5
  import { prompt } from '../../../utils/prompt.js';
6
6
  import { defineCommand, defineOptions } from '@robingenz/zli';
7
7
  import consola from 'consola';
8
+ import { isCI } from 'std-env';
8
9
  import { z } from 'zod';
9
10
  export default defineCommand({
10
11
  description: 'Update an app bundle.',
@@ -44,6 +45,10 @@ export default defineCommand({
44
45
  }
45
46
  // Prompt for missing arguments
46
47
  if (!appId) {
48
+ if (isCI) {
49
+ consola.error('You must provide an app ID when running in CI mode.');
50
+ process.exit(1);
51
+ }
47
52
  const organizations = await organizationsService.findAll();
48
53
  if (organizations.length === 0) {
49
54
  consola.error('You must create an organization before updating a bundle.');
@@ -72,6 +77,10 @@ export default defineCommand({
72
77
  });
73
78
  }
74
79
  if (!bundleId) {
80
+ if (isCI) {
81
+ consola.error('You must provide the bundle ID when running in CI mode.');
82
+ process.exit(1);
83
+ }
75
84
  bundleId = await prompt('Enter the bundle ID:', {
76
85
  type: 'text',
77
86
  });
@@ -11,6 +11,9 @@ vi.mock('@/utils/user-config.js');
11
11
  vi.mock('@/utils/prompt.js');
12
12
  vi.mock('@/services/authorization-service.js');
13
13
  vi.mock('consola');
14
+ vi.mock('std-env', () => ({
15
+ isCI: false,
16
+ }));
14
17
  describe('apps-bundles-update', () => {
15
18
  const mockUserConfig = vi.mocked(userConfig);
16
19
  const mockPrompt = vi.mocked(prompt);
@@ -6,6 +6,7 @@ import { getMessageFromUnknownError } from '../../../utils/error.js';
6
6
  import { prompt } from '../../../utils/prompt.js';
7
7
  import { defineCommand, defineOptions } from '@robingenz/zli';
8
8
  import consola from 'consola';
9
+ import { isCI } from 'std-env';
9
10
  import { z } from 'zod';
10
11
  export default defineCommand({
11
12
  description: 'Create a new app channel.',
@@ -42,6 +43,10 @@ export default defineCommand({
42
43
  }
43
44
  // Validate the app ID
44
45
  if (!appId) {
46
+ if (isCI) {
47
+ consola.error('You must provide an app ID when running in CI mode.');
48
+ process.exit(1);
49
+ }
45
50
  const organizations = await organizationsService.findAll();
46
51
  if (organizations.length === 0) {
47
52
  consola.error('You must create an organization before creating a channel.');
@@ -71,6 +76,10 @@ export default defineCommand({
71
76
  }
72
77
  // Validate the channel name
73
78
  if (!name) {
79
+ if (isCI) {
80
+ consola.error('You must provide the channel name when running in CI mode.');
81
+ process.exit(1);
82
+ }
74
83
  name = await prompt('Enter the name of the channel:', { type: 'text' });
75
84
  }
76
85
  try {
@@ -11,6 +11,9 @@ vi.mock('@/utils/user-config.js');
11
11
  vi.mock('@/utils/prompt.js');
12
12
  vi.mock('@/services/authorization-service.js');
13
13
  vi.mock('consola');
14
+ vi.mock('std-env', () => ({
15
+ isCI: false,
16
+ }));
14
17
  describe('apps-channels-create', () => {
15
18
  const mockUserConfig = vi.mocked(userConfig);
16
19
  const mockPrompt = vi.mocked(prompt);
@@ -27,6 +27,10 @@ export default defineCommand({
27
27
  process.exit(1);
28
28
  }
29
29
  if (!appId) {
30
+ if (isCI) {
31
+ consola.error('You must provide an app ID when running in CI mode.');
32
+ process.exit(1);
33
+ }
30
34
  const organizations = await organizationsService.findAll();
31
35
  if (organizations.length === 0) {
32
36
  consola.error('You must create an organization before deleting a channel.');
@@ -54,11 +58,17 @@ export default defineCommand({
54
58
  options: apps.map((app) => ({ label: app.name, value: app.id })),
55
59
  });
56
60
  }
61
+ // Prompt for channel ID or name if neither is provided
57
62
  if (!channelId && !name) {
63
+ if (isCI) {
64
+ consola.error('You must provide either the channel ID or name when running in CI mode.');
65
+ process.exit(1);
66
+ }
58
67
  name = await prompt('Enter the channel name:', {
59
68
  type: 'text',
60
69
  });
61
70
  }
71
+ // Confirm deletion
62
72
  if (!isCI) {
63
73
  const confirmed = await prompt('Are you sure you want to delete this channel?', {
64
74
  type: 'confirm',
@@ -67,6 +77,7 @@ export default defineCommand({
67
77
  return;
68
78
  }
69
79
  }
80
+ // Delete channel
70
81
  await appChannelsService.delete({
71
82
  appId,
72
83
  id: channelId,
@@ -5,6 +5,7 @@ import organizationsService from '../../../services/organizations.js';
5
5
  import { prompt } from '../../../utils/prompt.js';
6
6
  import { defineCommand, defineOptions } from '@robingenz/zli';
7
7
  import consola from 'consola';
8
+ import { isCI } from 'std-env';
8
9
  import { z } from 'zod';
9
10
  export default defineCommand({
10
11
  description: 'Update an existing app channel.',
@@ -23,7 +24,12 @@ export default defineCommand({
23
24
  consola.error('You must be logged in to run this command.');
24
25
  process.exit(1);
25
26
  }
27
+ // Prompt app ID if not provided
26
28
  if (!appId) {
29
+ if (isCI) {
30
+ consola.error('You must provide an app ID when running in CI mode.');
31
+ process.exit(1);
32
+ }
27
33
  const organizations = await organizationsService.findAll();
28
34
  if (organizations.length === 0) {
29
35
  consola.error('You must create an organization before updating a channel.');
@@ -51,7 +57,12 @@ export default defineCommand({
51
57
  options: apps.map((app) => ({ label: app.name, value: app.id })),
52
58
  });
53
59
  }
60
+ // Prompt for channel ID if not provided
54
61
  if (!channelId) {
62
+ if (isCI) {
63
+ consola.error('You must provide the channel ID when running in CI mode.');
64
+ process.exit(1);
65
+ }
55
66
  channelId = await prompt('Enter the channel ID:', {
56
67
  type: 'text',
57
68
  });
@@ -11,6 +11,9 @@ vi.mock('@/utils/user-config.js');
11
11
  vi.mock('@/utils/prompt.js');
12
12
  vi.mock('@/services/authorization-service.js');
13
13
  vi.mock('consola');
14
+ vi.mock('std-env', () => ({
15
+ isCI: false,
16
+ }));
14
17
  describe('apps-channels-update', () => {
15
18
  const mockUserConfig = vi.mocked(userConfig);
16
19
  const mockPrompt = vi.mocked(prompt);
@@ -4,6 +4,7 @@ import organizationsService from '../../services/organizations.js';
4
4
  import { prompt } from '../../utils/prompt.js';
5
5
  import { defineCommand, defineOptions } from '@robingenz/zli';
6
6
  import consola from 'consola';
7
+ import { isCI } from 'std-env';
7
8
  import { z } from 'zod';
8
9
  export default defineCommand({
9
10
  description: 'Create a new app.',
@@ -18,6 +19,10 @@ export default defineCommand({
18
19
  process.exit(1);
19
20
  }
20
21
  if (!organizationId) {
22
+ if (isCI) {
23
+ consola.error('You must provide the organization ID when running in CI mode.');
24
+ process.exit(1);
25
+ }
21
26
  const organizations = await organizationsService.findAll();
22
27
  if (organizations.length === 0) {
23
28
  consola.error('You must create an organization before creating an app.');
@@ -34,6 +39,10 @@ export default defineCommand({
34
39
  }
35
40
  }
36
41
  if (!name) {
42
+ if (isCI) {
43
+ consola.error('You must provide the app name when running in CI mode.');
44
+ process.exit(1);
45
+ }
37
46
  name = await prompt('Enter the name of the app:', { type: 'text' });
38
47
  }
39
48
  const response = await appsService.create({ name, organizationId });
@@ -11,6 +11,9 @@ vi.mock('@/utils/user-config.js');
11
11
  vi.mock('@/utils/prompt.js');
12
12
  vi.mock('@/services/authorization-service.js');
13
13
  vi.mock('consola');
14
+ vi.mock('std-env', () => ({
15
+ isCI: false,
16
+ }));
14
17
  describe('apps-create', () => {
15
18
  const mockUserConfig = vi.mocked(userConfig);
16
19
  const mockPrompt = vi.mocked(prompt);
@@ -4,6 +4,7 @@ import organizationsService from '../../services/organizations.js';
4
4
  import { prompt } from '../../utils/prompt.js';
5
5
  import { defineCommand, defineOptions } from '@robingenz/zli';
6
6
  import consola from 'consola';
7
+ import { isCI } from 'std-env';
7
8
  import { z } from 'zod';
8
9
  export default defineCommand({
9
10
  description: 'Delete an app.',
@@ -17,6 +18,10 @@ export default defineCommand({
17
18
  process.exit(1);
18
19
  }
19
20
  if (!appId) {
21
+ if (isCI) {
22
+ consola.error('You must provide the app ID when running in CI mode.');
23
+ process.exit(1);
24
+ }
20
25
  const organizations = await organizationsService.findAll();
21
26
  if (organizations.length === 0) {
22
27
  consola.error('You must create an organization before deleting an app.');
@@ -44,11 +49,13 @@ export default defineCommand({
44
49
  options: apps.map((app) => ({ label: app.name, value: app.id })),
45
50
  });
46
51
  }
47
- const confirmed = await prompt('Are you sure you want to delete this app?', {
48
- type: 'confirm',
49
- });
50
- if (!confirmed) {
51
- return;
52
+ if (!isCI) {
53
+ const confirmed = await prompt('Are you sure you want to delete this app?', {
54
+ type: 'confirm',
55
+ });
56
+ if (!confirmed) {
57
+ return;
58
+ }
52
59
  }
53
60
  await appsService.delete({ id: appId });
54
61
  consola.success('App deleted successfully.');
@@ -11,6 +11,9 @@ vi.mock('@/utils/user-config.js');
11
11
  vi.mock('@/utils/prompt.js');
12
12
  vi.mock('@/services/authorization-service.js');
13
13
  vi.mock('consola');
14
+ vi.mock('std-env', () => ({
15
+ isCI: false,
16
+ }));
14
17
  describe('apps-delete', () => {
15
18
  const mockUserConfig = vi.mocked(userConfig);
16
19
  const mockPrompt = vi.mocked(prompt);
@@ -5,6 +5,7 @@ import organizationsService from '../../../services/organizations.js';
5
5
  import { prompt } from '../../../utils/prompt.js';
6
6
  import { defineCommand, defineOptions } from '@robingenz/zli';
7
7
  import consola from 'consola';
8
+ import { isCI } from 'std-env';
8
9
  import { z } from 'zod';
9
10
  export default defineCommand({
10
11
  description: 'Delete an app device.',
@@ -18,7 +19,12 @@ export default defineCommand({
18
19
  consola.error('You must be logged in to run this command.');
19
20
  process.exit(1);
20
21
  }
22
+ // Prompt for app ID if not provided
21
23
  if (!appId) {
24
+ if (isCI) {
25
+ consola.error('You must provide an app ID when running in CI mode.');
26
+ process.exit(1);
27
+ }
22
28
  const organizations = await organizationsService.findAll();
23
29
  if (organizations.length === 0) {
24
30
  consola.error('You must create an organization before deleting a device.');
@@ -46,17 +52,26 @@ export default defineCommand({
46
52
  options: apps.map((app) => ({ label: app.name, value: app.id })),
47
53
  });
48
54
  }
55
+ // Prompt for device ID if not provided
49
56
  if (!deviceId) {
57
+ if (isCI) {
58
+ consola.error('You must provide the device ID when running in CI mode.');
59
+ process.exit(1);
60
+ }
50
61
  deviceId = await prompt('Enter the device ID:', {
51
62
  type: 'text',
52
63
  });
53
64
  }
54
- const confirmed = await prompt('Are you sure you want to delete this device?', {
55
- type: 'confirm',
56
- });
57
- if (!confirmed) {
58
- return;
65
+ // Confirm deletion
66
+ if (!isCI) {
67
+ const confirmed = await prompt('Are you sure you want to delete this device?', {
68
+ type: 'confirm',
69
+ });
70
+ if (!confirmed) {
71
+ return;
72
+ }
59
73
  }
74
+ // Delete device
60
75
  await appDevicesService.delete({
61
76
  appId,
62
77
  deviceId,
@@ -11,6 +11,9 @@ vi.mock('@/utils/user-config.js');
11
11
  vi.mock('@/utils/prompt.js');
12
12
  vi.mock('@/services/authorization-service.js');
13
13
  vi.mock('consola');
14
+ vi.mock('std-env', () => ({
15
+ isCI: false,
16
+ }));
14
17
  describe('apps-devices-delete', () => {
15
18
  const mockUserConfig = vi.mocked(userConfig);
16
19
  const mockPrompt = vi.mocked(prompt);
@@ -20,6 +20,9 @@ vi.mock('@/utils/prompt.js');
20
20
  vi.mock('std-env', () => ({
21
21
  isCI: false,
22
22
  }));
23
+ vi.mock('std-env', () => ({
24
+ isCI: false,
25
+ }));
23
26
  describe('login', () => {
24
27
  const mockUserConfig = vi.mocked(userConfig);
25
28
  const mockSessionCodesService = vi.mocked(sessionCodesService);
@@ -1,9 +1,10 @@
1
- import { defineCommand, defineOptions } from '@robingenz/zli';
2
- import consola from 'consola';
3
- import { z } from 'zod';
4
1
  import { fileExistsAtPath } from '../../utils/file.js';
5
2
  import { generateManifestJson } from '../../utils/manifest.js';
6
3
  import { prompt } from '../../utils/prompt.js';
4
+ import { defineCommand, defineOptions } from '@robingenz/zli';
5
+ import consola from 'consola';
6
+ import { isCI } from 'std-env';
7
+ import { z } from 'zod';
7
8
  export default defineCommand({
8
9
  description: 'Generate a manifest file.',
9
10
  options: defineOptions(z.object({
@@ -12,6 +13,10 @@ export default defineCommand({
12
13
  action: async (options, args) => {
13
14
  let path = options.path;
14
15
  if (!path) {
16
+ if (isCI) {
17
+ consola.error('You must provide the path to the web assets folder when running in CI mode.');
18
+ process.exit(1);
19
+ }
15
20
  path = await prompt('Enter the path to the web assets folder:', {
16
21
  type: 'text',
17
22
  });
@@ -9,6 +9,9 @@ vi.mock('@/utils/file.js');
9
9
  vi.mock('@/utils/manifest.js');
10
10
  vi.mock('@/utils/prompt.js');
11
11
  vi.mock('consola');
12
+ vi.mock('std-env', () => ({
13
+ isCI: false,
14
+ }));
12
15
  describe('manifests-generate', () => {
13
16
  const mockFileExistsAtPath = vi.mocked(fileExistsAtPath);
14
17
  const mockGenerateManifestJson = vi.mocked(generateManifestJson);
@@ -3,6 +3,7 @@ import organizationsService from '../../services/organizations.js';
3
3
  import { prompt } from '../../utils/prompt.js';
4
4
  import { defineCommand, defineOptions } from '@robingenz/zli';
5
5
  import consola from 'consola';
6
+ import { isCI } from 'std-env';
6
7
  import { z } from 'zod';
7
8
  export default defineCommand({
8
9
  description: 'Create a new organization.',
@@ -16,6 +17,10 @@ export default defineCommand({
16
17
  process.exit(1);
17
18
  }
18
19
  if (!name) {
20
+ if (isCI) {
21
+ consola.error('You must provide the organization name when running in CI mode.');
22
+ process.exit(1);
23
+ }
19
24
  name = await prompt('Enter the name of the organization:', { type: 'text' });
20
25
  }
21
26
  const response = await organizationsService.create({ name });
@@ -11,6 +11,9 @@ vi.mock('@/utils/user-config.js');
11
11
  vi.mock('@/utils/prompt.js');
12
12
  vi.mock('@/services/authorization-service.js');
13
13
  vi.mock('consola');
14
+ vi.mock('std-env', () => ({
15
+ isCI: false,
16
+ }));
14
17
  describe('organizations-create', () => {
15
18
  const mockUserConfig = vi.mocked(userConfig);
16
19
  const mockPrompt = vi.mocked(prompt);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capawesome/cli",
3
- "version": "3.2.0",
3
+ "version": "3.2.1",
4
4
  "description": "The Capawesome Cloud Command Line Interface (CLI) to manage Live Updates and more.",
5
5
  "type": "module",
6
6
  "scripts": {