AnviLLM was an experimental 9P interface for common CLI-based AI agents. It is no longer actively maintained, but kept for progeny.
This repository has been archived on 2026-06-13. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Levi Neely e28d39aab6 fix: improve kiro-cli state detection and add Refresh method
- IsBusy now checks /proc/PID/stat for process state (R/D = busy)
  when no child processes exist, fixing false idle detection
- Add Refresh() to Session interface to re-detect state on demand
2026-02-13 15:03:27 +01:00
internal fix: improve kiro-cli state detection and add Refresh method 2026-02-13 15:03:27 +01:00
scripts Remove ticket-id argument from Planning script 2026-02-13 11:50:37 +01:00
skills/agent-kb Add agent-kb skill for knowledge base management 2026-02-13 11:56:00 +01:00
.gitignore cleanup 2026-02-10 22:30:57 +01:00
IDEAS.md ideas: conductor bot and supervisor concepts 2026-02-12 15:31:28 +01:00
LICENSE.md initial docs 2026-02-10 22:57:21 +01:00
README.md Fix broken hyperlinks in README 2026-02-13 12:00:31 +01:00
anvillm-notify Add session context, summary, and bot-to-bot communication support 2026-02-12 14:59:35 +01:00
go.mod basic sandboxing support with landrun, fail fast 2026-02-11 08:32:14 +01:00
go.sum basic sandboxing support with landrun, fail fast 2026-02-11 08:32:14 +01:00
main.go Refactor workflow scripts and remove PID from session list 2026-02-13 11:43:49 +01:00
mkfile Refactor workflow scripts and remove PID from session list 2026-02-13 11:43:49 +01:00

README.md

AnviLLM

Acme-native interface for LLM chat backends. Sessions appear as Acme windows and are exposed via 9P filesystem.

Requirements

Installation

git clone https://github.com/lneely/anvillm
cd anvillm
mk  # installs to $HOME/bin

Usage

Type Assist in Acme and middle-click to open the /AnviLLM/ session manager.

Commands

Main window (/AnviLLM/) tag: Get Attach Kill Alias Context Sandbox

Command Description
Kiro <dir> Start kiro-cli session
Claude <dir> Start Claude session
Kill <id> Terminate session
Attach <id> Open tmux terminal
Alias <id> <name> Name a session
Context <id> Edit context (prepended to prompts)
Sandbox Configure sandboxing

Right-click a session ID to open its prompt window. Select text anywhere and 2-1 chord on a session ID for fire-and-forget prompts.

Prompt window (+Prompt.<id>) tag: Send

Type prompt, click Send.

Notifications

Desktop notifications on session completion via anvillm-notify (starts automatically, requires notify-send).

9P Filesystem

agent/
├── ctl             # "new <backend> <cwd>" creates session
├── list            # id, alias, state, pid, cwd
└── <id>/
    ├── in          # Write prompts
    ├── out         # Read responses
    ├── ctl         # "stop" or "kill"
    ├── state       # idle, running, exited
    ├── context     # Prepended to prompts (r/w)
    ├── alias       # Session name (r/w)
    ├── pid         # Process ID
    ├── cwd         # Working directory
    ├── winid       # Acme window ID
    └── backend     # Backend name

Example:

echo 'new claude /home/user/project' | 9p write agent/ctl
echo 'Hello' | 9p write agent/a3f2b9d1/in
9p read agent/a3f2b9d1/state

Backends

Backend Install
Claude npm install -g @anthropic-ai/claude-code
Kiro Kiro CLI

Both run with full permissions inside the sandbox (--dangerously-skip-permissions, --trust-all-tools).

Adding Backends

Create internal/backends/yourbackend.go, implement CommandHandler and StateInspector interfaces, register in main.go. See existing backends for examples.

Sandboxing

Backends run inside landrun sandboxes. Sandboxing cannot be disabled — it's the only safety layer.

Defaults

  • Filesystem: CWD, /tmp, config dirs (rw); /usr, /lib, /bin (ro+exec)
  • Network: disabled
  • Mode: strict (best_effort: false) — sessions fail if sandbox unavailable

Configuration

Click Sandbox in main window, then Edit to modify ~/.config/anvillm/sandbox.yaml.

Path templates: {CWD}, {HOME}, {TMPDIR}

# Enable network
network:
  enabled: true
  unrestricted: true

# Add paths
filesystem:
  rw:
    - "{CWD}"
    - "{HOME}/.npm"

Changes apply to new sessions only.

Kernel Requirements

Kernel Landlock ABI Features
5.13+ v1 Filesystem
6.7+ v4 Improved FS
6.10+ v5 Network

Best-Effort Mode

Set best_effort: true for graceful degradation on older kernels.

Warning: If landrun is missing or kernel lacks Landlock, sessions run completely unsandboxed. Only enable if you accept this risk.

Reproducible Workflows

The 9P filesystem enables scripted multi-agent workflows. Create sessions, set contexts, and wire agents together programmatically.

Example: Developer-Reviewer

Two agents collaborate on code changes — one implements, one reviews:

./scripts/DevReview claude /path/to/project

Creates paired sessions with contexts that instruct agents to:

  1. Developer implements and stages changes
  2. Developer sends review request via agent/{reviewer-id}/in
  3. Reviewer examines diff, sends feedback or "LGTM"
  4. Loop until approved

Example: Planning

Three-agent workflow for documentation tasks:

./scripts/Planning kiro /path/to/docs
  • Research: Queries codebase and knowledge base
  • Engineering: Writes/updates documentation, queries research when needed
  • Tech-editor: Reviews for quality, requests changes from engineering

Writing Your Own

Key patterns from the example scripts:

# Create session, capture ID
echo "new claude /project" | 9p write agent/ctl
ID=$(9p read agent/list | tail -1 | awk '{print $1}')

# Set context (defines agent behavior)
cat <<EOF | 9p write agent/$ID/context
You are a code reviewer. When you receive code...
EOF

# Agents communicate via each other's in files
echo "Please review staged changes" | 9p write agent/$PEER_ID/in

See scripts/DevReview and scripts/Planning for complete examples.

Troubleshooting

Problem Solution
Session won't start Check stderr; verify which claude or which kiro-cli
Landlock ABI error Set best_effort: true or upgrade kernel
Permission denied Add paths to sandbox config
Orphaned tmux tmux kill-session -t anvillm-claude
9P not working Verify plan9port: 9p ls agent

Terminal for Attach configured in main.go (terminalCommand).