habithive-code
v0.2.4
Published
A control layer for opencode: one-command install, live simple/complex mode switching, and a model tree for oh-my-opencode agents.
Maintainers
Readme
habithive-code
A thin control layer for opencode that makes two things effortless:
- Mode switching — flip between complex (full oh-my-opencode — for hard tasks) and simple (vanilla opencode — for everyday use) with one command or an in-app menu, resuming the same session.
- A model tree — set models across oh-my-opencode's many agents/categories from a single menu instead of hand-editing JSON.
habithive-code does not bundle opencode or oh-my-opencode. It installs / points to them from their official sources under their own licenses. All credit for those projects belongs to their authors (see Credits).
Prerequisites
- Node.js ≥ 18
- Internet access to fetch
opencodeandoh-my-openagenton firsthabithive setup(nothing else is required up front)
Install
npm i -g habithive-code
habithive setup # full stack (below). add --minimal to skip the extrasClone from source (GitLab)
For development, or if you'd rather run from a checkout than the published package:
git clone https://repository.hclhealthcare.in/hive/habit-hive-code.git
cd habit-hive-code
npm test # sanity check — expect "16 passed, 0 failed"
node bin/habithive.mjs status # smoke test without installing anything globally
npm i -g . # optional: makes `habithive` available globally from this checkout
habithive setup # wire opencode + oh-my-opencode + the habithive pluginCloning requires a GitLab account with access to the hive group on
repository.hclhealthcare.in — ask your GitLab admin to add you if you don't have it yet.
habithive setup sets up, from each tool's official source (nothing but the two
skills is bundled):
| # | Component | How | Type |
|---|-----------|-----|------|
| 1 | opencode | npm i -g opencode-ai (if missing) | required |
| 2 | oh-my-opencode | pinned [email protected] wired into config | required |
| 3 | habithive plugin | wired into tui.json | required |
| 4 | playwright MCP | added to the opencode mcp config | extra |
| 5 | openspec | npm i -g @fission-ai/openspec (MIT) | extra |
| 6 | graphify | graphifyy from PyPI via uv/pip (MIT) | extra |
| 7 | skills | karpathy-guidelines (MIT) + graphify → ~/.config/opencode/skills/ | extra |
Extras load/run in complex mode. habithive setup --minimal installs only 1–3.
Bundled skills and their licenses are listed in THIRD-PARTY-NOTICES.md.
Note: the bundled
graphifyskill was authored for Claude Code's subagent runtime; it drives thegraphify(graphifyy) CLI and may need tuning under opencode.
Use
habithive # complex mode, NEW session
habithive simple # vanilla opencode (oh-my-opencode off; the habithive switcher stays)
habithive complex # full mode
habithive -c # continue the last session
habithive -s <id> # continue a specific session
habithive status # show current modeInside opencode:
/habithive— menu (set model · switch mode · reset)/model— the model tree (below)/habithive-mode— switch simple ⇄ complex (relaunches, same session)
The home screen shows a HABITHIVE wordmark, and the launcher prints a clean
▸ habithive line on start and on exit (with the exact habithive -c / habithive -s <id>
resume commands).
The model tree (/model)
Quick
Main agent — this screen → opencode's on-screen model (model.json)
ALL — on-screen + subagents+tiers
Main agents (primary) → also set the on-screen model
★ All main agents (set together)
sisyphus · prometheus · atlas · hephaestus (GPT-only)
Subagents → oh-my-openagent.json (own model each)
★ All sub agents (set together)
oracle · explore · librarian · multimodal-looker · metis · momus · sisyphus-junior
Categories (tiers) → oh-my-openagent.json
ultrabrain · deep · quick · visual-engineering · artistry · writing · unspecified-low · unspecified-highPrecedence: agent > category > all > default. Each group has a ★ set-together
row. Changes to subagents/tiers live in oh-my-openagent.json and apply on the next
launch (habithive reopens your session automatically after a change).
How it works
- Mode switch toggles
oh-my-openagentin your opencode config (keeping the habithive plugin loaded in both modes) and relaunches opencode. A mode change can't be live — oh-my-opencode initializes at startup — so habithive relaunches you into the same session. - On-screen model = opencode's picker state (
~/.local/state/opencode/model.json). Subagent/category models =oh-my-openagent.json. habithive writes the right layer for each level of the tree. - Your original
oh-my-openagent.jsonis snapshotted to~/.habithive/baseline.json(with a byte-copy backup) so Reset restores it exactly.
Compatibility
Tested against: opencode 1.18.x, oh-my-openagent 4.19.x (pinned in the installer). opencode auto-updates its own binary; if a release changes internals, open an issue.
Migrating from the previous package name
habithive-code is a rebrand of an earlier package that used a different name and
plugin entry. habithive setup only manages its own plugin entry, so if the old
package is still installed or wired into your opencode config, both load together
and you'll see two wordmarks stacked on the home screen. Fix it once with:
npm rm -g maliv-code
rm -rf ~/.maliv
node -e "
const fs=require('fs'), os=require('os'), path=require('path');
const p=path.join(os.homedir(),'.config','opencode','tui.json');
const c=JSON.parse(fs.readFileSync(p,'utf8'));
c.plugin=(c.plugin||[]).filter(e=>!String(e).includes('maliv'));
fs.writeFileSync(p, JSON.stringify(c,null,2)+'\n');
console.log('cleaned:', p);
"
habithive setupThis is a one-time cleanup — anyone installing habithive-code fresh, who never had
the old package, can skip this section entirely.
Uninstall
habithive simple # (optional) drop back to vanilla first
npm rm -g habithive-code
rm -rf ~/.habithiveThen remove the habithive / oh-my-openagent lines from ~/.config/opencode/tui.json
and opencode.jsonc if you want them gone.
Credits
Built entirely on the work of others — habithive-code only orchestrates them:
- opencode — the AI coding agent this runs on.
- oh-my-opencode / oh-my-openagent by code-yeongyu — the agent harness that "complex" mode enables (Sustainable Use License 1.0).
License
habithive-code is MIT. opencode and oh-my-opencode remain under their own licenses.
