Skip to content
Merged
Show file tree
Hide file tree
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
24 changes: 24 additions & 0 deletions codex-cli/bin/codex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env node
// Unified entry point for Codex CLI on all platforms
// Dynamically loads the compiled ESM bundle in dist/cli.js

import path from 'path';
import { fileURLToPath, pathToFileURL } from 'url';

// Determine this script's directory
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

// Resolve the path to the compiled CLI bundle
const cliPath = path.resolve(__dirname, '../dist/cli.js');
const cliUrl = pathToFileURL(cliPath).href;

// Load and execute the CLI
(async () => {
try {
await import(cliUrl);
} catch (err) {
console.error(err);
process.exit(1);
}
})();
2 changes: 1 addition & 1 deletion codex-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.2504172351",
"license": "Apache-2.0",
"bin": {
"codex": "bin/codex"
"codex": "bin/codex.js"
},
"type": "module",
"engines": {
Expand Down