mirror of
https://github.com/nbitslabs/flock.git
synced 2026-08-31 07:20:39 +00:00
No description
- Go 65.4%
- JavaScript 25%
- HTML 4.4%
- Shell 4.2%
- CSS 0.8%
- Other 0.2%
Two bugs: 1. RemoveWorktree ran git worktree remove without setting cmd.Dir to the source repo, so git couldn't find the worktree in its tracking. 2. When git doesn't recognize a path as a worktree (stale tracking), the code retried the same failing command. Now falls back to os.RemoveAll + git worktree prune. Also removed the retry loop — the fallback handles the failure case directly instead of retrying the same broken command. |
||
|---|---|---|
| .github/workflows | ||
| agents | ||
| cmd/flock | ||
| internal | ||
| migrations | ||
| web | ||
| .gitignore | ||
| AGENTS.md | ||
| flake.lock | ||
| flake.nix | ||
| flock.example.toml | ||
| go.mod | ||
| go.sum | ||
| install.sh | ||
| Makefile | ||
| PLAN.md | ||
| README.md | ||
| sqlc.yaml | ||
flock
Agent orchestration system that proxies and manages OpenCode instances.
Installation
Quick Install (One-Liner)
curl -sSL https://raw.githubusercontent.com/nbitslabs/flock/main/install.sh | bash
This will:
- Install Go (if not present)
- Install GitHub CLI (gh)
- Install OpenCode
- Build Flock from source
- Create configuration files
- Set up system services (systemd on Linux, launchd on macOS)
- Configure auto-updates via cron
Manual Installation
# Clone the repository
git clone https://github.com/nbitslabs/flock.git
cd flock
# Build the binary
go build -o flock ./cmd/flock
# Run
./flock
Configuration
After installation, configure your environment:
# Authenticate with GitHub
gh auth login
# Authenticate with OpenCode
opencode auth login
Run
go run ./cmd/flock
Architecture
- Proxy/Orchestrator: Routes requests to child OpenCode instances
- Instance Management: Spawns/manages OpenCode processes, tracks state in SQLite
- Real-time Events: SSE pipeline from OpenCode -> Manager -> Browser
- Database: SQLite (
modernc.org/sqlite) for instance/session metadata - Frontend: Vanilla JS with TailwindCSS
Tech Stack
- Go 1.22+
- SQLite (pure Go)
- TailwindCSS
- Server-Sent Events (SSE)