Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
* opencli — Make any website your CLI. AI-powered.
*/

// Ensure standard system paths are available for child processes.
// Some environments (GUI apps, cron, IDE terminals) launch with a minimal PATH
// that excludes /usr/local/bin, /usr/sbin, etc., causing external CLIs to fail.
if (process.platform !== 'win32') {
const std = ['/usr/local/bin', '/usr/bin', '/bin', '/usr/sbin', '/sbin'];
const cur = new Set((process.env.PATH ?? '').split(':').filter(Boolean));
for (const p of std) cur.add(p);
process.env.PATH = [...cur].join(':');
}

import * as os from 'node:os';
import * as path from 'node:path';
import { fileURLToPath } from 'node:url';
Expand Down