curd-editor 0.18.0

A terminal code editor: file tree, tabs, git, language servers, run and jump to errors, and a Claude panel that uses your own claude command
curd-editor-0.18.0 is not a library.

curd

A small terminal code editor written in Rust with crossterm: open a folder as a project, browse it in a file tree with git status colours, keep several files open in tabs, and get colours, errors, suggestions, hover and go-to-definition from language servers. It has undo, selection with copy and cut, search and replace in the file and across the project, markers beside the lines you changed since the last commit, and a git menu to stage, commit, switch and create branches, pull and push, a panel that runs your build and tests and jumps to the errors, and a panel where Claude (on your own Claude subscription) reads, changes and builds the project.

Package name: curd-editor (curd is taken on crates.io). Command name: curd.

Install

One command, no Rust needed. It downloads the latest release for your system.

Linux and macOS:

curl -fsSL https://raw.githubusercontent.com/vikram5258/crud-editor/main/install.sh | sh

Windows (PowerShell):

irm https://raw.githubusercontent.com/vikram5258/crud-editor/main/install.ps1 | iex

Then:

curd .               # open the current folder as a project
curd src/main.rs     # open one file (or several: they open in tabs)
curd                 # start with an empty file

Other ways to get it:

  • With Rust installed: cargo install curd-editor
  • By hand: download a binary from the releases page

Run

cargo run -- src/main.rs

Look

curd has three looks, called themes:

  • dark (the usual one) and light paint the whole window in colours of their own: the text, the file tree, the panels and the pop-up lists each have their own background; the line the cursor is on is gently lit; selected text and the picked row of a list have a soft background instead of harsh reversed colours; the tab in front and the title of the panel that has the keys stand out; code is coloured by kind, with comments in italics.
  • classic uses only your terminal's own sixteen colours and its background, as curd always did.

Lists that pop up (quick open, the list of commands, the git menu) are a filled box in the middle of the top of the text, with a reminder of the keys on the row you type on. The lists of the Claude panel (/, @, the models, the earlier conversations) open in the panel itself, right above the question, where you are typing and looking. In the file tree the file in front stays marked in bold while the keys are elsewhere.

Dark is chosen by itself when the terminal says it can show any colour (most do: it sets COLORTERM=truecolor). Otherwise you get classic. To choose: CURD_THEME=light curd, CURD_THEME=dark curd or CURD_THEME=classic curd (put export CURD_THEME=light in your shell profile to keep it).

Keys

Project and files:

Key What it does
F1 or Alt+X every command with its key: type part of a name, Enter does it
Ctrl+P or Alt+P quick open: type part of a file name, Enter opens it, Esc cancels
Ctrl+B or Alt+B show or hide the file tree
Alt+E move between the file tree and the text (Esc also leaves the tree)
Arrows, Enter (in the tree) move; Enter or Right opens a folder or file, Left closes a folder
n / f (in the tree) new file / new folder, in the selected folder (a/b/c.rs makes the folders on the way)
r or F2 (in the tree) rename the selected file or folder; open files follow
d or Delete (in the tree) delete the selected file or folder, on the second press
Ctrl+T run a command in the project: a build, the tests, the program
F5 run the last command again
Alt+T show what the command printed and move there; pressed again there, hide it
F8 / Shift+F8 go to the next / previous place (file and line) the command's output names
Alt+. and Alt+, next / previous tab (Ctrl+PageDown / Ctrl+PageUp also work)
Alt+1 ... Alt+9 go to that tab
Ctrl+W or Alt+W close the file in front (asks for a second press if it has unsaved changes)
Ctrl+L or Alt+L go to a line by its number
Alt+S search the whole project: type the text, Enter lists the matching lines, Enter again opens one
Ctrl+G or Alt+V git menu: stage, unstage, commit, switch or create a branch, pull, push
Alt+I the Claude panel: show it and type there; pressed again there, hide it
Ctrl+S save; a file with no name yet asks for one first
Ctrl+Q quit (asks for a second press if any file has unsaved changes)

