| name | avc |
| description | Use AVC (Agent View Controller) to present complex execution plans, architecture changes, and multi-step operations as interactive visual UIs. Instead of dumping walls of text, pipe structured JSON to `avc` for human visual review and confirmation. The human can drag-to-reorder, edit, skip, delete, and add steps before confirming. |
AVC โ Agent View Controller
AVC is a visual interaction tool that transforms JSON into interactive native WebView UIs.
Use it when you need human approval for complex decisions.
When to Use
Use avc instead of printing plain text when:
- Execution plans with more than 3 steps
- Architecture changes involving multiple modules
- Multi-file refactoring plans
- Deployment sequences that need human review
- Any complex plan where the human should visually review and reorder steps
Prerequisites
avc must be installed and available in PATH:
git clone https://github.com/study8677/Agent_View_Controller-AVC.git
cd Agent_View_Controller-AVC && go build -o avc . && sudo cp avc /usr/local/bin/
How to Use
Step 1: Construct JSON
Build a JSON object with view type and structured data:
{
"view": "plan",
"title": "Your Plan Title",
"lang": "en",
"editable": true,
"token_count": 4500,
"data": {
"steps": [
{"id": 1, "label": "Step description", "status": "pending"},
{"id": 2, "label": "Another step", "status": "pending"}
]
}
}
Tip โ lang field: Localizes UI chrome (buttons / status bar / tooltips) only โ not step content. Supported: en (default), zh, ja, ko, es, fr, de. Match it to the language of your step labels for a consistent UI.
Step 2: Pipe to AVC
echo '<json>' | avc
Step 3: Read the Result
- Exit code
0 = human confirmed โ stdout contains modified JSON
- Exit code
130 = human cancelled
RESULT=$(echo '{"view":"plan","title":"My Plan","token_count":5000,"data":{"steps":[{"id":1,"label":"Step 1","status":"pending"}]}}' | avc)
if [ $? -eq 0 ]; then
echo "$RESULT"
else
echo "Human cancelled"
fi
Important Behavior
avc blocks until the human clicks Confirm or Cancel
- stdout contains the human-modified JSON (may have reordered/edited/removed steps)
- If
token_count โค 3000 (default threshold), AVC passes through without opening a window
- Use
--no-threshold to always show the WebView window
- Use
--threshold=N to set a custom threshold
Token Threshold
AVC has a smart filter: short content passes through directly.
- If JSON contains
token_count field โ uses that value
- Otherwise โ estimates from byte length (
bytes / 3)
- If โค threshold โ pass-through (no window, exit
0, original JSON on stdout)
Include token_count in your JSON for accurate control.
What the Human Can Do
When the human sees your plan in AVC, they can:
- Drag & drop to reorder steps
- Edit step descriptions by clicking on text
- Skip steps they don't want executed
- Delete steps entirely
- Add new steps
Always respect the human's modifications in the returned JSON.
Supported Views
| view | Use for | Data shape |
|---|
plan | Linear step-by-step execution plans (deploys, migrations, TODOs) | data.steps[] |
graph | Architecture topology / dependency map / ER / workflow | data.nodes[] + data.edges[] |
Pick graph when the agent's output is a relationship, not a sequence โ
e.g., microservice architecture, module dependency map, database ER diagram,
data flow. Nodes are { id, label, type?, x?, y? } with type โ { service, gateway, database, external, default }. Edges are { from, to, label? }.
Positions persist on round-trip (so the human's layout survives).
Example: Full Agent Workflow
PLAN='{"view":"plan","title":"Refactor Auth","token_count":5000,"editable":true,"data":{"steps":[
{"id":1,"label":"Extract auth middleware","status":"pending"},
{"id":2,"label":"Create JWT service","status":"pending"},
{"id":3,"label":"Update route handlers","status":"pending"},
{"id":4,"label":"Add integration tests","status":"pending"}
]}}'
APPROVED=$(echo "$PLAN" | avc)
if [ $? -eq 0 ]; then
echo "$APPROVED" | jq -r '.data.steps[] | select(.skipped != true) | .label'
fi