# druk — a code editor that lives in your terminal.

# one self-contained binary. no Node, no Electron, no window.

~/code $ druk .

← → ‹7 ● workspace.ts × ▲ editor.ts git.ts panes.ts
Files Git Review Ext│ src/app/workspace.ts
druk ▴ explorer │ 14 ▾ export function createWorkspace(deps: Deps) {
▾ src │ 15 const [tabs, setTabs] = createSignal<Tab[]>([])
▾ app │ 16 const dirty = createMemo(() => tabs().filter(t => t.unsaved))
commands.ts │ 17
git.ts │ 18▎▸ function openFile(path: string) { ⋯ 24 lines Ctrl+Opt+E
workspace.ts M │ 43
▾ ui │ 44▎ // a fold hands the buffer a different text; the
EditorPane.tsx U │ 45▎ // gutter keeps the file's own numbering across the gap
▸ core │ 46▎ const folded = () => spacedView(source(), folds())
▸ lsp │ 47 autosave(folded) ▲ 'autosave' is deprecated Ctrl+Opt+I
▸ extensions │ 48 return { tabs, dirty, openFile }
review.json ◆ │ 49 }
⎇ main ↑1 ~3 ● 1 ▲ 2 F1 commands Ctrl+K keys Space preview Ctrl+P openLn 46, Col 41 typescript

$ # what's inside

tree-sitter syntax — eight languages built in, thirty more one install away
language servers — your own — diagnostics, completion, go to definition, auto-import
git — stage, commit, sync, stash; diffs inline or side-by-side; merge conflicts resolved right in the buffer
review notes — left on lines, shared with an agent through review.json, replies read as threads
search — project-wide find and replace; a fuzzy picker that reads file.ts:42 straight from a stack trace
views — markdown rendered in place — mermaid diagrams included — and images
folding — from indentation, so it works even where no grammar does
vim mode — plus custom keybindings and themes that follow the OS appearance
extensions — JSON manifests, not code — installing one runs nothing

$ druk --extensions # languages, servers, themes, icon sets

$ # install — click a line to copy it

$ open github.com/letstri/druk # source, issues, extension market