Thanks for your interest in contributing to Melon! This document covers the essentials to get you started.
For a deep dive into the codebase — architecture, module breakdown, and key design decisions — see docs/architecture.md.
- Rust (stable toolchain via
rustup) - macOS or Linux (Windows is not supported)
cargofor building and testing
git clone https://github.com/mrpbennett/melon.git
cd melon
cargo build
cargo testRun melon locally:
cargo run # Launch with your $SHELL inside a PTY
cargo run -- --debug # Enable debug logging to ~/.local/share/melon/melon.logsrc/
├── pty/ # PTY proxy loop and state machine
├── input/ # Raw byte parsing and input classification
├── completion/ # Spec loading, engine, fuzzy matcher
├── ui/ # Popup rendering and theme
└── shell/ # Shell detection and cursor estimation
specs/ # JSON completion specs (35 included, embedded in binary)
tests/ # Integration tests
Full details in docs/architecture.md.
- Fork the repo and create a feature branch from
main. - Make your changes, keeping diffs focused and minimal.
- Run
cargo test— all 35+ tests must pass. - Run
cargo clippyand fix any warnings before submitting. - Open a pull request with a clear description of what changed and why.
- Create
specs/<command>.jsonfollowing the Fig autocomplete format. - Run
cargo test— the integration test validates all specs deserialize correctly. - Rebuild with
cargo build—include_dirpicks up the new file automatically.
See specs/git.json for a reference example.
- Keep changes as small as possible — minimal blast radius.
- No
unwrap()in production paths; propagate errors properly. - Colocate unit tests in the relevant module under
#[cfg(test)] mod tests. - Prefer clarity over cleverness. This codebase is meant to be readable.
Open a GitHub issue with:
- Your OS and shell (
echo $SHELL,uname -a) - Steps to reproduce
- Relevant output from
cargo run -- --debug(log at~/.local/share/melon/melon.log)