Editing:

Key What it does
Typing, Enter, Tab insert text, a new line, four spaces
Backspace / Delete delete before / under the cursor (joins lines at a line edge)
Arrows, Home, End move the cursor; the view scrolls in both directions
PageUp / PageDown move one screen up / down
Ctrl+Home / Ctrl+End go to the start / end of the file
Shift+arrows, Shift+Home / End / PageUp / PageDown select text
Ctrl+A select everything
Ctrl+C / Ctrl+X copy / cut the selection, or the whole line when nothing is selected
Ctrl+V paste what was copied or cut
Tab / Shift+Tab (with lines selected) move the selected lines one level in / out; Shift+Tab alone moves the cursor line out
Alt+C or Ctrl+/ turn the cursor line or the selected lines into comments, and back
Alt+Up / Alt+Down move the cursor line up / down
Alt+D duplicate the cursor line
Ctrl+Z / Ctrl+Y undo / redo
Ctrl+F or Alt+F search: type to find, Enter or Down for the next match, Up for the one before, Esc to close
F3 or Alt+N next match of the last search
Ctrl+R or Alt+R replace: type what to find, Enter, type what to put there; then Enter replaces one match, Alt+A all, Down skips one
Ctrl+Space or Alt+/ ask the language server for suggestions (they also appear by themselves as you type)
Up / Down, Tab, Esc (in the list of suggestions) pick one, put it in, close the list
Alt+K or Ctrl+K fold / unfold the block on, or around, the cursor line
Alt+A fold every top-level block, or unfold everything
Alt+H or F2 hover: show what the language server knows about the thing under the cursor
Alt+G or F12 go to definition, opening the file it is in if needed
Tab after a trigger word expand a snippet (see below)

Mouse:

Action What it does
Click a tab / its × bring that file to the front / close it (a second click if it has unsaved changes)
Middle click a tab close it
Wheel over the tab bar go through the tabs
Click a file or folder in the tree open it / open or close the folder
Click in the text put the cursor there
Double click in the text select the word
Drag over the text select
Click beside a line that starts a block (the - or + by its number) fold or unfold the block
Click a line in quick open, the git menu or search results pick it; the wheel moves the selection, a click elsewhere closes the list
Wheel scroll whatever is under the pointer

Because curd listens to the mouse, selecting with the terminal itself needs Shift held while dragging (Option on macOS Terminal).

