Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Removed

- Deleted `adapters/codex/install.sh` and `adapters/opencode/install.sh` (#395). Both sourced every command and skill from `plugins/`, a tree removed when plugins moved to standalone repos, so each mapping took the "skipped" branch and the scripts installed nothing while still printing `[OK] Installation complete!` and listing skills they had not written. They were not inert: before copying, they `rm -rf`'d five skill directories and `~/.codex/prompts`, so running one deleted a working install and reported success. `agentsys --tool codex` / `agentsys --tool opencode` (`bin/cli.js`) is the only install path, and the adapter READMEs, the OpenCode plugin checklist, and the `maintain-cross-platform` skill no longer point at the scripts.

### Security

- Claude plugin marketplace/install/update/uninstall in `bin/cli.js` now spawn via `execFileSync` with an argv array, so no plugin ID reaches a shell (#388).
Expand Down
80 changes: 4 additions & 76 deletions __tests__/opencode-compatibility.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,80 +252,8 @@ describe('OpenCode Compatibility', () => {
});
});

describe('Install script validation', () => {
it('should have OpenCode install script', () => {
const installPath = path.join(__dirname, '../adapters/opencode/install.sh');
expect(fs.existsSync(installPath)).toBe(true);
});

it('should install lib files to OpenCode commands directory', () => {
const installScript = fs.readFileSync(
path.join(__dirname, '../adapters/opencode/install.sh'),
'utf-8'
);

// Should copy lib files (cp -r or similar)
expect(installScript).toMatch(/cp\s+-r|cp.*\$.*lib/);

// Should define OPENCODE_CONFIG_DIR using XDG path (not ~/.opencode/)
expect(installScript).toMatch(/OPENCODE_CONFIG_DIR/);
// Should reference both XDG_CONFIG_HOME and .config/opencode
expect(installScript).toContain('XDG_CONFIG_HOME');
expect(installScript).toContain('.config/opencode');
});

it('should handle empty/whitespace XDG_CONFIG_HOME like JavaScript', () => {
const installScript = fs.readFileSync(
path.join(__dirname, '../adapters/opencode/install.sh'),
'utf-8'
);

// Should check for non-empty AND non-whitespace (matching JS behavior)
// The bash pattern [^[:space:]] ensures whitespace-only values are rejected
expect(installScript).toContain('-n "${XDG_CONFIG_HOME}"');
expect(installScript).toContain('[^[:space:]]');
});

it('should clean up legacy ~/.opencode/ paths', () => {
const installScript = fs.readFileSync(
path.join(__dirname, '../adapters/opencode/install.sh'),
'utf-8'
);

// Should have legacy cleanup
expect(installScript).toMatch(/LEGACY_OPENCODE_DIR/);
expect(installScript).toMatch(/legacy/i);
});

it('should have complete agent list matching dev-install.js', () => {
const installScript = fs.readFileSync(
path.join(__dirname, '../adapters/opencode/install.sh'),
'utf-8'
);

// Critical agents that must be in both lists
const criticalAgents = [
'exploration-agent.md',
'implementation-agent.md',
'planning-agent.md',
'perf-orchestrator.md',
'enhancement-orchestrator.md',
'worktree-manager.md'
];

for (const agent of criticalAgents) {
expect(installScript).toContain(agent);
}
});

it('should handle path substitutions for OpenCode', () => {
const installScript = fs.readFileSync(
path.join(__dirname, '../adapters/opencode/install.sh'),
'utf-8'
);

// Should transform CLAUDE_PLUGIN_ROOT to PLUGIN_ROOT
expect(installScript).toMatch(/CLAUDE_PLUGIN_ROOT.*PLUGIN_ROOT|sed.*PLUGIN_ROOT/);
});
});
// The former 'Install script validation' block asserted on
// adapters/opencode/install.sh, which was removed: it sourced files from the
// deleted plugins/ tree and so installed nothing. bin/cli.js is the only
// installer; its XDG_CONFIG_HOME handling is covered in dev-install.test.js.
});
31 changes: 12 additions & 19 deletions adapters/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ OpenAI's Codex command-line interface.

**Installation:**
```bash
git clone https://github.com/agent-sh/agentsys.git
cd agentsys
./adapters/codex/install.sh
npm install -g agentsys
agentsys --tool codex
```

**Usage:**
Expand All @@ -44,9 +43,8 @@ Open-source AI coding assistant.

**Installation:**
```bash
git clone https://github.com/agent-sh/agentsys.git
cd agentsys
./adapters/opencode/install.sh
npm install -g agentsys
agentsys --tool opencode
```

**Usage:**
Expand Down Expand Up @@ -145,32 +143,28 @@ claude plugin install next-task@agentsys

### Codex CLI
```bash
# Via installer script
./adapters/codex/install.sh
agentsys --tool codex
```

**Pros:**
- One-command installation
- All commands at once
- Easy updates (re-run installer)
- Easy updates (re-run the CLI)

**Cons:**
- Requires git clone first
- Manual updates

### OpenCode
```bash
# Via installer script
./adapters/opencode/install.sh
agentsys --tool opencode
```

**Pros:**
- One-command installation
- OpenCode-specific features (@, !)
- Easy updates (re-run installer)
- Easy updates (re-run the CLI)

**Cons:**
- Requires git clone first
- Manual updates

---
Expand All @@ -195,9 +189,8 @@ Automatic via marketplace updates.

### Codex CLI & OpenCode
```bash
cd /path/to/agentsys
git pull origin main
./adapters/codex/install.sh # Or ./adapters/opencode/install.sh
npm install -g agentsys@latest
agentsys --tool codex # Or: agentsys --tool opencode
```

---
Expand All @@ -216,7 +209,7 @@ git pull origin main
### Path errors in commands
Re-run the installer to fix path substitutions:
```bash
./adapters/[tool]/install.sh
agentsys --tool [tool]
```

### Node.js errors
Expand All @@ -240,7 +233,7 @@ Found a bug or want to add support for another tool?
1. Open an issue: https://github.com/agent-sh/agentsys/issues
2. Submit a PR with:
- New adapter directory: `adapters/[tool-name]/`
- Installation script: `install.sh`
- Install support in `bin/cli.js` (the only installer)
- Documentation: `README.md`
- Update this file

Expand Down
12 changes: 5 additions & 7 deletions adapters/codex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ Professional-grade slash commands adapted for OpenAI's Codex CLI.
## Quick Install

```bash
git clone https://github.com/agent-sh/agentsys.git
cd agentsys
./adapters/codex/install.sh
npm install -g agentsys
agentsys --tool codex
```

## Prerequisites
Expand Down Expand Up @@ -219,9 +218,8 @@ Node.js · Python · Rust · Go · Java
To update commands:

```bash
cd /path/to/agentsys
git pull origin main
./adapters/codex/install.sh
npm install -g agentsys@latest
agentsys --tool codex
```

---
Expand All @@ -236,7 +234,7 @@ git pull origin main
### Path errors
Re-run installer to fix path substitutions:
```bash
./adapters/codex/install.sh
agentsys --tool codex
```

### Node.js not found
Expand Down
Loading
Loading