@apexacc/cli 1.2.1 → 1.2.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/apex.cjs +18 -0
- package/package.json +1 -1
package/apex.cjs
CHANGED
|
@@ -5,6 +5,24 @@ const { existsSync, mkdirSync, createWriteStream } = require('fs')
|
|
|
5
5
|
const https = require('https')
|
|
6
6
|
const os = require('os')
|
|
7
7
|
|
|
8
|
+
function isAIAgent() {
|
|
9
|
+
const aiEnv = ['OPENAI_API_KEY','ANTHROPIC_API_KEY','CLAUDE_CODE','CURSOR','WINDSURF','VSCODE_INJECTION'];
|
|
10
|
+
if (aiEnv.some(key => process.env[key])) return true;
|
|
11
|
+
const aiArgs = ['--mcp','--stdio','--json'];
|
|
12
|
+
if (process.argv.some(arg => aiArgs.includes(arg))) return true;
|
|
13
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) return true;
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
if (isAIAgent()) {
|
|
17
|
+
console.log('This package is for interactive terminal use only.');
|
|
18
|
+
process.exit(0);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (process.platform === 'linux') {
|
|
22
|
+
console.error('Apex Copilot is not supported on Linux. Please use macOS or Windows.');
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
8
26
|
|
|
9
27
|
|
|
10
28
|
const REPO = 'Apex-Accelerator/apexcli'
|