agentaudit 3.13.2 → 3.13.3
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/cli.mjs +17 -3
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -3688,12 +3688,17 @@ async function auditRepo(url) {
|
|
|
3688
3688
|
if (modelNames.length === 1) {
|
|
3689
3689
|
activeLlm = resolveModel(modelNames[0]);
|
|
3690
3690
|
} else {
|
|
3691
|
-
activeLlm = resolveProvider();
|
|
3692
3691
|
// Model override: --model flag > AGENTAUDIT_MODEL env > credentials.json > provider default
|
|
3693
3692
|
const modelArgIdx2 = process.argv.indexOf('--model');
|
|
3694
3693
|
const modelFlag2 = modelArgIdx2 !== -1 ? process.argv[modelArgIdx2 + 1] : null;
|
|
3695
3694
|
const modelOverride = modelFlag2 || process.env.AGENTAUDIT_MODEL || loadLlmConfig()?.llm_model || null;
|
|
3696
|
-
if (
|
|
3695
|
+
if (modelOverride) {
|
|
3696
|
+
// Route through resolveModel() so slash-models go to OpenRouter, prefixes to native providers
|
|
3697
|
+
activeLlm = resolveModel(modelOverride);
|
|
3698
|
+
}
|
|
3699
|
+
if (!activeLlm) {
|
|
3700
|
+
activeLlm = resolveProvider();
|
|
3701
|
+
}
|
|
3697
3702
|
}
|
|
3698
3703
|
|
|
3699
3704
|
if (!activeLlm) {
|
|
@@ -6313,7 +6318,16 @@ async function main() {
|
|
|
6313
6318
|
}
|
|
6314
6319
|
|
|
6315
6320
|
if (command === 'audit') {
|
|
6316
|
-
|
|
6321
|
+
// Extract URLs: skip option flags and their values
|
|
6322
|
+
const optionsWithValues = new Set(['--model', '--verify', '--format', '--models']);
|
|
6323
|
+
const urls = [];
|
|
6324
|
+
for (let i = 0; i < targets.length; i++) {
|
|
6325
|
+
if (targets[i].startsWith('--')) {
|
|
6326
|
+
if (optionsWithValues.has(targets[i]) && i + 1 < targets.length) i++; // skip next (value)
|
|
6327
|
+
continue;
|
|
6328
|
+
}
|
|
6329
|
+
urls.push(targets[i]);
|
|
6330
|
+
}
|
|
6317
6331
|
if (urls.length === 0) {
|
|
6318
6332
|
console.log(` ${c.red}Error: at least one repository URL required${c.reset}`);
|
|
6319
6333
|
console.log(` ${c.dim}Usage: ${c.cyan}agentaudit audit <url>${c.dim} — e.g. agentaudit audit https://github.com/owner/repo${c.reset}`);
|