Skip to content

Commit 2e35b77

Browse files
feat(cli): add codex-smd wrapper for dangerous mode
Add codex-sm-danger wrapper that prepends --dangerously-skip-permissions flag, matching the pattern of claude-smd for consistent CLI behavior. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7139c6b commit 2e35b77

4 files changed

Lines changed: 42 additions & 3 deletions

File tree

bin/codex-smd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env node
2+
/**
3+
* Codex-SM-Danger CLI Launcher (ESM)
4+
* Delegates to built CLI in dist without requiring tsx.
5+
*/
6+
import('../dist/cli/codex-sm-danger.js');

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stackmemoryai/stackmemory",
3-
"version": "0.5.57",
3+
"version": "0.5.58",
44
"description": "Lossless memory runtime for AI coding tools - organizes context as a call stack instead of linear chat logs, with team collaboration and infinite retention",
55
"engines": {
66
"node": ">=20.0.0",
@@ -11,6 +11,7 @@
1111
"bin": {
1212
"stackmemory": "dist/cli/index.js",
1313
"codex-sm": "dist/cli/codex-sm.js",
14+
"codex-smd": "bin/codex-smd",
1415
"claude-sm": "bin/claude-sm",
1516
"claude-smd": "bin/claude-smd",
1617
"opencode-sm": "bin/opencode-sm"

src/cli/codex-sm-danger.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env node
2+
3+
/**
4+
* codex-sm-danger: Codex-SM wrapper with --dangerously-skip-permissions
5+
* Shorthand for: codex-sm --dangerously-skip-permissions [args]
6+
*/
7+
8+
import { spawn } from 'child_process';
9+
import * as path from 'path';
10+
11+
// __filename and __dirname are provided by esbuild banner for ESM compatibility
12+
13+
// Get the codex-sm script path
14+
const codexSmPath = path.join(__dirname, 'codex-sm.js');
15+
16+
// Prepend the danger flag to all args
17+
const args = ['--dangerously-skip-permissions', ...process.argv.slice(2)];
18+
19+
// Spawn codex-sm with the danger flag
20+
const child = spawn('node', [codexSmPath, ...args], {
21+
stdio: 'inherit',
22+
env: process.env,
23+
});
24+
25+
child.on('exit', (code) => {
26+
process.exit(code || 0);
27+
});
28+
29+
child.on('error', (err) => {
30+
console.error('Failed to launch codex-sm:', err.message);
31+
process.exit(1);
32+
});

0 commit comments

Comments
 (0)