| Crates.io | numby |
| lib.rs | numby |
| version | 0.1.8 |
| created_at | 2025-11-15 06:06:18.446765+00 |
| updated_at | 2025-11-23 17:15:45.588476+00 |
| description | A powerful natural language calculator with a terminal user interface |
| homepage | |
| repository | https://github.com/vivy-company/numby |
| max_upload_size | |
| id | 1934075 |
| size | 3,854,625 |
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.
prev, sum, averagenow, today, time in Tokyo, next Monday, or 100 days from today, and compute date differences.numby extension) with multi-line expressionsCtrl+I / Ctrl+Y+, -, *, /, %, ^ (exponentiation)sin, cos, tan, asin, acos, atan, sinh, cosh, tanhlog (base 10), ln (natural log)sqrt, abs, round, ceil, floorpi (π), e (Euler's number)0b101), octal (0o10), hex (0xFF), scale suffixes (5k, 2M, 3G)--update-rates forces a refresh, --no-update skips itconfig.json when offline--rate EUR:0.9220% of 100 → 20100 + 10% → 110 (adds 10% of 100)200 - 25% → 150 (subtracts 25% of 200)50% of 200 USD → 100 USDAvailable in English, Spanish, French, German, Japanese, Russian, Belarusian, Chinese (Simplified & Traditional). Switch with --locale or :lang command.
// or # to annotate calculations (grayed out in TUI):w to save, :q to quit, :lang to switch language~/.numby/config.json for custom units, rates, and aliasescargo install numby
Installs from crates.io.
curl -fsSL https://numby.vivy.app/install.sh | bash
Automatically detects your OS/architecture and installs the latest release binary.
Download for your platform from GitHub Releases:
Extract and add to your PATH.
A native macOS app with graphical interface is available on the App Store for $6.
The CLI/TUI version remains free and open-source.
git clone https://github.com/vivy-company/numby.git
cd numby
cargo build --release
Binary available at target/release/numby.
numby
Launches the split-panel terminal interface with live evaluation.
TUI Keybindings:
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# Single expression
numby "2 + 3 * 4"
# With units
numby "100 USD in EUR"
# Natural language
numby "5 meters plus 3 feet in inches"
# Percentage
numby "15% of 200"
# Open existing file
numby calculations.numby
# Or specify with flag
numby --file my_calculations.numby
Save from TUI with :w or :w filename.numby.
numby [OPTIONS] [EXPRESSION]
Options:
-f, --file <PATH> Open file for editing
--locale <LOCALE> Set language (en-US, es, fr, de, ja, ru, be, zh-CN, zh-TW)
--rate <CURR:RATE> Override currency rate (e.g., EUR:0.92)
--update-rates Force update currency rates from API
--no-update Skip automatic rate update
--format <NAME> CLI output format: pretty (default), markdown, table/box, plain
-h, --help Print help
-V, --version Print version
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
numby --update-rates
# Skip auto-update
numby --no-update
# Override specific rate
numby --rate EUR:0.92 --rate GBP:0.85
# Check current rates
numby "1 USD in EUR"
API Source: fawazahmed0/exchange-api (free, no limits)
numby "2 + 3 * 4" # 14
numby "100 / 25" # 4
numby "2 ^ 8" # 256
numby "sqrt(144)" # 12
numby "sin(45)" # 0.85
numby "cos(pi/3)" # 0.5
numby "log(1000)" # 3
numby "abs(-42)" # 42
# In TUI:
x = 100
y = 50
total = x + y # 150
prev + 10 # 160 (uses previous result)
sum # Sum of all results
average # Average of all results
numby "5 meters to feet" # 16.4 ft
numby "100 km in miles" # 62.14 mi
numby "32 f to c" # 0°C (Fahrenheit to Celsius)
numby "2 hours in seconds" # 7200 s
numby "5 gallons to liters" # 18.93 L
numby "100 USD in EUR" # ~92 EUR (live rates)
numby "500 GBP to JPY" # ~95000 JPY
numby "1 BTC in USD" # Current Bitcoin price
numby "50 ETH to EUR" # Ethereum conversion
numby "20% of 500" # 100
numby "100 + 15%" # 115 (adds 15% of 100)
numby "200 - 10%" # 180 (subtracts 10% of 200)
numby "50% of 80 USD" # 40 USD
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
numby "5 meters plus 3 feet in inches"
numby "100 divided by 4 times 2"
numby "pi times 10"
numby "0b1010" # Binary: 10
numby "0xFF" # Hex: 255
numby "5k + 2M" # 2,005,000
numby "1_000_000 / 2" # 500,000
// Budget calculations
income = 4500 USD # Monthly income
expenses = 3200 USD // Fixed expenses
savings = income - expenses # Remaining savings
Comments appear grayed out in TUI.
# Spanish
numby --locale es "100 + 50"
# Japanese
numby --locale ja "10 km to miles"
# Chinese
numby --locale zh-CN "50% of 200"
# Switch language in TUI
:lang de # Switch to German
:langs # List available languages
Supported: English, Spanish, French, German, Japanese, Russian, Belarusian, Chinese (Simplified/Traditional)
numby "now" # Current local time
numby "time in tokyo" # Current time in a specific timezone
numby "today + 5 days" # Date arithmetic
numby "days between 2025-01-01 and 2025-01-31" # Difference in days
numby "next monday" # Next occurrence of a weekday
Numby stores configuration at ~/.numby/config.json. Auto-generated on first run.
Configurable Options:
Example config.json:
{
"locale": "en-US",
"units": {
"meter": 1.0,
"foot": 0.3048,
"mile": 1609.34
},
"currencies": {
"USD": 1.0,
"EUR": 0.92
},
"operator_aliases": {
"plus": "+",
"times": "*",
"divided by": "/"
}
}
Edit to add custom units or override defaults.
# All tests
cargo test
# Specific test suites
cargo test --lib
cargo test --test cli_tests
cargo test --test localization_integration
# i18n tests (require single thread)
cargo test --lib i18n -- --test-threads=1
# Development build
cargo build
# Optimized release
cargo build --release
# Platform-specific profiles
cargo build --profile release-cli # CLI/TUI (with LTO)
cargo build --profile release-lib # macOS app library
Agent-Based Evaluation Pipeline:
sum, total, avg, prevnow, relative offsets, day-of-week phrases, and date differencesin/to across units and currenciesKey Dependencies:
Contributions welcome! Please submit a Pull Request.
Areas for contribution:
MIT License - see LICENSE file.
Note: The CLI/TUI version is free and open-source. The macOS App Store version ($6) supports ongoing development.