Some terminals keep certain Ctrl keys for themselves (VS Code's terminal takes Ctrl+K, Ctrl+B, Ctrl+P, Ctrl+W and Ctrl+F), which is why most commands also have an Alt or function-key form.

Projects

curd some-folder opens the folder as a project. curd some-file works out the project from the file: its git repository if it is in one, otherwise the folder it sits in. Ctrl+B shows the tree either way.

  • File tree: folders first, then files. Folders are read only when you open them, so large projects open instantly. The tree follows the file in front, and is re-read when you save or come back to the terminal window.
  • Git status colours, with a letter at the right edge of the tree, the same idea as VS Code:
Colour Letter Meaning
plain committed and unchanged
yellow M modified since the last commit, not staged
cyan S staged with git add, waiting to be committed
green U untracked: a new file git does not know yet
red ! merge conflict
dim ignored by .gitignore

A folder takes the colour of the most pressing change inside it. The current branch is shown under the tree. The status comes from the git command, run in the background so it never holds up typing.

  • Change markers beside the text: in a file that git tracks, a bar next to the line numbers shows what is different from the last commit, and it follows every key, saved or not:
Marker Meaning
green ▎ a new line
yellow ▎ a changed line
red ▁ lines were removed below this line (▔ at the top of the file: removed above it)
  • Tabs: every open file keeps its own cursor, folds and unsaved changes. The tab bar appears when two or more files are open; a ● marks unsaved changes and a click on the × closes the tab.
  • Quick open (Ctrl+P): searches every file git tracks or would track (so not target/ or node_modules/). Letters can be spread out: wsrs finds workspace.rs.

Language servers (LSP)

curd gets colours, errors, warnings, suggestions, hover and go-to-definition from the same language servers VS Code and other editors use. It starts the server for the file's type, if it is installed. One server looks after all the open files of its language in a project, so opening more files does not start more servers:

Language Server Install
Rust rust-analyzer rustup component add rust-analyzer
Python pyright-langserver npm install -g pyright
JavaScript / TypeScript typescript-language-server npm install -g typescript typescript-language-server
C / C++ clangd your system's clangd package
Go gopls go install golang.org/x/tools/gopls@latest
YAML (.yaml, .yml) yaml-language-server npm install -g yaml-language-server
  • Colours: come from two places, as in VS Code. A small built-in scanner colours keywords, strings, comments and numbers the instant a file opens and on every key, with or without a server. The server then says what each piece of code really is (function, type, macro and so on) and its colours are laid over the scanner's a moment later. In the classic look they are your terminal's own sixteen colours, so they match your terminal theme; the dark and light looks bring their own. YAML has a scanner of its own: keys, quoted and plain values, numbers and words like true, comments, anchors, tags, ${{ ... }} expressions, and blocks of text after | or >.
  • Underlines: the exact code an error or warning is about is underlined. Unused code is shown faded and deprecated code struck through.
  • Suggestions (completion): a list opens under the cursor when you start a word or type . or ::, and narrows as you keep typing. Up and Down pick one, Tab puts it in, Esc closes the list. Enter always starts a new line, so the list never gets in the way of plain typing. Ctrl+Space (or Alt+/) asks for the list by hand.
  • Lines with a problem get a red E or yellow W beside the line number; move the cursor onto the line to read the message in the status bar. The status bar also shows a count, like E:1 W:2.
  • Without a server installed, curd works as a plain editor and says so once in the status bar.
  • CURD_LSP=off curd file.rs turns servers off. CURD_LSP="my-server --stdio" curd file.rs uses a different one.

How it works: curd runs the server as a child process and talks to it over stdin/stdout. Edits are sent as small changes (not the whole file), batched while you type, and a background thread reads the answers, so typing never waits on the server.

Running commands

Ctrl+T asks for a command (cargo build, npm test, python app.py, anything your shell runs) and runs it in the project folder. What it prints appears in a panel under the text as it comes, with errors in red and warnings in yellow, and the title says whether it is still running, finished or failed. F5 runs the same command again, which is the usual loop: change the code, F5, look.

  • Going to errors: lines that name a place in a file, the way compilers and test runners print them (src/main.rs:12:5, --> src/lib.rs:3:1, File "app.py", line 4), can be jumped to. F8 goes to the first, then the next; Shift+F8 goes back. In the panel (Alt+T), Enter or a click on such a line does the same.
  • In the panel: arrows, PageUp / PageDown, Home / End and the wheel move through the output; Ctrl+C stops the command; Esc goes back to the text.
  • The command cannot be typed to while it runs: it is for builds and tests, not for programs that ask questions.
  • When the command ends, the file tree, the git state and open files that it changed are brought up to date.

Claude panel

Alt+I opens a panel where you can ask Claude about the project, or ask it to change it. It works with your Claude subscription (Pro or Max), the way the VS Code extension does: curd runs the claude command you have installed and signed in to, in the project folder, and shows what it answers. curd itself never sees your login and uses no API key.

On a wide terminal (100 columns or more beside the file tree) the panel stands to the right of the text, the full height of the window, like a side bar; on a narrower one it lies under the text.

Set up once: install Claude Code, then run claude in a terminal and sign in with your Claude account.

Key (in the panel) What it does
Typing, Enter write a question and send it; follow-ups carry on the same conversation
Alt+Enter start a new line in the question (pasted text keeps its lines too)
/ (at the start of the question) list the panel's commands: /model, /attach, /new, /resume, /mode, /undo, /changes, /copy, /bigger, /help, /hide, and your own
@ pick a file to attach to the question; Backspace on an empty question takes the last one off
Left / Right, Home / End, Backspace / Delete edit the question
Up / Down bring back the questions asked before
Esc stop Claude while it is working; otherwise go back to the text (the panel stays)
Alt+M what Claude may do: change files; only read; change files and run commands
Alt+O list the files Claude changed in its last answer, to open one
Alt+U undo Claude's changes: put those files back as they were before the answer
Ctrl+N start a new conversation
Ctrl+R or Alt+R list the earlier conversations about this project; Enter shows one again and carries it on
PageUp / PageDown, wheel scroll the conversation
Alt+Z make the panel as big as the screen allows, and back
Alt+Up / Alt+Down, or drag the panel's edge (its title row, or the line beside it) make the panel bigger / smaller
Alt+C copy the last answer
Alt+I hide the panel
  • Models: /model lists opus, sonnet and haiku, or takes any model's full name; "default" leaves the choice to the claude command. The row above the question shows the model the next question goes to, or the one that last answered.

  • Attached files are shown on that row as @path. They are named to Claude along with the question, and it reads them; they go with that one question. Images can be attached the same way.

  • Your own commands: the / list also shows the commands and skills you have set up for Claude Code (in .claude/commands and .claude/skills, in the project or your home folder). Picking one puts /name on the question line, to send to claude with whatever you add. A /name the list does not know is put on the line the same way.

  • Conversations are kept. The claude command saves every conversation about a project, also the ones from its own terminal program and from VS Code. Ctrl+R lists them, newest first, each with how long ago it was and its first question; picking one shows what was said and your next question carries it on.

  • The answer appears word by word as Claude writes it, and the title shows how long it has been working.

  • Answers are shown as Markdown: headings and **bold** in bold, `code` in colour, list items with a bullet, and blocks of code set apart by a bar and coloured like code in the editor.

  • Text selected in the file when you ask is sent along, so you can select a function and ask "what does this do?".

  • May change files is how it starts: Claude can edit and create files in the project. Open files then show what it wrote, the change markers show where, and the panel lists the files it touched. Alt+U puts them all back as they were before that answer (files over 512 KB are not kept for this), which is the way to turn a change down after looking at it. With read only (Alt+M) Claude can read and search but its tools for editing files and running commands are switched off. With may change files and run commands (Alt+M again) it can also run shell commands in the project without asking, so it can build what it wrote, run the tests and fix what fails. That is the mode for getting real work done, and the one to be careful with: a command can do anything you could do in a terminal, and Alt+U only puts files back.

  • Claude is told which file is in front and the line the cursor is on, so "this function" means something. It reads files from disk, so save first.

  • If the ANTHROPIC_API_KEY variable is set, the claude command bills that key instead of your subscription; the panel says so.

  • CURD_AGENT=off curd turns the panel off. CURD_AGENT="some-command" runs that instead of claude.

  • This is not an Anthropic product. Anthropic's terms do not let other programs offer Claude sign-in or handle subscription logins themselves, which is why curd only starts the unmodified claude program that you signed in to yourself.

Code editing

  • Line numbers in a column on the left.
  • Undo and redo: Ctrl+Z takes back the last step and Ctrl+Y does it again. A step is a word typed in one go, a paste, a snippet or a suggestion. Undoing back to what was saved clears the [modified] mark.
  • Search: Ctrl+F (or Alt+F) asks in the status bar and jumps to the first match as you type, with every match on screen shown in reverse. Enter or Down goes to the next match, Up to the one before, wrapping round the file. It ignores case unless you type a capital letter. After Esc, F3 (or Alt+N) repeats the search.
  • Replace: Ctrl+R (or Alt+R) asks what to find, then what to put in its place. Enter replaces the match under the cursor and moves to the next, Down skips one, Alt+A replaces every match in the file as one step to undo, Esc stops.
  • Search the project: Alt+S asks for the text and lists every line in the project's files that holds it (files git ignores, files that are not text and files over 1 MB are skipped; the list stops at 2000 lines). Type to narrow the list, Enter opens the line.
  • Select, copy, cut, paste: hold Shift while moving to select, or drag with the mouse. Ctrl+C copies and Ctrl+X cuts; with nothing selected they take the whole line. Typing replaces the selection. Copied text also goes to the system clipboard in terminals that support it (the "OSC 52" sequence); Ctrl+V pastes it, also into another tab.
  • Git menu: Ctrl+G (or Alt+V) lists the git commands; type to narrow the list and press Enter. It can stage or unstage the file in front (or the one selected in the tree), stage or unstage everything, commit what is staged with a message, switch to another branch, create a branch, pull and push. The commands run in the background and the status bar says how they went, in git's own words when they fail. Switching branch and pulling ask you to save first, and afterwards open files show what is on disk. A push of a branch that was never pushed goes to origin. Git is never allowed to ask for a password on the editor's screen: a command that needs one fails instead, so set up a credential helper or an SSH agent.
  • Files changed elsewhere: when you come back to the terminal, open files that another program changed are read again, unless they have unsaved changes.
  • Save as: Ctrl+S in a file with no name asks for one in the status bar. It never overwrites a file that already exists.
  • Folding: lines that start a block have a - beside their line number. Alt+K (or Ctrl+K) collapses the block into one row, shown as fn main() { ... } with a +; the same key opens it again. Alt+A folds every top-level block so the whole file's outline fits on screen, and unfolds everything again; a click on the - or + does one block. Blocks are { ... } in most languages and indentation in Python and YAML. Folding only changes the view, never the file.
  • Auto-indent: Enter keeps the current indentation and adds a level after {, ( or [ (and after : in Python and YAML). Typing } on a blank line steps back a level. One level is four spaces, or two in YAML.
  • Paste: pasted text goes in exactly as copied, without auto-indent.
  • Snippets: type a trigger word and press Tab. Which ones exist depends on the file extension:
Language Triggers
Rust (.rs) fn main struct enum impl match if for while loop test tests pl
Python (.py) def class if for while main try
JavaScript / TypeScript fn afn if for while log
C / C++ main if for while inc
Go (.go) fn main if for err

For example, in a .rs file main + Tab becomes:

fn main() {
    |
}

curd new-file.txt starts an empty document and creates the file on the first save. The bottom row is a status bar with the file name, a [modified] marker and the cursor position.

Test

cargo test                # unit tests + end-to-end tests
cargo llvm-cov            # same, with a coverage report (cargo install cargo-llvm-cov)
  • Unit tests sit next to the code in a tests.rs file per module, such as src/editor/tests.rs.
  • End-to-end tests in tests/e2e.rs start the real curd in a pseudo-terminal, send keys and check the screen (Linux/macOS only).
  • The language-server tests use a small fake server, tests/fake_lsp.py, and the Claude panel tests a stand-in for the claude command, tests/fake_agent.py (both need python3). To also test against the real rust-analyzer: cargo test --test e2e -- --ignored.

Test files are left out of the published crate (see include in Cargo.toml).

CI (.github/workflows/ci.yml) runs on pushes to main and to branches named ci/..., and on pull requests:

  • Linux: clippy, every test with coverage (which fails under 90% of lines), the end-to-end test against the real rust-analyzer, and a check that the crate packages cleanly for crates.io. One job, one build; the test and coverage reports are saved on the run.
  • macOS and Windows: the tests.
  • cargo audit, which fails if a dependency has a known security problem.

Each commit is checked once. If a commit has already passed (on a ci/... branch, say, before it went to main), a later run for the same commit skips the checks.

Pushing a v* tag (.github/workflows/release.yml) makes sure the tagged commit has passed those checks, builds the binaries for the five platforms, and publishes the release: the binaries with a SHA256SUMS file on GitHub, then the crate on crates.io. The binaries are only built for a release.

Layout

  • src/main.rs — reads the arguments and starts everything up
  • src/workspace.rs — the whole window: tabs, file tree, quick open, project search, the git menu, the clipboard, routing keys, mouse and language-server messages
  • src/tree.rs — the file tree
  • src/agent.rs — the Claude panel: running the claude command, reading its output, drawing the conversation
  • src/runner.rs — running a command and the panel with what it prints; finding the files and lines it names
  • src/git.rs — git status and branches, and running git commands, all through the git command
  • src/finder.rs — quick open and its fuzzy matching; the same list picks branches, git commands and search results
  • src/screen.rs — styled rows of text, and drawing only the rows that changed
  • src/theme.rs — the looks: what colours each style and each part of the window gets
  • src/terminal.rs — raw mode, alternate screen, mouse and focus reports, screen size (restored on drop)
  • src/document.rs — the text (lines), editing it, opening and saving files
  • src/editor.rs — one open file: keys, editing, scrolling, its part of the screen, status bar
  • src/history.rs — what was typed and deleted, for undo and redo
  • src/search.rs — finding text in the file and in the project
  • src/diff.rs — which lines differ from the last commit, for the change markers
  • src/folds.rs — finding { ... } blocks and tracking which are collapsed
  • src/snippets.rs — snippet tables per language
  • src/lsp.rs — language server client: starting servers, the wire format, requests and replies
  • src/highlight.rs — colours: the built-in scanner, and the server's colours kept per line and moved along as you type

Progress

  • Step 1: raw mode, read keys, Ctrl+Q
  • Step 2: draw the screen with ~ and a welcome message
  • Step 3: open a file and show it (modular refactor)
  • Step 4: cursor movement and vertical scrolling
  • Step 5: typing and deleting
  • Step 6: save with Ctrl+S, unsaved-changes warning, new files
  • Status bar and horizontal scrolling
  • Line numbers, code folding, snippets, auto-indent, paste
  • LSP: diagnostics, hover, go to definition
  • Colours, underlines and other decorations from the language server
  • Built-in syntax colouring, so colours never wait for the server
  • Projects: file tree, tabs, quick open, git status colours, mouse
  • One language server shared by all open files; go to definition across files
  • LSP: completion
  • Git: changed-line markers beside the text
  • PageUp / PageDown, Ctrl+Home / Ctrl+End
  • Save as (name a file started without one)
  • Search, undo and redo
  • Search and replace, search across the project
  • Select text with Shift+arrows or the mouse; copy, cut, paste
  • Git: stage, commit, switch and create branches, pull and push from the editor
  • YAML: colours, folding, two-space indent, yaml-language-server
  • Git: see the changes of a file (diff), discard changes
  • Indent and unindent the selected lines with Tab; comment, move and duplicate lines
  • Go to a line by number
  • Mouse: close tabs, fold from the gutter, double click, clickable lists
  • Claude panel, using the claude command and your subscription
  • Claude panel: answers as they are written, Markdown and coloured code, resizing, question history, selection sent along
  • Claude panel: changes files by default, lists what it changed, and can undo it
  • Claude panel: earlier conversations listed and carried on; a side panel on wide screens
  • Run a command with its output in a panel; go to the errors it names
  • New, rename and delete for files and folders in the tree
  • A list of every command with its key (F1)
  • Claude may run commands, when allowed to
  • Claude panel: / commands, @ to attach files, choosing the model, questions of several lines
  • Dark and light themes in full colour, with the classic look kept for other terminals
  • Lists as filled pop-ups; the Claude panel's lists open above its question
  • Claude panel: approve each change before it is made
  • A real terminal in a panel, for programs that need typing to
  • Language server: rename, find references, format on save
  • Scroll the view with the wheel without moving the cursor
  • More tabs than fit on screen