codeant-cli 0.2.5 → 0.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeant-cli",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Code review CLI tool",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,7 @@
1
1
  import ReviewApiHelper from './utils/reviewApiHelper.js';
2
2
  import { fetchApi } from './utils/fetchApi.js';
3
3
  import { executeTool } from './tools/executeTool.js';
4
+ import { getConfigValue, setConfigValue } from './utils/config.js';
4
5
 
5
6
  const MAX_TURNS = 5;
6
7
 
@@ -84,6 +85,11 @@ export async function runReviewHeadless(options = {}) {
84
85
  onFilesReady = () => {},
85
86
  } = options;
86
87
 
88
+ // If the CLI config doesn't have an apiKey but the extension passed one, persist it
89
+ if (apiKey && !getConfigValue('apiKey')) {
90
+ setConfigValue('apiKey', apiKey);
91
+ }
92
+
87
93
  // Temporarily set env vars so fetchApi picks them up
88
94
  const prevToken = process.env.CODEANT_API_TOKEN;
89
95
  const prevUrl = process.env.CODEANT_API_URL;