| Crates.io | flashcards-rs |
| lib.rs | flashcards-rs |
| version | 0.1.2 |
| created_at | 2025-10-19 04:46:46.606334+00 |
| updated_at | 2025-10-19 05:05:40.797741+00 |
| description | A terminal-based flashcard app written in Rust using ratatui. |
| homepage | |
| repository | https://github.com/fibnas/flashcards-rs |
| max_upload_size | |
| id | 1889941 |
| size | 69,005 |
A fast, fully terminal-based flashcard application written in Rust using ratatui and crossterm. Create topics, edit cards, and study directly from your terminal — with progress tracking, randomization, and persistent storage.
/topics/<topic_name>/questions.txt and answers.txtflashcard_responses_YYYYMMDD-HHMMSS.txt)flashcards-rs/
├── Cargo.toml
├── src/
│ └── main.rs
└── topics/
├── AI/
│ ├── questions.txt
│ └── answers.txt
└── Earth/
├── questions.txt
└── answers.txt
Each topic folder must contain:
questions.txt — one question per lineanswers.txt — one answer per line, in the same order as the questions| Key | Action |
|---|---|
| Ctrl+Q | Quit |
| Ctrl+R | Review responses |
| Ctrl+S | Save edits to file |
| Key | Action |
|---|---|
| ↑ / ↓ | Move between topics |
| Enter | Open selected topic |
| C | Create a new topic |
| Key | Action |
|---|---|
| S | Start quiz mode |
| E | Edit cards |
| B | Back to topic select |
| Key | Action |
|---|---|
| Y / N | Choose random order or sequential |
| Enter | Submit answer or continue |
| N | Next card |
| Ctrl+R | Review all responses |
| Key | Action |
|---|---|
| ↑ / ↓ | Move between cards |
| E | Edit question |
| A | Edit answer |
| N | Add new card |
| D | Delete selected card |
| S | Save |
| B | Back to menu |
git clone https://github.com/fibnas/flashcards-rs.git
cd flashcards-rs
cargo run
OR
gh repo clone fibnas/flashcards-rs
cargo run
OR
cargo install flashcards-rs
The app automatically scans /topics/ for folders.
To create new topics manually:
mkdir -p topics/Space
echo "What is a black hole?" > topics/Space/questions.txt
echo "A region of spacetime with gravity so strong nothing can escape it." > topics/Space/answers.txt
Or create them directly inside the app with C.
When you finish a quiz, your results are saved automatically:
flashcard_responses_20251019-225918.txt
Each session log includes:
ratatui — Terminal UI librarycrossterm — Terminal event handlinganyhow — Simple error managementchrono — Timestampsrand — Randomized order supportTopic: AI
Q1: What does AI stand for?
> Artificial Intelligence
Correct!
Progress bar updates live as you advance through cards.
The app operates as a finite state machine with distinct UI screens managed by the Screen enum.
Each state defines a unique interaction context. Transitions are event-driven (keyboard input).
| State | Description | Key Transitions |
|---|---|---|
TopicSelect |
Browse or create topics. | Enter → MainMenu, C → TopicCreate |
TopicCreate |
Input new topic name. | Enter → MainMenu, Esc → TopicSelect |
MainMenu |
Choose between study or edit modes. | S → Mode, E → CardList |
CardList |
Edit existing cards. | E → EditQuestion, A → EditAnswer, N → add new |
Mode |
Select random or sequential order. | Y/N → Ask |
Ask |
Display current question and take input. | Enter → Reveal, Ctrl+R → Review |
Reveal |
Show correct answer and next-step options. | N → next, Ctrl+E/A → edit, Ctrl+R → review |
EditQuestion / EditAnswer |
Edit text of a card. | Enter → save and return |
Review |
Scrollable list of all responses. | Esc / Ctrl+B → return |
Done |
Quiz finished summary screen. | R → review |
ConfirmQuit |
Exit confirmation modal. | Y → exit, N → return |
This modular architecture simplifies adding new screens or features (e.g., timed quizzes or import/export support).
MIT License.
Built with curiosity, caffeine, and the occasional panic over unwrap().
Frank Stallion Fedora 42