Numby
A powerful natural language calculator with both CLI and terminal user interface (TUI). Numby allows you to perform calculations, work with variables, convert between 40+ units across 9 categories, handle currency conversions, calculate percentages, and maintain a history of your computations—all with multi-language support.
Features
Core Capabilities
- Natural Language Calculations: Evaluate mathematical expressions with natural operators like "plus", "times", "divided by"
- Interactive TUI: Split-panel interface with live evaluation and syntax highlighting
- CLI Mode: Evaluate expressions directly from the command line or pipe input
- Variables & History: Store values, reference previous results with
prev,sum,average - Date & Time Awareness: Ask for
now,today,time in Tokyo,next Monday, or100 days from today, and compute date differences - File Support: Save and load calculation files (
.numbyextension) with multi-line expressions - Clipboard Integration: Copy inputs or results with
Ctrl+I/Ctrl+Y
Mathematical Operations
- Basic Arithmetic:
+,-,*,/,%,^(exponentiation) - Trigonometry:
sin,cos,tan,asin,acos,atan,sinh,cosh,tanh - Logarithms:
log(base 10),ln(natural log) - Other Functions:
sqrt,abs,round,ceil,floor - Constants:
pi(π),e(Euler's number) - Number Formats: Binary (
0b101), octal (0o10), hex (0xFF), scale suffixes (5k,2M,3G)
Unit Conversions (40+ Units)
- Length: meter, km, cm, mm, foot, inch, yard, mile, nautical mile, hand, rod, chain, furlong
- Time: seconds, minutes, hours, days, weeks, months, years
- Temperature: Celsius, Fahrenheit, Kelvin (with proper conversion formulas)
- Area: m², hectare, acre
- Volume: liter, ml, m³, pint, quart, gallon, cup, teaspoon, tablespoon
- Mass/Weight: gram, kg, tonne, pound, ounce, stone, carat
- Speed: m/s, km/h, mph, knot
- Angles: degree, radian
- Data: bit, byte
- Energy: joule, calorie
Currency & Financial
- Hundreds of Fiat & Crypto Currencies: USD, EUR, GBP, JPY, CAD, AUD, CHF, CNY, INR plus popular crypto assets (BTC, ETH, etc.) from the fawazahmed0 currency API
- Automatic Refresh: On startup Numby fetches latest rates when the cached timestamp is older than 24 hours;
--update-ratesforces a refresh,--no-updateskips it - Offline Support: Falls back to cached rates in
config.jsonwhen offline - Custom Rates: Override rates with
--rate EUR:0.92
Percentage Calculations
20% of 100→ 20100 + 10%→ 110 (adds 10% of 100)200 - 25%→ 150 (subtracts 25% of 200)- Works with currencies:
50% of 200 USD→ 100 USD
Multilingual Support (9 Languages)
Available in English, Spanish, French, German, Japanese, Russian, Belarusian, Chinese (Simplified & Traditional). Switch with --locale or :lang command.
Developer Features
- Comments: Use
//or#to annotate calculations (grayed out in TUI) - Syntax Highlighting: Colorized numbers, operators, units, and errors
- Vim-like Commands:
:wto save,:qto quit,:langto switch language - Configurable: JSON config at
~/.numby/config.jsonfor custom units, rates, and aliases
Installation
Cargo (Recommended)
Installs from crates.io.
Automated Installer Script
|
Automatically detects your OS/architecture and installs the latest release binary.
Download Pre-built Binaries
Download for your platform from GitHub Releases:
- Linux: x86_64, ARM64
- macOS: x86_64 (Intel), ARM64 (Apple Silicon)
- Windows: x86_64, ARM64
Extract and add to your PATH.
macOS App (Paid)
A native macOS app with graphical interface is available on the App Store for $6.
The CLI/TUI version remains free and open-source.
Building from Source
Binary available at target/release/numby.
Usage
Interactive TUI Mode (Default)
Launches the split-panel terminal interface with live evaluation.
TUI Keybindings:
- Arrow keys: Navigate cursor
Home/End: Jump to line start/endEnter: Evaluate line and insert newlineCtrl+Y: Copy current result to clipboardCtrl+I: Copy current input to clipboard:q: Quit |:w: Save |:w <file>: Save as:lang <locale>: Switch language |:langs: List languages
CLI Mode (Quick Evaluation)
# Single expression
# With units
# Natural language
# Percentage
File Operations
# Open existing file
# Or specify with flag
Save from TUI with :w or :w filename.numby.
CLI Options
)
)
)
Currency Management
Exchange rates are cached in config.json and refreshed from the free fawazahmed0 currency API when the cache is older than 24 hours. Cached rates work offline.
# Force update
# Skip auto-update
# Override specific rate
# Check current rates
API Source: fawazahmed0/exchange-api (free, no limits)
Examples
Basic Arithmetic
Trigonometry & Math Functions
Variables & History
# In TUI:
Unit Conversions
Currency Conversions
Percentage Operations
Complex Multi-line Calculations
Create a file budget.numby:
# Monthly budget calculation
income = 5000 USD
rent = 30% of income # 1500 USD
utilities = 200 USD
food = 500 USD
savings = income - rent - utilities - food
savings in EUR # Converted savings
Run: numby budget.numby
Natural Language
Number Formats
Comments
// Budget calculations
income = 4500 USD # Monthly income
expenses = 3200 USD // Fixed expenses
savings = income - expenses # Remaining savings
Comments appear grayed out in TUI.
Multi-language Support
# Spanish
# Japanese
# Chinese
# Switch language in TUI
Supported: English, Spanish, French, German, Japanese, Russian, Belarusian, Chinese (Simplified/Traditional)
Date & Time
Configuration
Numby stores configuration at ~/.numby/config.json. Auto-generated on first run.
Configurable Options:
- Units: Custom unit definitions and conversion factors
- Currencies: Exchange rates (auto-updated from API)
- Currency Symbols: Symbol mappings ($, €, £, ¥, etc.)
- Operator Aliases: Natural language mappings ("plus" → "+")
- Locale: Default language
- Padding: TUI interface spacing
Example config.json:
Edit to add custom units or override defaults.
Development
Running Tests
# All tests
# Specific test suites
# i18n tests (require single thread)
Building
# Development build
# Optimized release
# Platform-specific profiles
Architecture
Agent-Based Evaluation Pipeline:
- History Agent: Handles
sum,total,avg,prev - Variable Agent: Manages variable assignments
- Percentage Agent: Processes percentage operations
- Date/Time Agent: Understands
now, relative offsets, day-of-week phrases, and date differences - Unit Agent: Handles conversions with
in/toacross units and currencies - Math Agent: Fallback for algebraic expressions
Key Dependencies:
- ratatui - Terminal UI framework
- crossterm - Cross-platform terminal control
- fasteval2 - Expression evaluation engine
- fluent - Localization framework
- ropey - Efficient text buffer
- arboard - Clipboard integration
- serde + serde_json - Configuration serialization
Contributing
Contributions welcome! Please submit a Pull Request.
Areas for contribution:
- Additional unit conversions
- New language translations
- Bug fixes and performance improvements
- Documentation enhancements
License
MIT License - see LICENSE file.
Note: The CLI/TUI version is free and open-source. The macOS App Store version ($6) supports ongoing development.