# flightrecorder
[![][build-badge]][build]
[![][crate-badge]][crate]
[![][tag-badge]][tag]
[![][docs-badge]][docs]
[![][logo]][logo-large]
*A system-level service that preserves ephemeral text input, so that work doesn't disappear after critical failures*
Like an airplane's black box, `flightrecorder` runs quietly in the background, capturing your text input across applications. When disaster strikesβapp crashes, network failures, accidental refreshes, or just plain bugsβyour work is safe and recoverable.
## The Problem
Modern applications are shockingly bad at preserving your work:
- **App crashes** wipe out that detailed prompt you spent 10 minutes crafting
- **Network errors** swallow form submissions into the void
- **Accidental refreshes** obliterate unsaved text
- **Session timeouts** discard everything without warning
- **Buggy apps** throw errors and auto-refresh, taking your input with them
The psychological toll is real: the anxiety of potential data loss poisons the entire experience of using otherwise-good tools. You shouldn't need to defensively copy everything to a text editor "just in case."
## The Solution
`flightrecorder` is your safety net:
- π **Silent**: Runs as a background daemon, zero interaction required
- π **Private**: All data stays local, no network access, fully auditable
- π― **Selective**: Captures text fields and clipboard, not raw keystrokes
- π‘οΈ **Privacy-aware**: Filters sensitive patterns, ignores password fields
- π **Searchable**: Find what you lost with powerful search
- π§Ή **Self-maintaining**: Automatic pruning keeps storage bounded
- π§π **Cross-platform**: Linux (X11 + Wayland) and macOS
## Installation
```bash
# From source
git clone https://github.com/YOUR_USERNAME/flightrecorder.git
cd flightrecorder
cargo build --release
cargo install --path .
# Start the daemon
flightrecorder daemon start
```
## Usage
```bash
# Check status
flightrecorder status
# Search your history
flightrecorder search "that prompt I wrote"
# Recover recent input
flightrecorder recover --last 10
# Recover from a specific app
flightrecorder recover --app "Claude" --last 5
# Recover from a time range
flightrecorder recover --since "1 hour ago"
# Interactive recovery (TUI)
flightrecorder recover --interactive
```
## How It Works
`flightrecorder` uses two complementary capture strategies:
### 1. Clipboard Monitoring
Every clipboard operation is captured with:
- Timestamp
- Source application (when detectable)
- Content hash (for deduplication)
This catches explicit copies and many form submissions that apps place on the clipboard.
### 2. Accessibility-Based Text Field Snapshots
Using platform accessibility APIs, `flightrecorder` periodically snapshots text from:
- Active text input fields
- Text areas and editors
- Form fields
This provides comprehensive coverage even when you forget to copy.
### Privacy & Security
- **No network access**: The daemon has no ability to transmit data
- **No raw keylogging**: We capture text field *contents*, not individual keystrokes
- **Sensitive data filtering**: Configurable patterns for passwords, API keys, credit cards
- **Password field detection**: Automatically skips password input fields
- **Local storage only**: Everything stays in `~/.local/share/flightrecorder/`
- **Fully open source**: Audit every line of code
## Configuration
```toml
# ~/.config/flightrecorder/config.toml
[capture]
# Snapshot interval for text fields (seconds)
snapshot_interval = 5
# Minimum text length to capture
min_length = 10
# Applications to exclude
exclude_apps = ["1Password", "Bitwarden", "KeePassXC"]
[privacy]
# Patterns to filter (regex)
filter_patterns = [
"(?i)password",
"(?i)api[_-]?key",
"(?i)secret",
"\\b\\d{4}[- ]?\\d{4}[- ]?\\d{4}[- ]?\\d{4}\\b", # Credit cards
]
[storage]
# Where to store captured data
data_dir = "~/.local/share/flightrecorder"
# Maximum storage size (MB)
max_size_mb = 500
# Retention period (days)
retention_days = 30
```
## Architecture
```
flightrecorder/
βββ src/
β βββ main.rs # CLI entry point
β βββ daemon/
β β βββ mod.rs # Daemon orchestration
β β βββ clipboard.rs # Clipboard monitoring
β β βββ accessibility.rs # Text field snapshots
β βββ platform/
β β βββ mod.rs # Platform abstraction
β β βββ macos/ # macOS implementations
β β βββ linux/ # Linux (X11 + Wayland)
β βββ storage/
β β βββ mod.rs # Storage abstraction
β β βββ database.rs # SQLite storage
β β βββ pruning.rs # Automatic cleanup
β βββ privacy/
β β βββ mod.rs # Privacy filtering
β β βββ patterns.rs # Sensitive data detection
β βββ cli/
β βββ mod.rs # CLI commands
β βββ search.rs # Search functionality
β βββ recover.rs # Recovery interface
βββ config/
β βββ default.toml # Default configuration
βββ docs/
βββ ARCHITECTURE.md # Detailed design docs
βββ PRIVACY.md # Privacy deep-dive
βββ PLATFORM_SUPPORT.md # Platform-specific notes
```
## Platform Support
| macOS | β
| β
(Accessibility API) | Primary target |
| Linux (X11) | β
| β
(AT-SPI) | Primary target |
| Linux (Wayland) | β
| β οΈ (Limited by protocol) | Best effort |
| Windows | β | β | Not planned |
## Building
```bash
# Debug build
cargo build
# Release build
cargo build --release
# Run tests
cargo test
# Run with logging
RUST_LOG=debug cargo run -- daemon start
```
## Comparison to Alternatives
| Open source | β
| Usually β | Sometimes |
| Cross-platform | β
| Varies | Varies |
| Privacy-focused | β
| β | Partial |
| Captures text fields | β
| Via keystrokes | β |
| Captures clipboard | β
| Sometimes | β
|
| Filters sensitive data | β
| β | β |
| Searchable history | β
| Sometimes | Sometimes |
| No raw keylogging | β
| β | β
|
## Why "flightrecorder"?
Like an airplane's flight data recorder (black box):
- Runs silently in the background
- You forget it's there until you need it
- Invaluable for disaster recovery
- Captures just enough to reconstruct what happened
## Contributing
Contributions welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
Areas where help is especially appreciated:
- Wayland text field capture improvements
- Additional platform support
- Privacy pattern suggestions
- UI/UX for the recovery interface
## License
MIT License - See [LICENSE](LICENSE) for details.
---
*Stop losing your work. Start recording what happens in-flight.*
[//]: ---Named-Links---
[logo]: assets/images/logo/v1-x250.png
[logo-large]: assets/images/logo/v1.png
[build]: https://github.com/oxur/flightrecorder/actions/workflows/ci.yml
[build-badge]: https://github.com/oxur/flightrecorder/actions/workflows/ci.yml/badge.svg
[crate]: https://crates.io/crates/flightrecorder
[crate-badge]: https://img.shields.io/crates/v/flightrecorder.svg
[docs]: https://docs.rs/flightrecorder/
[docs-badge]: https://img.shields.io/badge/rust-documentation-blue.svg
[tag-badge]: https://img.shields.io/github/tag/oxur/flightrecorder.svg
[tag]: https://github.com/oxur/flightrecorder/tags