openplus

module
v0.0.1-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2026 License: Apache-2.0

README

OpenPlus

A pure-Go, terminal-native coding agent.
Anthropic and OpenAI-compatible models · persistent memory · LSP code intelligence · MCP tools.

version status go platforms license


Alpha. v0.0.1-alpha is the first tagged build. The architecture is settled and the test suite is green, but interfaces may still move and it has seen little real-world mileage. See Status for what is proven and what is not.

Install

curl -fsSL https://raw.githubusercontent.com/7-solutions/openplus/main/scripts/install.sh | sh

Works on Linux, macOS, and WSL2 (amd64 and arm64). The script detects your platform, verifies the SHA-256 checksum, and installs to ~/.local/bin (or /usr/local/bin when writable).

Other ways to install
# Pin a version
OPENPLUS_VERSION=v0.0.1-alpha curl -fsSL https://raw.githubusercontent.com/7-solutions/openplus/main/scripts/install.sh | sh

# Choose the directory
OPENPLUS_INSTALL=$HOME/bin curl -fsSL https://raw.githubusercontent.com/7-solutions/openplus/main/scripts/install.sh | sh

# With Go
go install github.com/7-solutions/openplus/cmd/openplus@latest

# From source
git clone https://github.com/7-solutions/openplus && cd openplus
CGO_ENABLED=0 go build -o openplus ./cmd/openplus

Native Windows is not supported. Use WSL2 and install from inside your Linux distribution.

Quickstart

# No API key needed — the scripted fake provider proves the wiring
openplus --fake -p "say hello"

# With a real model
export ANTHROPIC_API_KEY=sk-ant-...
openplus -p "explain the error handling in internal/agent/loop.go"

# Interactive TUI
openplus

Configure

OpenPlus reads opencode.json from your project root — the same surface OpenCode uses — plus AGENTS.md for project instructions.

{
  "model": "anthropic/claude-sonnet-5",
  "instructions": ["AGENTS.md"],

  "provider": {
    "anthropic": { "options": { "apiKey": "{env:ANTHROPIC_API_KEY}" } },
    "local": {
      "options": { "baseURL": "http://localhost:11434/v1", "apiKey": "ollama" },
      "models": { "qwen2.5-coder": { "name": "Qwen2.5 Coder" } }
    }
  },

  "permission": { "bash": "ask", "write": "ask" },

  // Code intelligence — opt-in, you supply the server binary
  "lsp": {
    "enabled": true,
    "servers": { ".go": { "command": "gopls" } }
  }
}

Full reference: docs/configuration.md.

What it does

Models Anthropic Messages and any OpenAI-compatible endpoint (incl. Ollama), first-class
Tools read write edit bash glob grep, all behind a permission gate
Memory Local vector + FTS5 hybrid search with tunable RRF fusion; never leaves your machine
Code intelligence LSP: diagnostics, hover, definition, symbols, references — diagnostics fed back automatically after edits
MCP Connect any MCP server; its tools join the registry namespaced
Docs Context7 wired as a default docs source, so the model reads current library docs
Orchestration Parallel subagents in isolated git worktrees, JS workflows, best-of-N with a judge
Self-improvement /dream mines session traces into memory; /distill turns repeated work into skills

LSP in one minute

go install golang.org/x/tools/gopls@latest
{ "lsp": { "enabled": true, "servers": { ".go": { "command": "gopls" } } } }

Now the agent sees compiler errors in files it edits, without being asked, and can call lsp_hover, lsp_definition, lsp_symbols, and lsp_references directly. Servers start lazily on first use; a missing binary is a warning, never a crash.

Commands

/help lists everything. Highlights:

Command Does
/docs <library> Fetch current library documentation (Context7)
/compose <feature> Spec → implement → verify → review pipeline
/subagents <prompts> Run work in parallel, isolated git worktrees
/max [n] <prompt> Best-of-N sampling with a judge
/dream · /distill Mine this session into durable memory or a reusable skill
/workflow <name> Run a Go or JavaScript workflow
/theme Switch color theme (color-vision aware)

Full list: docs/commands.md.

Status

Alpha. Honest accounting of where this stands:

