A context builder tool for LLM code understanding. Generates structured context from selected source files in multiple formats (TOON, XML, TOML, JSON).
- GUI Application (eframe/egui) — visual file selection
- CLI Tool (
ctx) — command-line interface for automation - Wayland Support — clipboard works on Linux/Wayland
- Multiple Formats — TOON, XML, TOML, JSON output
# Clone and build
cargo build --release
# Install binaries
cargo install --path .# Launch GUI
./target/release/contextify
./target/release/contextify /path/to/project- Select files from the tree view
- Choose output format (TOON, XML, TOML, JSON)
- Enter prompt/instructions
- Click "Copy to Clipboard"
- Select/deselect files with checkboxes
- Expand/collapse directories
# Show help
ctx --help
# List files in directory
ctx --root src/ list
# Search files by name
ctx --root . search main
# Generate context (stdout)
ctx generate src/main.rs src/lib.rs
ctx generate src/*.rs -f xml
# Copy to clipboard
ctx copy src/main.rs
ctx copy src/main.rs src/lib.rs -f toml
# Show available formats
ctx formats| Flag | Description | Default |
|---|---|---|
-r, --root |
Root directory | . |
-f, --format |
Output format | toon |
- TOON — Human-readable format with code blocks
- XML — Standard XML structure
- TOML — TOML table format
- JSON — JSON with escaped content
ctx generate src/*.rs -f toonctx copy src/main.rs src/lib.rs -f jsonctx --root . search handler | head -5
ctx generate $(ctx --root . search model) -f xmlInstructions file: ~/.contextify
Save default instructions that will be prepended to every context:
echo "Analyze this code and suggest improvements" > ~/.contextify# Build
cargo build
# Run tests
cargo test
# Run GUI
cargo run
# Run CLI
cargo run --bin ctx -- generate src/main.rs- Rust 1.70+
- Linux with Wayland (or X11)
wl-clipboardfor CLI clipboard (optional, arboard used by default)
MIT