rappin

Crates.iorappin
lib.rsrappin
version0.1.2
created_at2025-10-28 19:22:50.313315+00
updated_at2025-10-29 10:54:55.372413+00
descriptionRappin 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.
homepage
repositoryhttps://github.com/fibnas/rappin
max_upload_size
id1905526
size110,056
frankstallionjr (fibnas)

documentation

README

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, and Save As actions 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.json so 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.wav next to Cargo.toml to 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 disk
  • Ctrl+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 quit
  • Enter – 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 (requires beep.wav to 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.json for 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 ratatui and crossterm; asynchronous tasks use tokio.
  • 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.

Commit count: 0

cargo fmt