@vee-stack/delta-cli 2.0.5 → 2.0.6

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.
@@ -22,6 +22,26 @@ function extractApiErrorPayload(payload) {
22
22
  }
23
23
  export async function analyzeCommand(projectPath, options) {
24
24
  const targetPath = path.resolve(projectPath);
25
+ // Check authentication FIRST if upload is requested
26
+ if (options.upload) {
27
+ printInfo('🔐 Checking authentication...');
28
+ const config = await loadConfig();
29
+ const pat = await SecureTokenStore.getAccessToken();
30
+ if (!pat) {
31
+ console.error();
32
+ console.error(chalk.red('❌ Error: You must be logged in to upload reports.'));
33
+ console.error();
34
+ console.error(chalk.yellow('Please authenticate first:'));
35
+ console.error(chalk.cyan(' delta login'));
36
+ console.error();
37
+ console.error(chalk.dim('Or use --upload with a valid PAT:'));
38
+ console.error(chalk.cyan(' delta analyze . --upload --token <your-pat>'));
39
+ console.error();
40
+ process.exit(1);
41
+ }
42
+ printSuccess('✓ Authenticated');
43
+ console.log();
44
+ }
25
45
  printInfo('🔍 Starting Delta Analysis Engine...');
26
46
  printDivider();
27
47
  console.log(`${icons.folder} Project: ${chalk.cyan(targetPath)}`);
@@ -165,6 +185,7 @@ export async function analyzeCommand(projectPath, options) {
165
185
  console.log(`${icons.rocket} Uploading to Delta Cloud...`);
166
186
  await uploadReport(report);
167
187
  }
188
+ process.exit(0);
168
189
  }
169
190
  async function uploadReport(report) {
170
191
  const config = await loadConfig();
@@ -44,7 +44,7 @@ export const authCommands = {
44
44
  console.log();
45
45
  printCommandHint('delta whoami', 'to see account details');
46
46
  printCommandHint('delta analyze', 'to start analyzing code');
47
- return;
47
+ process.exit(0);
48
48
  }
49
49
  // PAT Token flow (when token is provided)
50
50
  // Validate token format
@@ -102,6 +102,7 @@ export const authCommands = {
102
102
  console.log();
103
103
  printCommandHint('delta whoami', 'to see full account details');
104
104
  printCommandHint('delta analyze', 'to start analyzing code');
105
+ process.exit(0);
105
106
  }
106
107
  catch (error) {
107
108
  stopSpinner(false, 'Authentication failed');
@@ -13,7 +13,7 @@ export async function configCommand(options) {
13
13
  else {
14
14
  console.log(`${options.get}: (not set)`);
15
15
  }
16
- return;
16
+ process.exit(0);
17
17
  }
18
18
  if (options.set) {
19
19
  const [key, value] = options.set.split('=');
@@ -28,7 +28,7 @@ export async function configCommand(options) {
28
28
  };
29
29
  await saveConfig(newConfig);
30
30
  console.log(`✅ Set ${key} = ${value}`);
31
- return;
31
+ process.exit(0);
32
32
  }
33
33
  if (options.list || (!options.get && !options.set)) {
34
34
  console.log('🔧 Delta CLI Configuration');
@@ -45,6 +45,7 @@ export async function configCommand(options) {
45
45
  if (config.lastUsedAt) {
46
46
  console.log(` Last used: ${new Date(config.lastUsedAt).toLocaleString()}`);
47
47
  }
48
+ process.exit(0);
48
49
  }
49
50
  }
50
51
  //# sourceMappingURL=config.js.map
@@ -9,7 +9,7 @@ export async function logoutCommand() {
9
9
  const hasToken = await SecureTokenStore.hasTokens();
10
10
  if (!hasToken) {
11
11
  console.log('â„šī¸ Not currently authenticated');
12
- return;
12
+ process.exit(0);
13
13
  }
14
14
  // Clear tokens from keychain and remove config file
15
15
  await SecureTokenStore.clearTokens();
@@ -21,6 +21,7 @@ export async function logoutCommand() {
21
21
  }
22
22
  console.log('✅ Successfully logged out');
23
23
  console.log(' Authentication data removed');
24
+ process.exit(0);
24
25
  }
25
26
  catch (error) {
26
27
  console.error('❌ Error during logout:', error instanceof Error ? error.message : String(error));
@@ -51,6 +51,7 @@ export async function whoamiCommand(_options) {
51
51
  console.log();
52
52
  printCommandHint('delta analyze', 'to run a code analysis');
53
53
  printCommandHint('delta status', 'to check project status');
54
+ process.exit(0);
54
55
  }
55
56
  catch (error) {
56
57
  stopSpinner(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vee-stack/delta-cli",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "Delta CLI v2 - Next-gen terminal interface with React Ink",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",