An AI-native programming editor written in Go.
Keystorm combines the modal editing power of Vim with modern IDE capabilities and deep AI integration. Built from the ground up to be extensible, performant, and AI-aware.
- Modal Editing - Vim-style modes (Normal, Insert, Visual, Command)
- Multi-cursor Support - Edit multiple locations simultaneously
- Syntax Highlighting - Fast, tree-sitter-ready highlighting
- 60+ FPS Rendering - Smooth terminal rendering with dirty region updates
- Undo/Redo - Full command pattern with branching history
- Macro Recording - Record and playback keystroke sequences
- Workspace Model - Project-aware file management
- File Watching - Automatic detection of external changes
- Fuzzy Search - Fast file and content search
- Project Graph - Understand relationships between files, modules, and tests
- LSP Integration - Completions, diagnostics, go-to-definition, formatting
- Multi-language - Per-language configuration and settings
- Semantic Highlighting - Enhanced token-based coloring
- Lua Plugins - Lightweight, sandboxed plugin system
- Capability-based Security - Fine-grained plugin permissions
- Event System - Pub/sub architecture for loose coupling
- Custom Keymaps - Full keybinding customization
- Context Engine - Curated context from project graph for AI prompts
- Intent Router - Maps user actions to AI workflows
- Agent Runtime - Coder, Reviewer, Planner, and Verifier agents
- Diff-based Proposals - AI suggestions as reviewable diffs
- Go 1.25 or later
- A terminal with true color support (recommended)
# Clone the repository
git clone https://github.com/dshills/keystorm.git
cd keystorm
# Build
make build
# Install to GOPATH/bin
make installThe built binary will be at ./bin/keystorm.
# Open with empty buffer
keystorm
# Open a file
keystorm file.go
# Open multiple files
keystorm main.go utils.go config.go
# Open a workspace
keystorm -w ./my-project
# Open in read-only mode
keystorm -R important-file.go| Flag | Description |
|---|---|
-c, --config <path> |
Path to configuration file |
-w, --workspace <path> |
Workspace/project directory |
-d, --debug |
Enable debug mode |
--log-level <level> |
Log level: debug, info, warn, error |
-R, --readonly |
Open files in read-only mode |
-v, --version |
Show version information |
-h, --help |
Show help message |
Keystorm uses a layered configuration system (highest to lowest priority):
- Command-line arguments
- Environment variables
- Plugin settings
- Project config (
.keystorm/config.toml) - User keymaps (
~/.config/keystorm/keymaps.toml) - User settings (
~/.config/keystorm/settings.toml) - Built-in defaults
# ~/.config/keystorm/settings.toml
[editor]
tab_size = 4
insert_spaces = true
line_numbers = true
relative_numbers = false
wrap_lines = false
cursor_style = "block"
[editor.theme]
name = "default"
[languages.go]
tab_size = 4
insert_spaces = false
[languages.python]
tab_size = 4
insert_spaces = trueKeystorm is built with a modular architecture consisting of 10 core components:
internal/
├── engine/ # Text buffer with B+ tree rope, undo/redo, multi-cursor
├── renderer/ # Terminal display, syntax highlighting, viewport
├── input/ # Keystroke handling, mode management, command palette
├── dispatcher/ # Input → action mapping with context awareness
├── event/ # Pub/sub event bus for component communication
├── config/ # 7-layer configuration system with live reload
├── plugin/ # Lua plugin system with sandboxing
├── lsp/ # Language Server Protocol client
├── project/ # Workspace model with file graph
├── integration/ # Terminal, Git, debugger, task runner
└── app/ # Application coordinator and lifecycle
- AI-Agnostic Core - Editor layer is solid and independent
- Event-Driven - Loose coupling via pub/sub messaging
- Thread-Safe - Concurrent access with proper synchronization
- Minimal Dependencies - Lean on Go's standard library
# Install golangci-lint for linting
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latestmake build # Build optimized binary
make build-debug # Build with debug symbols
make run # Build and runmake test # Run all tests
make test-race # Run with race detector
make test-short # Run short tests only
make coverage # Generate coverage report
make bench # Run benchmarksmake fmt # Format code
make vet # Run go vet
make lint # Run golangci-lint
make check # Run fmt, vet, and lintmake tidy # Tidy go.mod
make deps # Download dependencies
make verify # Verify dependencies
make update # Update all dependenciesKeystorm supports Lua plugins with a capability-based security model.
-- ~/.config/keystorm/plugins/hello/init.lua
local ks = require("ks")
-- Plugin metadata
local M = {
name = "hello-world",
version = "1.0.0",
description = "A simple hello world plugin"
}
function M.setup(config)
-- Register a command
ks.command.register("HelloWorld", function()
ks.ui.message("Hello from Lua!")
end)
-- Add a keybinding
ks.keymap.set("n", "<leader>h", ":HelloWorld<CR>")
end
return M| Capability | Description |
|---|---|
filesystem.read |
Read files |
filesystem.write |
Write files |
network |
Network access |
shell |
Shell command execution |
clipboard |
Clipboard access |
process.spawn |
Spawn processes |
unsafe |
Full Lua stdlib (trusted plugins only) |
keystorm/
├── cmd/keystorm/ # Entry point
├── internal/ # Core packages (not importable)
├── pkg/ # Public API (future)
├── design/ # Architecture and specs
│ ├── specs/ # Design documents
│ └── plans/ # Implementation plans
├── bin/ # Build output
├── coverage/ # Test coverage reports
├── Makefile # Build automation
├── go.mod # Go module definition
└── README.md # This file
| Package | Purpose |
|---|---|
| tcell/v2 | Terminal handling |
| fsnotify | File system notifications |
| go-toml/v2 | TOML configuration |
| gopher-lua | Lua scripting |
- Core text engine with B+ tree rope
- Terminal rendering with tcell
- Modal input system
- Action dispatcher
- Event bus with pub/sub
- Configuration system
- Lua plugin system
- LSP client
- Project workspace model
- Application integration
- Performance optimization
- Extended test coverage
- Documentation improvements
- AI orchestration layer
- Context engine for AI prompts
- Agent runtime (Coder, Reviewer, Planner)
- Model registry with provider abstraction
- Inline AI completions
- Multi-file refactoring with AI
Contributions are welcome! Please ensure:
- Code passes all checks:
make check - Tests pass with race detector:
make test-race - New features include tests
- Commits follow conventional commit format
[License information to be added]
Keystorm draws inspiration from: