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
18 changes: 18 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail

echo "Running pre-push checks..."

echo "→ Lint"
npm run lint

echo "→ Typecheck"
npm run typecheck

echo "→ Build"
npm run build

echo "→ Test"
npm test

echo "Pre-push checks passed."
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- run: npm install

- name: Lint
run: npm run lint

- name: Typecheck
run: npm run typecheck

- name: Build
run: npm run build

- name: Test
run: npm test
55 changes: 55 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# agent-ctl

Universal agent supervision interface — monitor and control AI coding agents from a single CLI.

## Quick Start

```bash
npm install
npm run build
npm link # makes `agent-ctl` available globally
```

## Development

```bash
npm run dev # run CLI via tsx (no build needed)
npm test # vitest run
npm run test:watch
npm run typecheck # tsc --noEmit
npm run lint # biome check
npm run lint:fix # biome check --write
```

## Project Structure

- `src/core/types.ts` — Core interfaces (AgentAdapter, AgentSession, etc.)
- `src/adapters/claude-code.ts` — Claude Code adapter (reads ~/.claude/, cross-refs PIDs)
- `src/adapters/openclaw.ts` — OpenClaw gateway adapter (WebSocket RPC)
- `src/cli.ts` — CLI entry point (commander)

## Conventions

- **Language:** TypeScript (strict mode), ESM-only (`"type": "module"`)
- **Testing:** vitest — test files live next to source (`*.test.ts`)
- **Linting:** biome (check + format)
- **Build:** tsc → dist/

## Git

- **Identity:** `git commit --author="Doink (OpenClaw) <charlie+doink@kindo.ai>"`
- **Co-author:** `Co-Authored-By: Charlie Hulcher <charlie@kindo.ai>`
- **Branch protection:** main requires PR review (do not push directly)
- **Pre-push hook:** runs build + test before push

## Release

```bash
./scripts/release.sh [patch|minor|major]
```

Bumps version, builds, tags, and runs `npm link`. No npm publish (local tool).

## CI

GitHub Actions runs on push/PR to main: install → lint → typecheck → build → test.
17 changes: 17 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.2/schema.json",
"files": {
"includes": ["src/**/*.ts"]
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
}
}
166 changes: 166 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
"build": "tsc",
"dev": "tsx src/cli.ts",
"test": "vitest run",
"test:watch": "vitest"
"test:watch": "vitest",
"typecheck": "tsc --noEmit",
"lint": "biome check src/",
"lint:fix": "biome check --write src/",
"format": "biome format --write src/",
"prepare": "git config core.hooksPath .githooks"
},
"author": "Charlie Hulcher <charlie.hulcher@gmail.com>",
"license": "MIT",
Expand All @@ -21,5 +26,8 @@
"tsx": "^4.21.0",
"typescript": "^5.9.3",
"vitest": "^4.0.18"
},
"devDependencies": {
"@biomejs/biome": "^2.4.2"
}
}
35 changes: 35 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
set -euo pipefail

BUMP="${1:-patch}"

if [[ "$BUMP" != "patch" && "$BUMP" != "minor" && "$BUMP" != "major" ]]; then
echo "Usage: $0 [patch|minor|major]"
exit 1
fi

# Ensure clean working tree
if [[ -n "$(git status --porcelain)" ]]; then
echo "Error: working tree is not clean. Commit or stash changes first."
exit 1
fi

# Bump version
NEW_VERSION=$(npm version "$BUMP" --no-git-tag-version)
echo "Bumped to $NEW_VERSION"

# Build and test
npm run build
npm test

# Link locally
npm link

# Commit and tag
git add package.json package-lock.json
git commit --author="Doink (OpenClaw) <charlie+doink@kindo.ai>" -m "release: $NEW_VERSION"
git tag "$NEW_VERSION"

echo ""
echo "Released $NEW_VERSION"
echo "Run 'git push && git push --tags' to publish."
Loading