Skip to content
Open
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
21 changes: 15 additions & 6 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ package-lock.json
.opencode/tool/
**/.opencode/tool/

# Build and test artifacts
dist/
build/
out/
# Build and test artifacts — NOTE: packages/cli/dist/ must NOT be excluded
# (it is the published CLI binary). Only exclude root-level build dirs.
/dist/
/build/
/out/
coverage/
.nyc_output/
*.tsbuildinfo
Expand All @@ -55,7 +56,13 @@ evals/
dev/
tasks/
integrations/
packages/
# Exclude packages source/config but NOT the compiled CLI dist
packages/cli/src/
packages/cli/node_modules/
packages/cli/tsconfig*.json
packages/cli/bun.lock
packages/compatibility-layer/
packages/plugin-abilities/

# Test and development scripts
Makefile
Expand All @@ -73,9 +80,11 @@ COMPATIBILITY.md
.opencode-test/
.opencode-agents-version

# Exclude scripts/ subdirectory READMEs (only sync-version.js is published)
scripts/README.md

# Keep these (explicitly included in package.json files field)
!.opencode/
!scripts/
!bin/
!registry.json
!install.sh
Expand Down
38 changes: 35 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,41 @@ Use any AI model (Claude, GPT, Gemini, local). No vendor lock-in.

## 🚀 Quick Start

**Prerequisites:** [OpenCode CLI](https://opencode.ai/docs) (free, open-source) • Bash 3.2+ • Git
### Install via npm (recommended)

**Prerequisites:** [Bun](https://bun.sh) ≥ 1.0 • Node.js ≥ 18

> ⚠️ **Bun is required.** The OAC CLI runs on the [Bun](https://bun.sh) runtime.
> Install Bun first: `curl -fsSL https://bun.sh/install | bash`

**Global install (use `oac` anywhere):**
```bash
npm install -g @nextsystems/oac
```

### Step 1: Install
**Then set up a project:**
```bash
cd your-project
oac init
```

**No-install (try without committing):**
```bash
npx @nextsystems/oac init
```

**Keep updated:**
```bash
npm update -g @nextsystems/oac
# or check your current version:
oac doctor
```

---

### Install via curl (alternative)

**Prerequisites:** [OpenCode CLI](https://opencode.ai/docs) (free, open-source) • Bash 3.2+ • Git

**One command:**

Expand All @@ -141,7 +173,7 @@ curl -fsSL https://raw.githubusercontent.com/darrenhinde/OpenAgentsControl/main/

> Use `--install-dir PATH` if you installed to a custom location (e.g. `~/.config/opencode`).

### Step 2: Start Building
### Start Building

```bash
opencode --agent OpenAgent
Expand Down
100 changes: 21 additions & 79 deletions bin/oac.js
Original file line number Diff line number Diff line change
@@ -1,90 +1,32 @@
#!/usr/bin/env node
'use strict';

/**
* OpenAgents Control (OAC) CLI
*
* This is the main entry point for the @openagents/control package.
* It runs the install.sh script to set up the OpenAgents Control system.
*/

const { spawn } = require('child_process');
const { execFileSync } = require('child_process');
const path = require('path');
const fs = require('fs');

// Get the package root directory
const cliDist = path.join(__dirname, '..', 'packages', 'cli', 'dist', 'index.js');
const packageRoot = path.join(__dirname, '..');

// Path to install.sh
const installScript = path.join(packageRoot, 'install.sh');

// Check if install.sh exists
if (!fs.existsSync(installScript)) {
console.error('Error: install.sh not found at', installScript);
if (!fs.existsSync(cliDist)) {
console.error('Error: OAC CLI not built yet. Run: npm run build -w packages/cli');
process.exit(1);
}

// Get command line arguments (skip node and script path)
const args = process.argv.slice(2);

// If no arguments provided, show help
if (args.length === 0) {
console.log(`
╔═══════════════════════════════════════════════════════════════╗
║ OpenAgents Control (OAC) ║
║ AI agent framework for plan-first development workflows ║
╚═══════════════════════════════════════════════════════════════╝

Usage:
oac [profile] Install with a specific profile
oac --help Show this help message
oac --version Show version information

Available Profiles:
essential Minimal setup (OpenAgent only)
developer Full development setup (recommended)
business Business-focused agents
advanced Advanced features and specialists
full Everything included

Examples:
oac Interactive installation
oac developer Install with developer profile
oac --help Show detailed help

For more information, visit:
https://github.com/darrenhinde/OpenAgentsControl
`);
process.exit(0);
}

// Handle --version flag
if (args.includes('--version') || args.includes('-v')) {
const packageJson = require(path.join(packageRoot, 'package.json'));
console.log(`@openagents/control v${packageJson.version}`);
process.exit(0);
}

// Handle --help flag
if (args.includes('--help') || args.includes('-h')) {
// Run install.sh with --help
args.push('--help');
}

// Run the install script with bash
const child = spawn('bash', [installScript, ...args], {
cwd: packageRoot,
stdio: 'inherit',
env: {
...process.env,
OAC_PACKAGE_ROOT: packageRoot
// On Windows, npm-installed executables are .cmd wrappers — use exact name to resolve them
const isWindows = process.platform === 'win32';
const bunExecutable = isWindows ? 'bun.cmd' : 'bun';

try {
execFileSync(bunExecutable, [cliDist, ...process.argv.slice(2)], {
stdio: 'inherit',
env: { ...process.env, OAC_PACKAGE_ROOT: packageRoot },
shell: false,
});
} catch (err) {
if (err.code === 'ENOENT') {
console.error('Error: Bun is required to run OAC CLI. Install from https://bun.sh');
process.exit(1);
}
});

child.on('error', (error) => {
console.error('Error running install script:', error.message);
process.exit(1);
});

child.on('exit', (code) => {
process.exit(code || 0);
});
process.exitCode = err.status ?? 1;
}
Loading
Loading