Skip to content

ImitationGameLabs/aifed

Repository files navigation

aifed - AI-First Editor

A text editor designed for AI agents.

Core Philosophy

aifed's goal is to design a dedicated text editor for AI agents, implemented as a CLI, improving AI's editing efficiency, accuracy, and comfort.

  • CLI is the best UI for AI - Text input/output, structured responses
  • Progressive disclosure - Simple commands for simple tasks, advanced features on demand
  • Decoupled from AI Agents - Any coding agent that supports shell can use it

Getting Started

See the Installation Guide for setup instructions.

Current Status

Features

Feature Status
read - Read file content with hashlines Ready
edit - Edit file with hashline verification Ready
lsp - LSP integration (Rust first) Ready
outline - Structural outline (8 languages; see below) Ready
history/undo/redo - Edit history and recovery Ready
copy/paste/clipboard - Clipboard operations Ready

LSP Support

Language LSP Server Status
Rust rust-analyzer (shipped default) Supported
Nix nil (shipped default) Supported
Any via [[lsp]] config User-defined Supported

Outline Support

Language Extensions Status
Rust .rs Ready
Markdown .md, .markdown, .mdx Ready
Go .go Ready
Python .py Ready
JavaScript .js, .mjs, .cjs Ready
TypeScript .ts, .tsx Ready
C .c, .h Ready
C++ .cpp, .cc, .cxx, .hpp, .hh, .hxx Ready

Extensions are the shipped grammar defaults and may lag the code; they're overridable via a [[language]] overlay (see the Configuration reference).

For code, the leading preamble collapses into a file header region and the top-level ranges tile the whole file — read the ranges in order to reconstruct it end-to-end.

Platform Support

Platform Supported Tested
linux Yes Yes
Windows No N/A
Darwin (macOS) Unknown No

Current focus: Optimizing the AI agent experience through real-world usage. Testing and refining the workflow in actual coding tasks.

Usage Examples

Note: The examples below illustrate the typical workflow. All core commands (read, edit, outline, lsp, history/undo/redo) are implemented.

AI agents can obtain the full usage guide with:

aifed --skill

Here's how an AI agent might work with aifed in typical development scenarios:

Surveying Structure

# Survey structure first — ranges pass straight to `read`
aifed outline crates/aifed/src/outline/spec.rs
crates/aifed/src/outline/spec.rs [rust] 96 lines, 8 items
file header [1,13]
────────────────────
struct Classified [14,27]
struct DocPolicy [28,66]
trait Spec [67,96]
  fn language [73,74]
  fn grammar_name [76,77]
  fn expand [79,87]
  fn classify [89,91]
  fn doc_policy [93,95]
# Then read just the trait, using its range from the outline
aifed read crates/aifed/src/outline/spec.rs [67,96]

Understanding Code

# Read line 15 of main.rs with hashlines for safe editing
aifed read main.rs 15
15:3K|let count = calculate_total(items);
# Get symbol locators on line 15 for LSP operations
aifed lsp symbols main.rs 15
15:3K|let count = calculate_total(items);
S1:count
S2:calculate_total
S3:items
# Get type info for calculate_total function
aifed lsp hover main.rs 15:3K S2:calculate_total

# Go to definition of items
aifed lsp def main.rs 15:3K S3:items

Refactoring

# Get symbol locators on line 10
aifed lsp symbols main.rs 10
10:AB|let config = load_config();
S1:config
S2:load_config
# Find all references to config
aifed lsp refs main.rs 10:AB S1:config

# Rename config to settings across the codebase
aifed lsp rename main.rs 10:AB S1:config settings

# Edit line 10 with hashline verification
aifed edit main.rs <<'EOF'
- 10:AB
+ 10:AB "let settings = load_config();"
EOF

Debugging

# Check for errors after changes
aifed lsp diag main.rs

History & Recovery

# View recent edit history
aifed history main.rs --count 5

# Undo if something went wrong
aifed undo main.rs

# Redo if you change your mind
aifed redo main.rs

Documentation

Credits

This project was inspired by:

Contributing

See CONTRIBUTING.md for ways to contribute to the project.

About

A text editor designed for AI agents.

Topics

Resources

License

Contributing

Stars

11 stars

Watchers

0 watching

Forks

Contributors