Proven

  • 27 packages, go test ./... green, -race clean
  • CGO_ENABLED=0 build gate enforced in CI
  • Architecture guarded by regression tests, not convention — six of them, including two that fail the build if a wire type crosses a port boundary
  • LSP verified end to end against a real gopls

Not yet proven

  • Little real-world mileage. Interfaces may move before v0.1.0.
  • The binary links glibc dynamically, despite CGO_ENABLED=0: the Turso driver reaches libturso through purego, which needs the dynamic loader. It is portable across mainstream glibc distributions but will not run on stock Alpine/musl. The "single static binary" goal is not currently met.
  • macOS and arm64 builds are cross-compiled and CI-tested, but have had no manual soak testing.

Not built (deliberately deferred, each needs its own decision record): voice input, MCP marketplace, web/share UI, hosted multi-tenant mode, LSP server auto-install.

Architecture

Ports and adapters, enforced rather than encouraged. The core depends on eleven port interfaces in internal/ports/; every external system is an adapter behind one.

internal/ports/        the eleven seams + neutral types (no wire type may cross)
  providerfake/        scripted provider for tests
internal/provider/     adapter-only: anthropic · openaicompat · select · sse
internal/lsp/          LSP adapter: client · manager · wire  (only place LSP is known)
internal/memory/       Turso vector + modernc FTS5 shadow, RRF fusion
internal/agent/        the turn loop
internal/runtime/      composition root: ports → adapters
internal/tui/          Bubble Tea front-end

Two hard rules carry regression tests that fail the build when violated:

  • Core depends on ports, not adaptersinternal/ports/leak_guard_test.go
  • No wire type crosses a seaminternal/ports/lsp_leak_guard_test.go

Decisions live in docs/adr/; specs and change history in openspec/. Start with AGENTS.md — it is the single source of truth for how this project is built.

Contributing

The build gate is mandatory and spec-first: an approved OpenSpec change (openspec/changes/<id>/) exists before any code, tests are written red first, and every architectural rule ships with the test that enforces it. Read AGENTS.md before starting.

go build ./... && CGO_ENABLED=0 go build ./...
go test ./... && go test -race ./internal/...
go vet ./...

Documentation

License

Apache License 2.0 — Copyright 2026 7 Solutions.

Directories

