convertx

Crates.ioconvertx
lib.rsconvertx
version0.1.0
created_at2025-07-05 16:55:25.259396+00
updated_at2025-07-05 16:55:25.259396+00
descriptionMultipurpose Units Converter
homepagehttps://jcharistech.github.io/convertx/convertx/
repositoryhttps://github.com/jcharistech/convertx
max_upload_size
id1739325
size1,857,595
JCharis Jesse (Jcharis)

documentation

README

Convertx

Unit Converter CLI

A simple Rust command-line tool for converting between a wide range of units in categories such as length, temperature, mass, data rate, area, volume, speed, pressure, bytes, time and more.

Stable Dev

Installation

To install convertx you can do so via cargo

1. Install with Cargo:

cargo add convertx

Or simply put the following in your Cargo.toml.

[dependencies]
convertx = "0.1.0"

2. Clone and build:

Alternatively you can build it from the github repo and optionally install it globally

git clone https://github.com/jcharistech/convertx.git
cd convertx
cargo build --release

The binary will be located in target/release/convertx.

3. (Optional) Install globally:

cargo install --path .

Features

  • Length: meters, kilometers, feet, inches

  • Temperature: Celsius, Fahrenheit, Kelvin

  • Mass/Weight: kilograms, pounds, ounces

  • Data Rate: bits per second (bps), megabits per second (mbps)

  • Bytes: supports human-readable and MB conversion

  • Time: seconds, human-readable duration

  • Area: square meters, square feet, acres, hectares

  • Volume: liters, milliliters, cubic meters, cubic inches, gallons

  • Speed: meters per second, kilometers per hour, miles per hour, knots

  • Pressure: pascal, bar, atm, psi

  • Easy to extend: add your own units and categories with minimal code changes

  • Helpful CLI: shows usage and supported units on --help

Usage

convertx  [OPTIONS]

Get help for any subcommand:

convertx  --help

Supported Subcommands

Subcommand Description Example
bytes Convert byte values convertx bytes 1048576 --megabytes
time Convert seconds to human time convertx time 4000 --human-readable
length Convert length units convertx length 2 --from meters --to feet
temperature Convert temperature units convertx temperature 100 --from c --to f
mass Convert mass/weight units convertx mass 2.5 --from kg --to lb
datarate Convert data rate units convertx datarate 10 --from mbps --to bps
area Convert area units convertx area 1000 --from sqm --to acres
volume Convert volume units convertx volume 2 --from gallons --to liters
speed Convert speed units convertx speed 60 --from mph --to kph
pressure Convert pressure units convertx pressure 1 --from atm --to psi

Examples

Bytes:

convertx bytes 1048576 --megabytes
convertx bytes 1048576 --human-readable

Time:

convertx time 4000 --human-readable

Length:

convertx length 10 --from kilometers --to meters
convertx length 2 --from feet --to inches

Temperature:

convertx temperature 32 --from f --to c
convertx temperature 300 --from k --to f

Mass:

convertx mass 100 --from lb --to kg
convertx mass 500 --from oz --to lb

Data Rate:

convertx datarate 12345678 --from bps --to mbps
convertx datarate 15 --from mbps --to bps

Area:

convertx area 4046.86 --from sqm --to acres
convertx area 2 --from hectares --to sqft

Volume:

convertx volume 3.5 --from gallons --to liters
convertx volume 2 --from cubic_meters --to gallons

Speed:

convertx speed 60 --from mph --to kph
convertx speed 25 --from mps --to knots

Pressure:

convertx pressure 2 --from bar --to psi
convertx pressure 101325 --from pa --to atm

Extending & Contributing

  • Add new units by adding an enum variant, conversion function, and CLI case!

  • PRs and improvements very welcome.


Jesus Saves @JCharisTech

Enjoy lightning-fast, accurate unit conversions from your terminal!


Commit count: 0

cargo fmt