HN 표시: Attn – <20MB 바이너리의 마크다운 뷰어 및 편집기(Rust)
hackernews
|
|
🔬 연구
#cli
#markdown
#review
#rust
#에디터
#터미널
원문 출처: hackernews · Genesis Park에서 요약 및 분석
요약
개발자가 자신의 주요 개발 환경인 Claude Code에서 생성되는 수많은 마크다운 문서를 전용 앱으로 보기 위해 Rust 기반의 ‘attn’을 만들었습니다. 이 도구는 20MB가 채 되지 않는 가벼운 바이너리 크기를 자랑하며, 별도의 브라우저나 무거운 에디터 없이 터미널에서 바로 실행 가능합니다. 또한 파일 저장 시 즉시 반영되는 라이브 리로드 기능과 수식, 머메이드 다이어그램 렌더링을 지원하여 에이전트가 작성 중인 문서를 실시간으로 확인하고 주석을 달 수 있습니다.
본문
A markdown viewer for people who live in the terminal. One command. Native window. No Electron. Install · Issues · Contributing attn . That's it. A native window opens with your project's markdown rendered beautifully — with live reload, a file tree, tabs, and a built-in editor. No config, no browser, no 200MB runtime. Most markdown previewers are either browser tabs you have to manually refresh, or Electron apps that eat your RAM for breakfast. attn is a single <20MB binary. It forks to background as a daemon, opens a native macOS window, and watches your files. Edit in Vim, VS Code, whatever — attn reloads instantly. Open another file? It joins the same window as a tab. What you get: - Live reload — save a file, see the change. No refresh button. - Interactive checkboxes — click a - [ ] task and it writes back to the file. - Built-in editor — hit Cmd+E to toggle a full ProseMirror editor with syntax highlighting, math, and mermaid diagrams. - File tree + fuzzy search — browse your project with Cmd+P . Lazy-loads folders so it's fast on huge repos. - Tabs + projects — open multiple files, switch between projects with Cmd+; . attn remembers your workspaces. - Mermaid diagrams — flowcharts, sequence diagrams, and more render inline from fenced code blocks. - Media support — images (with zoom/pan), video, and audio play natively. - Paper & ink themes — warm parchment light theme by default, cool dark theme with --dark . - Single instance — run attn from ten terminals. One daemon, one window, new tab each time. brew install lightsofapollo/attn/attn npx attnmd # or npm install -g attnmd && attn cargo install attn git clone https://github.com/lightsofapollo/attn.git cd attn && cargo install --path . Requires Rust 1.85+. For npm installs, Node 18+ is required. attn # open current directory attn README.md # open a file attn ~/projects/myapp # open a project attn --dark # force dark mode attn --status todo.md # print task progress: "3/5 tasks complete" attn --json spec.md # dump document structure as JSON | Shortcut | Action | |---|---| Cmd+P | Fuzzy file search | Cmd+E | Toggle editor | Cmd+F | Find & replace | Cmd+; | Switch project | Cmd+W | Close tab | Cmd+Tab / Cmd+Shift+Tab | Navigate tabs | Cmd+= / Cmd+- | Zoom in / out | Cmd+0 | Reset zoom | Cmd+/ | Show all shortcuts | The Svelte 5 frontend is compiled by Vite and embedded into the Rust binary at build time. No bundled web server, no extracted assets — it's a single self-contained executable. First launch forks a daemon to the background. The daemon opens a native window via wry (the same webview engine behind Tauri) and listens on a Unix socket. Subsequent attn calls connect to the socket and open new tabs in the existing window. If the binary changes (you rebuild), the old daemon is automatically replaced. src/ main.rs CLI, native window, keyboard shortcuts daemon.rs Unix socket IPC, single-instance daemon watcher.rs File system monitoring with debouncing markdown.rs Structure extraction (tasks, phases, file refs) ipc.rs Webview ↔ Rust messaging files.rs File tree, media type detection projects.rs Project registry web/src/ Svelte 5 frontend web/styles/ Tailwind CSS task dev # Vite HMR + Rust in foreground task dev ATTN_PATH=path/to/file.md # Open a specific file The task dev command starts Vite for hot module replacement and runs the Rust binary in foreground mode, pointed at the Vite dev server. scripts/build.sh # Debug build scripts/build.sh release # Release build scripts/build.sh prod # Production build
Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.
공유