Dial is a code snippet manager built using rust and ratatui.
-
Terminal-First Workflow: Manage all your code snippets without leaving the command line.
-
Search & Syntax Highlighting: Quickly find the code you need and review it with clear syntax highlighting.
-
Responsive Text Editing: Make quick modifications using a gap buffer based editor.
-
Cross-Platform: Runs on Linux, macOS, and Windows, storing data in the appropriate system-native directories.
Dial is available on crates.io, so it can be installed using cargo.
cargo install dial
Then, run the app.
dial
To get started with Dial, you need to have the Rust toolchain installed on your system.
-
Clone the repository:
git clone https://github.com/mouhamadalmounayar/dial.git
-
Navigate into the project directory:
cd dial
-
Build and run the application:
cargo run
The application will automatically create a configuration directory and a
snippets.json
file if they don't exist.
- Navigate Snippet List
- Display Snippets in Editor Panel
- Syntax Highlighting for Code
- Responsive Text Editing with Gap Buffer
- Persist Snippets to Disk
- Live Search by Snippet Title
- Add Snippets from within the TUI
- Remove Snippets from within the TUI
- Implement Command-Line Interface (CLI)
- Add Snippets from the Command Line
- Remove Snippets from the Command Line
- Add Snippets from Clipboard via CLI
- Implement Smooth Scrolling for Snippet List
- Add Vertical Cursor Navigation in Editor
- Implement Fuzzy Finder for Advanced Search
- Tag and Filter Snippets
- Customizable UI and Editor Theming
Dial stores its data in a simple JSON file located in your system's standard config directory.
- Linux:
~/.config/dial/snippets.json
- macOS:
~/Library/Application Support/com.mouhamadalmounayar.dial/snippets.json
- Windows:
C:\Users\{YourUser}\AppData\Roaming\mouhamadalmounayar\dial\data\snippets.json
You can manually add or edit snippets in this file. The expected format for each snippet is:
[
{
"language": "rust",
"title": "Rust Hello World",
"code": "fn main() {\n println!(\"Hello, Rust!\");\n}"
},
{
"language": "py",
"title": "Simple Python Function",
"code": "def greet(name):\n print(f\"Hello, {name}!\")\n\ngreet(\"World\")"
}
]
- Core Application: Rust
- TUI Framework: ratatui
- JSON Handling: serde_json
- Cross-Platform Directories: directories-rs
- Error Handling: anyhow
Contributions are welcome! If you have ideas for new features or have found a bug, please open an issue or submit a pull request.