oeis-tui
A TUI and CLI for browsing the On-Line Encyclopedia of Integer Sequences (OEIS) in the terminal.
oeis.mp4
Installation
From GitHub Releases
Download the latest binary for your platform from the releases page.
Using Homebrew
brew install hako/tap/oeis-tui
Using eget
Using Cargo
Build from Source
Requirements: Rust 1.70 or later
cd /path/to/oeis/rust cargo build --release # binary: target/release/oeis
Features
- Search & Browse: Advanced query syntax (id:, keyword:, author:), paginated results
- Preview Pane: Live sequence detail preview while browsing results
- Sequence Details: 6-tab interface (Overview, Formulas, Code, References, Cross-refs, Metadata)
- Graph Visualization: Line, scatter, logarithmic, and pin plot charts
- Export: JSON, CSV, TXT, Markdown, and B-File formats with clipboard/file support
- Bookmarks: Save sequences with notes for quick access
- Caching: SQLite-based persistent caching for offline access
- Webcam Mode: Auto-refreshing sequence browser with 4 categories and configurable intervals
- Themes: Dark and light themes with runtime switching
- Customizable Keybindings: User-configurable keys with presets (default, vim, emacs)
- Internationalization: 6 languages (English, French, Japanese, Spanish, Korean, Chinese)
- Mouse Support: Click to edit, select, scroll, and navigate
- CLI Mode: Non-interactive commands (search, fetch, random)
Demo Screenshots
![]() Welcome Screen |
![]() Search Results |
![]() Preview Pane |
![]() Code Tab |
![]() B-file Loading |
![]() Export |
![]() Line Chart (Collatz) |
![]() Line Chart (Fibonacci) |
![]() Pin Plot (Primes) |
![]() Log Scatter |
![]() Webcam Mode |
![]() Settings |
Usage
TUI Mode (Default)
Launch the interactive terminal interface:
CLI Commands
The CLI provides UNIX-friendly commands with multiple output formats, perfect for piping and integration with external tools.
Basic Commands
# Search for sequences oeis search "1,2,3,5,8" oeis search "fibonacci" oeis search "keyword:prime" # Fetch a specific sequence oeis fetch A000045 # Get a random sequence oeis random
Output Formats
All commands support --format / -f flag with these options:
plain(default) - Human-readable outputjson- Complete JSON data (forjqand scripting)csv- Index,value pairs (for spreadsheets and plotters)tsv- Tab-separated values (gnuplot native format)values- Just the numbers, one per line (for simple piping)
# Get Fibonacci sequence in different formats oeis fetch A000045 -f values # Just numbers oeis fetch A000045 -f csv # index,value pairs oeis fetch A000045 -f tsv # Tab-separated (gnuplot) oeis fetch A000045 -f json # Full JSON oeis fetch A000045 -q # Quiet mode (no headers)
Piping and Composability
# Search and fetch multiple sequences oeis search "fibonacci" -f values -l 5 | xargs -n1 oeis fetch # Get just the numbers for processing oeis fetch A000045 -f values -q | head -20 # Extract specific data with jq oeis fetch A000045 -f json | jq '.data' # Batch process sequences cat sequences.txt | xargs -n1 oeis fetch -f csv > output.csv # Search with verbose output (A-numbers + names) oeis search "prime" -f values -v | column -t -s $'\t'
Plotting with External Tools
The CLI outputs data in formats compatible with gnuplot, matplotlib, R, and other plotting tools:
# Plot with gnuplot oeis fetch A000045 -f tsv -q | gnuplot -p -e "plot '-' with lines" # Save plot to file oeis fetch A000045 -f tsv -q > fib.dat gnuplot -e "set terminal png; set output 'fib.png'; plot 'fib.dat' with linespoints" # Plot with matplotlib (Python) oeis fetch A000045 -f csv -q | python -c " import sys; import matplotlib.pyplot as plt data = [line.split(',') for line in sys.stdin] x, y = zip(*[(int(a), int(b)) for a, b in data]) plt.plot(x, y); plt.show() " # R plotting oeis fetch A000045 -f csv | Rscript -e " data <- read.csv('stdin', header=TRUE) png('plot.png'); plot(data); dev.off() "
Quick Workflows
# Daily random sequence oeis random -q > /tmp/sequence-of-the-day.txt # Compare two sequences side-by-side paste <(oeis fetch A000045 -f values -q) <(oeis fetch A000079 -f values -q) | head # Find and plot prime-related sequences oeis search "keyword:prime" -f values | head -1 | xargs oeis fetch -f tsv -q | gnuplot -p -e "plot '-'" # Export to spreadsheet format oeis fetch A000045 -f csv > fibonacci.csv
TUI Controls
Global
Ctrl+QorCtrl+C- QuitCtrl+H- HelpCtrl+A- AboutCtrl+T- Cycle themeCtrl+V- Toggle keybinding presetEsc- Go back
Search
ior/- Edit searchEnter- View sequence↑/↓ork/j- Navigate results←/→orh/l- Page navigationr- Random sequencew- Webcam modes- Settingsp- Toggle preview paneb- Toggle bookmarks panel1-6- Quick preview tab selection (when preview open)Ctrl+U/Ctrl+D- Scroll preview (vim-style)
Detail View
Tab/Shift+Tab- Switch tabs↑/↓ork/j- Scroll content←/→orh/l- Navigate A-number referencesg- View graphe- Export tabo- Open in browserb- Toggle bookmarkf- Fetch B-file dataBackspace- Go back
Graph View
1-4- Switch chart type (Line, Scatter, Log, Pin)EscorBackspace- Back to detail
Export
↑/↓ork/j- Select format1-5- Quick format selection (JSON, CSV, TXT, Markdown, B-File)Enter- Copy to clipboardCtrl+S- Save to file
Webcam Mode
SpaceorEnter- Load next sequenced- View sequence detailTabor→orl- Next sectionShift+Tabor←orh- Previous section↑/↓ork/j- Navigate options0-5- Quick interval (0=Manual, 1=5s, 2=10s, 3=20s, 4=30s, 5=1m)EscorBackspace- Back to search
Settings
Tabor→orl- Next panelShift+Tabor←orh- Previous panel↑/↓ork/j- Navigate optionsEnter- Select option1-6- Quick language selectionEscorBackspace- Back to search
Search Syntax
1,2,3,5,8,13,21 # Search by terms id:A000045 # Search by A-number keyword:nice # Search by keyword author:Sloane # Search by author name:prime # Search in names 1,2,_,5,8 # _ matches any single number 1,2,__,7,8 # __ matches any consecutive list
Cache and Configuration Location
- macOS / Linux:
~/.config/oeis-tui/oeis_cache.db - Windows:
%APPDATA%\oeis-tui\oeis_cache.db
Settings live alongside the cache at ~/.config/oeis-tui/settings.json (or the platform equivalent).
Development
cargo run # Run in dev mode cargo test # Run tests cargo clippy # Lint cargo fmt # Format
Credits
All sequence data is provided by the On-Line Encyclopedia of Integer Sequences (OEIS), founded by Neil J. A. Sloane and maintained by The OEIS Foundation Inc. and its many contributors.
Special thanks to:
- Neil J. A. Sloane for creating and maintaining OEIS
- The OEIS Foundation Inc. for hosting and maintaining the database
- OEIS Contributors for their invaluable contributions to the sequences and mathematical knowledge
Sequence data © The OEIS Foundation Inc.
License
MIT
Note: oeis-tui is not officially affiliated with the OEIS Foundation.












