3 releases
| 0.1.2 | Oct 29, 2025 |
|---|---|
| 0.1.1 | Oct 29, 2025 |
| 0.1.0 | Oct 28, 2025 |
#156 in #editor
34KB
766 lines
Bars
Bars is a terminal-native writing assistant for lyrical drafting. It pairs a minimal editor with rhyme suggestions, stanza planning, and metrical feedback so you can keep the flow going without leaving the keyboard.
Highlights
- TUI-first experience: compose on the left, keep an eye on rhyme suggestions, meter analysis, and stanza previews on the right.
- File workflow: standard
New,Open,Save, andSave Asactions with unsaved-change protection and familiar shortcuts (Ctrl+N,Ctrl+O,Ctrl+S,Ctrl+Shift+S). - Slash commands: drive stanza templates, metronome tempo, rhyme lookups, and AI placeholders from the command line.
- Rhyme engine: instant local matches from an embedded CMUdict subset with automatic fallback to the Datamuse API for deeper results.
- Autosave history: every confirmed line is archived to
~/.rhymed/history.jsonso you never lose your verses.
Requirements
- Rust toolchain 1.75 or newer (install via rustup)
- Optional: network access for Datamuse rhyme requests
- Optional: place a
beep.wavnext toCargo.tomlto enable the metronome sound
Getting Started
git clone <repo-url>
cd rappin
cargo run
Use cargo run --release if you want the snappiest rendering.
Using the App
When Bars launches you will see:
- A File menu across the top with the active file name (an asterisk
*marks unsaved changes). - A Poem Editor pane (left) showing the current text.
- An Input panel beneath the editor where you type new lines or commands.
- A Rhyme Suggestions list, Meter Analysis, and Stanza Preview / Status stack on the right.
Keyboard Shortcuts
Ctrl+N– start a new poem (asks before discarding unsaved work)Ctrl+O– open a poem from diskCtrl+S– save to the current path (prompts for one if none exists)Ctrl+Shift+S– save as…Esc– cancel dialogs; press twice (with no unsaved changes) to quitEnter– commit the line you typed, run a command, or accept a dialog prompt
Slash Commands
Enter commands in the input panel prefixed with /:
/stanza <scheme>– preview a stanza template (schemes:aabb,abab,sonnet,haiku,rap16,villanelle)/beat <bpm>– set the metronome tempo (requiresbeep.wavto hear ticks)/rhyme <word>– force a rhyme lookup for the supplied word/suggest– request an AI stanza placeholder (currently returns stub lines)/meter– recompute meter analysis for the current poem
File Persistence
- Manual saves write the poem to the file you selected.
- Every committed line is also mirrored to
~/.rhymed/history.jsonfor quick recovery. - Opening a file recalculates meter and refreshes rhyme suggestions based on the last line.
Development Notes
- Format before committing:
cargo fmt - Run fast checks:
cargo check - The TUI is powered by
ratatuiandcrossterm; asynchronous tasks usetokio. - Network rhyme requests use
reqwest. If offline, the UI falls back to local rhymes and shows status messages.
License
This project is licensed under the MIT License.
Dependencies
~17–54MB
~811K SLoC