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
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Related tools:

- [oh-my-codex (OMX)](https://github.com/Yeachan-Heo/oh-my-codex)
- [OpenSpec](https://github.com/Fission-AI/OpenSpec)
- [codex-account-switcher-cli](https://github.com/recodeecom/codex-account-switcher-cli)

## Fast setup (recommended)

Expand All @@ -62,7 +63,7 @@ gx init

That one command runs:

1. detects whether OMX/OpenSpec are already globally installed,
1. detects whether OMX/OpenSpec/codex-auth are already globally installed,
2. asks strict Y/N approval only if something is missing,
3. installs guardrail scripts/hooks,
4. repairs common safety problems,
Expand Down Expand Up @@ -221,9 +222,9 @@ Use this exact checklist to setup multi-agent safety in this repository for Code
gx setup
# alias: gx init

- Setup detects global OMX/OpenSpec first.
- Setup detects global OMX/OpenSpec/codex-auth first.
- If one is missing and setup asks for approval, reply explicitly:
- y = run: npm i -g oh-my-codex @fission-ai/openspec (missing ones only)
- y = run: npm i -g oh-my-codex @fission-ai/openspec @imdeadpool/codex-account-switcher (missing ones only)
- n = skip global installs

3) If setup reports warnings/errors, repair + re-check:
Expand Down Expand Up @@ -274,12 +275,12 @@ bash scripts/openspec/init-plan-workspace.sh <plan-slug> # optional OpenSpec p
```

No command defaults to `gx status` (non-mutating health/status view).
`gx status` reports CLI/runtime info, global OMX/OpenSpec service status, and repo safety service state.
`gx status` reports CLI/runtime info, global OMX/OpenSpec/codex-auth service status, and repo safety service state.
`gx init` is an alias of `gx setup`.
When run in an interactive terminal, default `GuardeX` checks npm for a newer version first
and asks `[y/N]` whether to update immediately (default is `N`).

- Interactive setup: prompts for Y/N approval before global OMX/OpenSpec install.
- Interactive setup: prompts for Y/N approval before global OMX/OpenSpec/codex-auth install.
- Interactive prompt is strict (`[y/n]`) and waits for explicit answer.
- Non-interactive setup: skips global installs by default; use `--yes-global-install` to force.

Expand Down
12 changes: 8 additions & 4 deletions bin/multiagent-safety.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
const TOOL_NAME = 'guardex';
const SHORT_TOOL_NAME = 'gx';
const LEGACY_NAMES = ['musafety', 'multiagent-safety'];
const GLOBAL_TOOLCHAIN_PACKAGES = ['oh-my-codex', '@fission-ai/openspec'];
const GLOBAL_TOOLCHAIN_PACKAGES = [
'oh-my-codex',
'@fission-ai/openspec',
'@imdeadpool/codex-account-switcher',
];
const MAINTAINER_RELEASE_REPO = path.resolve(
process.env.MUSAFETY_RELEASE_REPO || '/tmp/multiagent-safety',
);
Expand Down Expand Up @@ -132,9 +136,9 @@ const AI_SETUP_PROMPT = `Use this exact checklist to setup GuardeX (Guardian T-R
gx setup
# alias: gx init

- Setup detects global OMX/OpenSpec first.
- Setup detects global OMX/OpenSpec/codex-auth first.
- If one is missing and setup asks for approval, reply explicitly:
- y = run: npm i -g oh-my-codex @fission-ai/openspec (missing ones only)
- y = run: npm i -g oh-my-codex @fission-ai/openspec @imdeadpool/codex-account-switcher (missing ones only)
- n = skip global installs

3) If setup reports warnings/errors, repair + re-check:
Expand Down Expand Up @@ -1993,7 +1997,7 @@ function setup(rawArgs) {
`[${TOOL_NAME}] ✅ Global tools installed (${(globalInstallStatus.packages || []).join(', ')}).`,
);
} else if (globalInstallStatus.status === 'already-installed') {
console.log(`[${TOOL_NAME}] ✅ OMX/OpenSpec global tools already installed. Skipping.`);
console.log(`[${TOOL_NAME}] ✅ OMX/OpenSpec/codex-auth global tools already installed. Skipping.`);
} else if (globalInstallStatus.status === 'failed') {
console.log(
`[${TOOL_NAME}] ⚠️ Global install failed: ${globalInstallStatus.reason}\n` +
Expand Down
11 changes: 7 additions & 4 deletions test/install.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,10 @@ test('copy-prompt outputs AI setup instructions', () => {
const result = runNode(['copy-prompt'], repoDir);
assert.equal(result.status, 0, result.stderr || result.stdout);
assert.match(result.stdout, /npm i -g @imdeadpool\/guardex/);
assert.match(result.stdout, /npm i -g oh-my-codex @fission-ai\/openspec/);
assert.match(
result.stdout,
/npm i -g oh-my-codex @fission-ai\/openspec @imdeadpool\/codex-account-switcher/,
);
assert.match(result.stdout, /gx setup/);
assert.match(result.stdout, /gx init/);
assert.match(result.stdout, /Codex or Claude/);
Expand Down Expand Up @@ -1229,13 +1232,13 @@ test('setup dry-run accepts explicit global install approval flags', () => {
assert.match(result.stdout, /Dry run setup done/);
});

test('setup skips global install when OMX/OpenSpec are already installed', () => {
test('setup skips global install when OMX/OpenSpec/codex-auth are already installed', () => {
const repoDir = initRepo();
const marker = path.join(repoDir, '.global-install-called');
const fakeNpm = createFakeNpmScript(`
if [[ "$1" == "list" ]]; then
cat <<'JSON'
{"dependencies":{"oh-my-codex":{"version":"1.0.0"},"@fission-ai/openspec":{"version":"1.0.0"}}}
{"dependencies":{"oh-my-codex":{"version":"1.0.0"},"@fission-ai/openspec":{"version":"1.0.0"},"@imdeadpool/codex-account-switcher":{"version":"1.0.0"}}}
JSON
exit 0
fi
Expand Down Expand Up @@ -1282,7 +1285,7 @@ exit 1
assert.equal(result.status, 0, result.stderr || result.stdout);
assert.equal(fs.existsSync(marker), true, 'global install should run for missing package');
const args = fs.readFileSync(marker, 'utf8').trim();
assert.equal(args, 'i -g @fission-ai/openspec');
assert.equal(args, 'i -g @fission-ai/openspec @imdeadpool/codex-account-switcher');
});

test('worktree prune removes merged agent worktrees and branches', () => {
Expand Down
Loading