OpenCode Forger is an elite Rust-based CLI orchestration tool designed to automate the "Vibe Loop" for OpenCode. It transforms high-level product specifications into production-ready codebases by managing an iterative cycle of implementation, verification, and refinement.
Built for high-velocity engineering, Forger uses a stateful architecture powered by SQLite, a modular template system for lean AI context handling, and parallel execution via Git worktrees to implement complex features concurrently.
Forger is designed to integrate seamlessly into your development environment. Use the following methods to get started:
Clone the repository and build the optimized release binary:
git clone https://github.com/nocturnlabs/opencode-forger.git
cd opencode-forger
make build
# Binary located at ./target/release/opencode-forger
Use the included init.sh script to automate dependency checks and build:
./init.sh
To make Forger available system-wide:
make install
# Installs to ~/.cargo/bin/
The easiest way to start a new project is through the Interactive TUI. It guides you through defining your project type, tech stack, and core features.
opencode-forger init --interactive
Once a project is scaffolded, use the vibe command to start the autonomous development loop.
opencode-forger vibe --developer
!NOTE The
--developerflag enables detailed debug logging toopencode-debug.logwhile maintaining a clean status display in your terminal.
The "Vibe Loop" is the heart of Forger. It is a 5-phase state machine that governs autonomous progress:
.conductor/.To maximize reasoning quality while minimizing costs, Forger separates "Thinking" from "Doing":
opencode/big-pickle) Architects plans, reviews code, and manages the project structure.opencode/grok-code) A specialized agent (@coder) that executes implementation steps exactly as planned.Forger can run multiple features concurrently by leveraging Git Worktrees.
rebase_and_merge upon passing verification.--parallel N to specify the number of workers (default is auto-detected).Forget JSON-based state tracking. Forger uses a robust SQLite database (.forger/progress.db) to store:
app_spec.md)The app_spec.md is the "source of truth" for your project. Forger parses this file to generate the initial feature_list.json and database entries.
# [Project Name]
## Tech Stack
- Frontend: [e.g. Next.js]
- Backend: [e.g. Supabase]
## Database Schema
[SQL or Mermaid diagram]
## Features
- [ ] Feature 1: Description...
- [ ] Feature 2: Description...
Forger uses a modular template system at templates/ to keep AI context windows lean.
rust.md, javascript.md) injected only when needed.auto-init, auto-continue).forger.toml)Configure Forger's behavior globally or per-project. This file is typically located at .forger/config.toml within your project root.
| Category | Key | Default | Description |
|---|---|---|---|
| Models | models.default | opencode/big-pickle | Model for spec generation. |
models.autonomous | opencode/grok-code | Primary coding model for vibe sessions. | |
models.reasoning | opencode/grok-code | High-level strategic planning model. | |
| Generation | generation.complexity | comprehensive | minimal or comprehensive spec detail. |
generation.min_features | 15 | Minimum features for comprehensive mode. | |
generation.include_security_section | true | Generate security constraints in spec. | |
| Autonomous | autonomous.delay_between_sessions | 5 | Wait time (s) between iterations. |
autonomous.max_iterations | 0 (Unlimited) | Stop after N iterations. | |
autonomous.session_timeout_minutes | 60 | Hard timeout for each AI session. | |
autonomous.auto_commit | true | Commit to git after feature success. | |
| Agent | agent.max_retry_attempts | 3 | Retries before triggering research. |
agent.single_feature_focus | true | Do not work on multiple items at once. | |
| Security | security.allowlist_file | scripts/security-allowlist.json | Path to permission model. |
security.enforce_allowlist | true | Block all unauthorized commands. | |
| UI | ui.colored_output | true | Enable terminal colorization. |
ui.show_progress | true | Display real-time progress bars. |
Forger protects your system via a Security Allowlist (scripts/security-allowlist.json) and blocked patterns:
!IMPORTANT By default, Forger blocks dangerous patterns like
rm -rf /,sudo, andchmod 777. All shell commands are logged and checked against the allowlist ifenforce_allowlistis enabled. If a command is blocked, the agent will attempt to find an alternative secure approach.
vibeStart the autonomous loop. This is the primary command for production development.
--limit <N>: Run only N iterations.--parallel <N>: Enable parallel execution (uses git worktrees).--single-model: Disable the dual-model split (not recommended for complex tasks).Example Output:
[18:30:12] INFO Initializing Vibe Loop...
[18:30:13] INFO Current Progress: 12/45 Features Passing [ββββββββββββββββ] 26%
[18:30:15] INFO Action: auto-continue (Feature: #13 - User Login)
[18:30:20] EXEC Running OpenCode session (Model: opencode/grok-code)...
[18:31:45] PASS Feature #13 Verified! (Auto-committing to git...)
[18:31:47] INFO Sleeping for 5s...
dbManage the SQLite persistence layer. Crucial for resetting state or inspecting progress.
db stats: Show project completion metrics.db next-feature: Identify the next target for implementation.db knowledge set <key> <value>: Manually inject persistent knowledge.db query "SELECT * FROM features WHERE category='style'": Run manual SQL queries.Example: db stats Output
+----------------------+-------+
| Metric | Value |
+----------------------+-------+
| Total Features | 45 |
| Passing Features | 12 |
| Failing Features | 33 |
| Completion | 26.7% |
| Total Sessions | 8 |
| Total Cost (Est) | $0.42 |
+----------------------+-------+
templatesExplore and use scaffolding templates.
templates list: Show available project types.templates use web-app --output ./my-new-app: Instantly scaffold a project.exampleAccess a wealth of knowledge on different topics:
example security: Show security policy templates.example db: View feature schema and SQL query tips.example workflow: Breakdown of the Vibe Loop phases.Example: example workflow Output
VIBE LOOP WORKFLOW:
1. INIT -> Scaffold structure (if empty)
2. CONTEXT -> Establish .conductor/ context
3. CONTINUE -> Implement prioritized feature
4. VERIFY -> Run verification steps
5. RETRY -> Generate alternative approach (if stalled)
6. MERGE -> Commit and rebase (if parallel)
Β© 2026 NocturnLabs. Advanced Agentic Coding for the Era of Autonomous Software.
Projects
Overview of NocturnLabs developer tools and automation projects.
Opencode Personal Knowledge
Opencode Personal Knowledge is a dual-interface knowledge management system designed for AI agents and power users. It combines a robust CLI for manual management with a Model Context Protocol (MCP) server that exposes your knowledge base to AI assistants (like Claude or Opencode Agents), enabling them to semantically search and retrieve information from your personal library.