Tshts
A fast, lightweight terminal-based spreadsheet application built in Rust with full formula support, cell references, and keyboard-driven navigation - perfect for command-line workflows.
Install / Use
/learn @SamuelSchlesinger/TshtsREADME
TSHTS - Terminal Spreadsheet
An efficient, lightweight terminal-based spreadsheet application built in Rust. TSHTS brings the power of spreadsheet calculations to your command line with an intuitive interface, comprehensive formula support, and robust data management capabilities.

🚀 Quick Start
Installation
# Clone the repository
git clone https://github.com/SamuelSchlesinger/tshts.git
cd tshts
# Build and run
cargo run --release
# Or build for installation
cargo build --release
# Binary will be available at target/release/tshts
First Steps
- Navigate: Use arrow keys or
hjklto move between cells - Edit: Press
EnterorF2to edit a cell - Formula: Start with
=for formulas (e.g.,=A1+B1,=SUM(A1:A10)) - Save: Press
Ctrl+Sto save your spreadsheet as.tshtsfile - Export/Import: Use
Ctrl+Efor CSV export,Ctrl+Ifor CSV import - Search: Press
/to search across all cells and formulas - Help: Press
F1or?for comprehensive help
✨ Key Features
🧮 Powerful Formula Engine
- Multi-Type System: Full support for both numbers and strings
- Arithmetic Operations:
+,-,*,/,**(power),%(modulo) - String Operations:
&(concatenation), string literals with"quotes" - Comparison Operators:
<,>,<=,>=,=,<>(works with strings and numbers) - Numeric Functions:
SUM,AVERAGE,MIN,MAX,ABS,SQRT,ROUND - String Functions:
CONCAT,LEN,UPPER,LOWER,TRIM,LEFT,RIGHT,MID,FIND - Web Functions:
GET(fetch content from URLs) - Logical Functions:
IF,AND,OR,NOT(work with strings and numbers) - Cell References: Standard notation (A1, B2, AA123, etc.)
- Range Support: Use ranges like
A1:C3in functions - Circular Reference Detection: AST-based analysis prevents infinite loops
- Undo/Redo Support: Full undo/redo functionality with
Ctrl+Z/Ctrl+Y - Cell Range Selection: Select ranges with
Shift+Arrowkeys - Autofill Functionality: Copy formulas with relative references using
Ctrl+D
📊 Smart Interface
- Auto-sizing Columns: Columns automatically adjust to content width
- Manual Resize: Use
+for all columns,-/_for individual column adjustment - Scrolling Viewport: Navigate large spreadsheets smoothly with automatic cursor tracking
- Visual Selection: Clear indication of current cell with range selection support
- Status Messages: Real-time feedback for operations and file status
- Search Highlighting: Visual highlighting of search results with navigation
- Multiple View Modes: Normal, editing, help, file operations, and search modes
💾 File Management
- Native Format: Human-readable
.tshtsfiles in JSON format - Save/Load:
Ctrl+Sto save,Ctrl+Oto load spreadsheet files - CSV Support:
Ctrl+Eto export CSV,Ctrl+I/Ctrl+Lto import CSV - Dependency Tracking: Automatic rebuilding of formula dependencies on load
- Error Handling: Graceful handling of file operations with clear error messages
- Data Integrity: Preserves formulas, values, column widths, and sheet dimensions
🎯 Why Choose TSHTS?
Performance: Built in Rust for excellent performance and memory efficiency. Handles large spreadsheets smoothly in terminal environments.
Portability: Cross-platform support (Linux, macOS, Windows) with no GUI dependencies. Perfect for servers, remote work, and headless environments.
Developer-Friendly: Clean architecture following domain-driven design principles. Comprehensive documentation, extensive test coverage, and modular structure make it easy to extend.
Modern Workflow: Git-friendly JSON format, command-line integration, and automation support. Works seamlessly with CI/CD pipelines and version control.
Rich Feature Set: Advanced formula engine with web functions (GET), string manipulation, logical operations, and mathematical functions. Real-time search, undo/redo, and smart autofill capabilities.
Current Capabilities
TSHTS provides a comprehensive spreadsheet experience with:
- ✅ Formula Engine: Multi-type evaluation (numbers and strings) with 30+ operators and functions
- ✅ Data Types: Full support for strings, numbers, formulas, and mixed-type operations
- ✅ Web Integration:
GETfunction for fetching data from URLs and APIs - ✅ String Processing: Comprehensive text manipulation with
UPPER,LOWER,TRIM,FIND,MID, etc. - ✅ Mathematical Functions:
SUM,AVERAGE,MIN,MAX,ABS,SQRT,ROUND, and more - ✅ Logical Operations:
IF,AND,OR,NOTwith full boolean logic support - ✅ Range Operations: Support for cell ranges (
A1:C3) in all applicable functions - ✅ File Operations: Native
.tshtsformat and CSV import/export - ✅ Smart UI: Responsive terminal interface with multiple interaction modes
- ✅ Search System: Full-text search across cell values and formulas
- ✅ Undo/Redo: Complete action history with unlimited undo levels
- ✅ Selection Tools: Range selection and autofill with relative reference adjustment
- ✅ Error Handling: Circular reference detection and comprehensive error reporting
Roadmap & Contributing
We're actively developing TSHTS with these upcoming features:
- 📅 Charts & Visualization: Basic terminal-based charts
- 📅 Import/Export: CSV, Excel format support
- 📅 Scripting: Lua/Python integration for custom functions
- 📅 Collaboration: Real-time sharing capabilities
- 📅 Plugins: Extension system for custom functionality
Want to contribute? Check our issues for good first contributions. We welcome:
- Bug reports and feature requests
- Documentation improvements
- Performance optimizations
- New formula functions
- Platform-specific enhancements
📖 Comprehensive Formula Reference
TSHTS supports a powerful multi-type formula system that handles both numbers and strings seamlessly.
🔢 Numeric Operations
Basic Arithmetic
=2+3 → 5
=10-4 → 6
=A1*B1 → Multiplies values in A1 and B1
=15/3 → 5
=2**3 → 8 (2 to the power of 3)
=10%3 → 1 (10 modulo 3)
Numeric Functions
=SUM(A1,B1,C1) → Sum of individual cells
=SUM(A1:A10) → Sum of range A1 through A10
=AVERAGE(A1:A10) → Average of range
=MIN(A1:C3) → Minimum value in range
=MAX(A1:C3) → Maximum value in range
=ABS(-5) → 5 (absolute value)
=SQRT(16) → 4 (square root)
=ROUND(3.14159) → 3 (round to integer)
=ROUND(3.14159, 2) → 3.14 (round to 2 decimal places)
🔤 String Operations
String Literals and Concatenation
="Hello World" → Hello World
="" → (empty string)
="Hello" & " " & "World" → Hello World
="Number: " & 42 → Number: 42
="Result: " & (2+3) → Result: 5
String Functions
=LEN("Hello") → 5 (string length)
=UPPER("hello") → HELLO (convert to uppercase)
=LOWER("WORLD") → world (convert to lowercase)
=TRIM(" spaces ") → spaces (remove leading/trailing spaces)
String Extraction (0-based indexing)
=LEFT("Hello World", 5) → Hello (first 5 characters)
=RIGHT("Hello World", 5) → World (last 5 characters)
=MID("Hello World", 6, 5) → World (5 chars starting at position 6)
=FIND("lo", "Hello") → 3 (position of "lo" in "Hello")
=FIND("World", "Hello World") → 6 (position of "World")
Advanced String Operations
=CONCAT("A", "B", "C") → ABC (concatenate multiple values)
=CONCAT("Number: ", 123) → Number: 123
=FIND("text", A1, 3) → Find "text" in A1 starting from position 3
🌐 Web Functions
=GET("https://api.example.com/data") → Fetch raw content from API
=GET("https://jsonplaceholder.typicode.com/posts/1") → Get JSON data
=GET("https://raw.githubusercontent.com/user/repo/main/data.csv") → Fetch CSV
=LEN(GET("https://example.com")) → Get length of web content
=UPPER(GET("https://api.service.com")) → Convert fetched content to uppercase
🔍 Comparisons (Work with Numbers and Strings)
=5<10 → 1 (true)
=A1>=B1 → 1 if A1 ≥ B1, 0 otherwise
="Hello"="Hello" → 1 (string equality)
="Hello"<>"World" → 1 (string inequality)
=A1<>B1 → 1 if values are different
🧠 Logical Functions
=IF(A1>10, "High", "Low") → Conditional with string results
=IF(A1="Hello", "Found", "Not Found") → String condition
=AND(A1>0, B1<10) → 1 if both conditions true
=OR(A1=0, B1=0) → 1 if either condition true
=NOT(A1>5) → 1 if A1 ≤ 5
📊 Cell References and Ranges
=A1 → Value from cell A1 (auto-detects number vs string)
=A1+B1 → Sum if numeric, concatenation if mixed types
=SUM(A1:A10) → Sum of range A1 through A10
=AVERAGE(B1:B5) → Average of range B1 through B5
=CONCAT(A1:A3) → Concatenate all values in range A1:A3
🔄 Type Conversion
TSHTS automatically handles type conversion:
- Numeric operations: Strings are converted to numbers (empty/invalid = 0)
- String operations: Numbers are converted to strings
- Comparisons: Like types compared directly, mixed types compared as strings
- Cell values: Auto-detected based on content
📝 Formula Examples
Data Processing
=UPPER(A1) & " - " & LOWER(B1) → Combine formatted strings
=IF(LEN(A1)>0, A1, "Empty") → Check for non-empty strings
=LEFT(A1, FIND(" ", A1)-1) → Extract first wor
