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/dist/178.index.js +1 -1
- package/dist/239.index.js +1 -1
- package/dist/701.index.js +1 -1
- package/dist/880.index.js +1 -1
- package/dist/935.index.js +1 -1
- package/dist/966.index.js +1 -1
- package/dist/index.js +4 -4
- package/package.json +1 -1
- package/src/reviewHeadless.js +6 -0
package/package.json
CHANGED
package/src/reviewHeadless.js
CHANGED
|
@@ -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;
|