Lines 25-65javascript
25if (kiloBase) backends.kilo = { base: kiloBase };
26if (opencodeBase) backends.opencode = { base: opencodeBase };
28if (args.includes('--probe')) {
30 const { listBrands, getBrand } = require('../lib/openai-brands');
32 { name: 'ANTHROPIC_API_KEY', set: !!process.env.ANTHROPIC_API_KEY },
33 { name: 'GEMINI_API_KEY', set: !!process.env.GEMINI_API_KEY },
34 { name: 'OLLAMA_URL', set: !!process.env.OLLAMA_URL || true, value: process.env.OLLAMA_URL || 'http://localhost:11434' },
35 { name: 'AWS_ACCESS_KEY_ID', set: !!process.env.AWS_ACCESS_KEY_ID },
37 for (const b of listBrands()) {
38 const k = getBrand(b).envKey;
39 checks.push({ name: `${b} (${k})`, set: !!process.env[k] });
41 for (const c of checks) console.log(`${c.set ? 'OK ' : '-- '} ${c.name}${c.value ? ' = ' + c.value : ''}`);
44} else if (args.includes('--update')) {
46 const { execSync } = require('child_process');
47 const opts = { stdio: 'inherit', windowsHide: true };
HighChild Process
Package source references child process execution.
bin/acptoapi.jsView on unpkg · L45 48 const tryRun = (cmd) => { try { execSync(cmd, opts); return true; } catch { return false; } };
49 console.log('[acptoapi] clearing npx + bun caches and re-fetching @latest...');
50 tryRun('npm cache clean --force');
51 tryRun(process.platform === 'win32' ? 'rmdir /s /q "%LOCALAPPDATA%\\npm-cache\\_npx" 2>nul' : 'rm -rf ~/.npm/_npx');
52 tryRun(process.platform === 'win32' ? 'rmdir /s /q "%LOCALAPPDATA%\\..\\Roaming\\npm-cache\\_npx" 2>nul' : 'true');
53 tryRun('bun pm cache rm');
54 const latest = (() => { try { return require('child_process').execSync('npm view acptoapi version', { windowsHide: true }).toString().trim(); } catch { return '(unknown)'; } })();
55 console.log(`[acptoapi] latest on npm: ${latest}`);
56 console.log('[acptoapi] next invocation of `bunx acptoapi@latest` or `npx -y acptoapi@latest` will fetch fresh.');
57 process.exit(0);
HighRuntime Package Install
Package source invokes a package manager install command at runtime.
bin/acptoapi.jsView on unpkg · L45 59} else if (args.includes('--list-brands')) {
60 const { listBrands } = require('../lib/openai-brands');
61 for (const b of listBrands()) console.log(b);
63} else if (args.includes('--list-chains')) {
64 const { listNamedChains, resolveNamedChain } = require('../lib/chain');
65 const names = listNamedChains();