drawgent는 자신의 Claude Code, Codex, opencode를 Excalidraw 화이트보드에 연결해, 채팅 패널이나 캔버스에 'AGENT:' 메모를 작성하는 방식으로 다이어그램 생성·수정을 에이전트가 실시간으로 수행하도록 해주는 오픈소스 도구입니다. 에이전트가 캔버스(스크린샷+씬)를 보고 직접 편집한 뒤 결과를 확인하고 완료된 항목을 DONE으로 표시합니다. 이미 실행 중인 세션에 캔버스를 붙이는 기능도 지원합니다.
번역된 본문
drawgent: 실시간 Excalidraw 캔버스 위의 코딩 에이전트
drawgent는 여러분 자신의 Claude Code, Codex 또는 opencode(직접 설치한 것, 로그인, 설정, 저장소 그대로)를 Excalidraw 화이트보드에 연결합니다. 채팅 패널에서 다이어그램을 요청하거나, 변경하고 싶은 그림 부분 옆에 'AGENT: …'라고 적기만 하면 됩니다. 에이전트는 캔버스(스크린샷 + 씬)를 보고, 실시간으로 편집하고, 결과를 확인한 뒤 해당 메모에 DONE 표시를 합니다.
빠른 시작
전제 조건: claude, codex, opencode 중 하나가 설치 및 로그인되어 있어야 합니다. Claude와 Codex 브리지에는 Node.js ≥ 18(npm)도 필요합니다.
drawgent setup claude # 에이전트당 한 번: claude | codex | opencode
cd ~/my-repo
drawgent up # 이 저장소에서 새 에이전트 세션 시작 + 브라우저에 캔버스 열림
drawgent up --attach # 또는: 실행 중인 세션 중 하나를 선택해 캔버스를 연결
drawgent setup
모든 것을 한 번 확인하고, 무언가 빠져 있으면 정확한 해결 방법과 함께 실패하며, ~/.config/drawgent/config.toml을 작성합니다:
에이전트 CLI: PATH에 있는 claude / codex / opencode.
로그인: claude auth status, codex login status 또는 opencode auth list.
ACP 브리지: opencode는 자체적으로 ACP를 지원(opencode acp). Claude Code와 Codex는 공식 ACP 어댑터를 사용하며, 번들 에이전트 바이너리 없이 ~/.cache/drawgent/adapters에 한 번 설치되고(약 60MB), 여러분의 CLI를 가리킵니다(CLAUDE_CODE_EXECUTABLE, CODEX_PATH). 이후 ACP 핸드셰이크를 검증합니다.
연결된 세션용 캔버스 도구: Codex만 변경이 필요합니다: codex mcp add drawgent -- drawgent mcp. Claude와 opencode는 연결 시점에 도구를 받습니다.
렌더러용 헤드리스 Chrome: 설치 시 이미 Chrome/Chromium이 있으면 사용합니다. 없으면 다음을 제안합니다: Chrome Headless Shell(Chrome for Testing, 약 120MB, sudo 불필요)을 ~/.cache/drawgent/chrome에 다운로드하고, 누락된 시스템 라이브러리가 있다면 정확히 알려줌. 또는 패키지 매니저로 Chromium 설치(apt, snap, dnf, pacman, zypper, apk, brew, 또는 sudo 없는 nix). 비대화형: --chrome download | system | /path/to/chrome.
drawgent up은 해당 에이전트의 setup이 성공하지 않았거나 setup이 기록한 것이 사라졌으면 시작을 거부합니다.
drawgent up
현재 디렉터리(워크스페이스)에서 실행됩니다: 127.0.0.1:7300에서 에디터 + API를 시작(포트가 사용 중이면 다음 가용 포트); ACP를 통해 워크스페이스에서 동작하는 새 에이전트 세션 시작; 브라우저를 엽니다. 헤드리스 서버에서는 대신 ssh -L 명령을 출력합니다. 씬은 .drawgent/scene.json에 저장되며 자동으로 gitignore됩니다.
drawgent up --attach [id]
이미 실행 중인 세션에 캔버스를 연결합니다. id 없이 실행하면 발견한 세션 목록(현재 디렉터리 우선)을 보여주고 하나를 선택하게 합니다:
Claude Code: claude agents --json으로 발견(대화형 및 백그라운드 세션). fork 방식: 전체 대화 내용을 가진 새 세션을 만들어 drawgent가 ACP로 구동. 터미널 세션은 그대로 유지됨.
opencode: 로컬에서 수신 중인 opencode 서버. opencode --port 4096(또는 opencode serve)으로 TUI 시작. live 방식: 메시지가 실행 중인 세션으로 들어가고(TUI에서 보임), drawgent가 런타임에 해당 서버에 MCP 도구를 추가하며, 응답·도구 호출·TUI에 입력한 프롬프트가 채팅 패널에 미러링됨.
Codex: ~/.codex/sessions의 세션. live 방식: codex queue --thread ; 응답은 세션의 롤아웃 파일에서 미러링됨. 세션에는 drawgent MCP가 필요(setup이 등록, Codex 시작 시 로드).
캔버스 사용법
채팅 패널(오른쪽): 요청을 보내고, 응답과 도구 호출이 스트리밍되는 것을 지켜보며, 권한 프롬프트를 승인하고, Stop을 눌러 턴을 취소할 수 있습니다.
캔버스 위에서: 도형 옆이나 내부에 'AGENT:'로 시작하는 텍스트를 쓰거나, 메모에서 도형으로 화살표를 그립니다. 입력을 멈춘 후 약 2.5초 뒤 발동하며, 위치·가리키는 대상·주변 객체 정보가 함께 전달됩니다. 에이전트는 이를 초록색 'DONE: …' 메모로 해결합니다. 다시 'AGENT:'로 고쳐 쓰면 재전송됩니다. 프롬프트는 큐에 저장되어 한 번에 하나씩 실행되며, 이미 처리된 큐 메모는 건너뜁니다.
drawgent: your coding agent on a live Excalidraw canvas # drawgent connects your own Claude Code, Codex or opencode (your install, login, config and repo) to an Excalidraw whiteboard. Ask for a diagram in the chat panel, or write AGENT: … next to the part of a drawing you want changed. The agent looks at the canvas (screenshot + scene), edits it live, checks the result, and marks the note DONE . Quick start # Prerequisite: one of claude , codex or opencode installed and logged in. The Claude and Codex bridges also need Node.js ≥ 18 (npm). drawgent setup claude # once per agent: claude | codex | opencode cd ~/my-repo drawgent up # new agent session in this repo + canvas in your browser drawgent up --attach # or: pick one of your running sessions and connect the canvas to it drawgent setup <agent> # Checks everything once, fails with the exact fix when something is missing, and writes ~/.config/drawgent/config.toml : The agent CLI. Your claude / codex / opencode on PATH. Login. claude auth status , codex login status or opencode auth list . ACP bridge. opencode speaks ACP itself ( opencode acp ). Claude Code and Codex use the official ACP adapters. They are installed once into ~/.cache/drawgent/adapters (~60 MB), without their bundled agent binaries, and pointed at your CLI ( CLAUDE_CODE_EXECUTABLE , CODEX_PATH ). Setup then verifies the ACP handshake. Canvas tools for attached sessions. Only Codex needs a change: codex mcp add drawgent -- drawgent mcp . Claude and opencode get the tools at attach time. Headless Chrome for the renderer. Setup uses your Chrome/Chromium if you have one. Otherwise it proposes: downloading Chrome Headless Shell (Chrome for Testing, ~120 MB, no sudo) into ~/.cache/drawgent/chrome , and telling you exactly which system libraries are missing, if any; installing Chromium with your package manager ( apt , snap , dnf , pacman , zypper , apk , brew , or nix without sudo). Non-interactive: --chrome download | system | /path/to/chrome . drawgent up refuses to start until setup succeeded for that agent, or if something setup recorded disappeared. drawgent up # Runs in the current directory (the workspace): starts the editor + API on 127.0.0.1:7300 (next free port if taken); starts a new session of your agent over ACP, working in the workspace; opens your browser. On a headless box it prints the ssh -L command instead. The scene is kept in .drawgent/scene.json , which is git-ignored automatically. drawgent up --attach [id] # Connects the canvas to a session you already run. Without an id it lists the sessions it finds (current directory first) and lets you pick one: agent discovery how the canvas reaches it Claude Code claude agents --json (interactive and background sessions) fork : a new session carrying the full conversation, driven by drawgent over ACP. Your terminal session is left untouched opencode opencode servers listening locally: start the TUI with opencode --port 4096 (or opencode serve ) live : messages go into your running session (you see them in your TUI); drawgent adds its MCP tools to that server at runtime; replies, tool calls and prompts you type in the TUI are mirrored into the chat panel Codex sessions in ~/.codex/sessions live : codex queue --thread <id> ; replies are mirrored from the session's rollout file. The session needs the drawgent MCP (registered by setup, loaded when Codex starts) Using the canvas # Chat panel (right side): send a request, watch replies and tool calls stream in, approve permission prompts, press Stop to cancel a turn. On the canvas : write a text starting with AGENT: next to or inside a shape, or draw an arrow from the note to a shape. It fires about 2.5 s after you stop typing, with its position, what it points at and what is nearby. The agent resolves it into a green DONE: … note. Edit it back to AGENT: to send it again. Prompts are queued and run one at a time. A queued note that was already handled is skipped. excalidraw.com rooms # drawgent up --room 'https://excalidraw.com/#room=<id>,<key>' drawgent joins the room as a collaborator ( 🤖 Agent , with a cursor that follows its edits). Humans can stay on excalidraw.com: their AGENT: notes reach your agent, and its edits appear there live. Traffic is end-to-end encrypted with the room key. Empty rooms are loaded from and saved to excalidraw's Firestore storage. The local editor mirrors the room and still has the chat panel. Other commands # drawgent mcp : stdio MCP server with the canvas tools. Agents launch it; it finds the running drawgent up by itself. drawgent serve : low-level server with explicit agents ( --agent claude,codex,opencode as set up, or name=command for any ACP agent); for scripts and containers. Options for up / serve : --port , --room , --token (API bearer + ?token= in the URL), --permissions canvas|ask|all (default canvas : drawing tools auto-approved, anything else asked in the chat panel), --data , --settle-ms . Optional: Docker # docker compose up --build runs a canvas server (drawgent + Chromium, no agents ), e.g. to host a shared canvas or a room bridge on a server. Agents are never bundled: they always run with your own setup. Build from source # npm ci && npm run build # editor + renderer pages -> dist/ (embedded into the binary) cargo install --path . # or: cargo build --release Agent tools (MCP) # get_scene , get_screenshot (vision; zoom with element_ids ), add_elements (Excalidraw skeletons; arrows bind by id and are routed edge-to-edge), add_mermaid (auto-layout), update_elements (labels follow shapes, bound arrows re-route), delete_elements , clear_canvas , list_instructions , resolve_instruction , set_status . API # GET /api/health · GET /api/scene · GET /api/screenshot?ids=&padding=&max= · POST|PATCH|DELETE /api/elements · POST /api/mermaid · POST /api/clear · GET /api/instructions · POST /api/instructions/{id}/resolve · POST /api/status · POST /api/chat {agent?, text} · WS /ws (browser sync + chat events) Tests # cargo test # fractional indices, room crypto/framing node scripts/smoke.mjs [ url ] # chat turn + AGENT: note against a running drawgent node scripts/e2e-browser.mjs [ url ] # real browser: chat panel + note typed on the canvas node scripts/room-e2e.mjs # fresh excalidraw.com room ↔ drawgent, both directions Layout # src/ (Rust): main.rs : CLI. setup.rs , config.rs , chrome.rs : setup, config, renderer install. attach.rs : session discovery and picker. agents.rs + acp.rs : ACP driver (new / fork sessions). live.rs : live opencode / Codex drivers. hub.rs : routing, notes, chat log. scene.rs : store and edit operations. renderer.rs : Chrome over CDP. mcp.rs : MCP server. room.rs : excalidraw.com client. fractional.rs , geometry.rs , el.rs : helpers. web/ : editor ( main.jsx , chat.jsx ) and renderer page ( render.jsx ). Limits # The renderer needs Chrome (a native renderer is planned). Claude "attach" is a fork, because Claude Code has no public way to inject into a running terminal session. Codex live attach is implemented, but was not yet tested against a logged-in Codex. One scene per workspace. Images/files are not synced.