Path Synopsis
cmd
openplus command
Command openplus is the entrypoint.
Command openplus is the entrypoint.
internal
agent
Package agent implements the core turn loop (spec: openspec/specs/agent-loop, ADR-0001, ADR-0005, ADR-0007).
Package agent implements the core turn loop (spec: openspec/specs/agent-loop, ADR-0001, ADR-0005, ADR-0007).
compose
Package compose implements the spec→ship phase machine (ADR-0002) that enforces the house gates: grill → spec → implement → verify → review → finish.
Package compose implements the spec→ship phase machine (ADR-0002) that enforces the house gates: grill → spec → implement → verify → review → finish.
config
Package config loads the OpenCode-compatible configuration surface (opencode.json + AGENTS.md) into neutral config values (ADR-0001).
Package config loads the OpenCode-compatible configuration surface (opencode.json + AGENTS.md) into neutral config values (ADR-0001).
contextmgr
Package contextmgr implements the Tokenizer, Budgeter, and Checkpointer ports (ADR-0008): estimate token cost, decide what enters the context window in priority order, and checkpoint/reconstruct when the window fills up.
Package contextmgr implements the Tokenizer, Budgeter, and Checkpointer ports (ADR-0008): estimate token cost, decide what enters the context window in priority order, and checkpoint/reconstruct when the window fills up.
coordinate
Package coordinate is the native symbol-lock store for the NativeCoordinator (change 0013).
Package coordinate is the native symbol-lock store for the NativeCoordinator (change 0013).
diff
Package diff produces a minimal line-level unified diff for the edit tool's diff view (T-031).
Package diff produces a minimal line-level unified diff for the edit tool's diff view (T-031).
embed
Package embed defines the Embedder port (ADR-0004) and a local adapter that speaks the OpenAI-compatible /embeddings endpoint.
Package embed defines the Embedder port (ADR-0004) and a local adapter that speaks the OpenAI-compatible /embeddings endpoint.
glob
Package glob is a dep-free path-glob matcher supporting *, ?, and **.
Package glob is a dep-free path-glob matcher supporting *, ?, and **.
improve
Package improve implements the self-improvement loop (M9): /dream extracts durable facts from session traces and prunes stale memory, and /distill mines repeated tool sequences into skill, subagent, and command scaffolds.
Package improve implements the self-improvement loop (M9): /dream extracts durable facts from session traces and prunes stale memory, and /distill mines repeated tool sequences into skill, subagent, and command scaffolds.
jsworkflow
Package jsworkflow is the goja-backed adapter that compiles a `.js` workflow into an orchestrate.Workflow (ADR-0009).
Package jsworkflow is the goja-backed adapter that compiles a `.js` workflow into an orchestrate.Workflow (ADR-0009).
lsp
Package lsp is the Language Server Protocol adapter behind the ports.LanguageService port (change 0026, ADR-0017).
Package lsp is the Language Server Protocol adapter behind the ports.LanguageService port (change 0026, ADR-0017).
mcp
Package mcp connects to Model Context Protocol servers and exposes their tools through the unchanged Tool port (change 0015, ADR-0010).
Package mcp connects to Model Context Protocol servers and exposes their tools through the unchanged Tool port (change 0015, ADR-0010).
memo
Package memo is the file-based memory surface (T-044): MEMORY.md, notes.md, and tasks/<id>/progress.md.
Package memo is the file-based memory surface (T-044): MEMORY.md, notes.md, and tasks/<id>/progress.md.
memory
Package memory — FTS5 lexical shadow index (change 0021).
Package memory — FTS5 lexical shadow index (change 0021).
orchestrate
Package orchestrate implements subagents, the Go-native Workflow engine, and goal-driven stopping (ADR-0006, ADR-0002).
Package orchestrate implements subagents, the Go-native Workflow engine, and goal-driven stopping (ADR-0006, ADR-0002).
policy
Package policy implements the PolicyGate port (ADR-0007).
Package policy implements the PolicyGate port (ADR-0007).
ports
Neutral provider model types (ADR-0005; change 0018).
Neutral provider model types (ADR-0005; change 0018).
ports/providerfake
Package portsfake provides a scripted Provider for tests and for proving the agent loop without any network access or API key (change 0018; formerly provider.Fake in internal/provider/fake.go).
Package portsfake provides a scripted Provider for tests and for proving the agent loop without any network access or API key (change 0018; formerly provider.Fake in internal/provider/fake.go).
provider
Package provider holds the concrete model adapters and adapter-only helpers.
Package provider holds the concrete model adapters and adapter-only helpers.
provider/anthropic
Package anthropic is the Anthropic Messages API adapter (ADR-0005, T-012).
Package anthropic is the Anthropic Messages API adapter (ADR-0005, T-012).
provider/openaicompat
Package openaicompat is the OpenAI-compatible Chat Completions adapter (ADR-0005, T-013).
Package openaicompat is the OpenAI-compatible Chat Completions adapter (ADR-0005, T-013).
provider/select
Package selectadapter is the adapter-selection composition layer (ADR-0005, T-014).
Package selectadapter is the adapter-selection composition layer (ADR-0005, T-014).
runtime
Package runtime is the composition root (change 0002): it assembles the subsystems built in change 0001 into a live session.
Package runtime is the composition root (change 0002): it assembles the subsystems built in change 0001 into a live session.
skills
Package skills implements the SkillIndex port (ADR-0002): discovery of SKILL.md files across a priority-ordered list of directories, plus lookup.
Package skills implements the SkillIndex port (ADR-0002): discovery of SKILL.md files across a priority-ordered list of directories, plus lookup.
symbols
Package symbols indexes claimable Go symbols with their source locations, so a coordinator can lock at the symbol (function/type) level rather than the file level (change 0013).
Package symbols indexes claimable Go symbols with their source locations, so a coordinator can lock at the symbol (function/type) level rather than the file level (change 0013).
tool
Package tool defines the Tool port (ADR-0001 loop design).
Package tool defines the Tool port (ADR-0001 loop design).
tui
Package tui is the Bubble Tea front-end (ADR-0001, T-030/T-031).
Package tui is the Bubble Tea front-end (ADR-0001, T-030/T-031).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL