juice-cli

Crates.iojuice-cli
lib.rsjuice-cli
version0.2.0
created_at2025-12-13 07:33:03.0137+00
updated_at2025-12-14 03:19:56.307497+00
descriptionModern battery status for Linux
homepage
repositoryhttps://github.com/yawarakatai/juice
max_upload_size
id1982699
size46,175
(yawarakatai)

documentation

README

🧃 juice - A modern battery status CLI for Linux.

🚀 Usage

juice        # Simple output
juice -v     # Detailed output

# Daemon (background data collection)
juice daemon              # Start with 30s interval
juice daemon -i 60        # Custom interval

# Status
juice status              # Show database info

# Export
juice export              # CSV to stdout
juice export -o data.csv  # Save to file
juice export --from 2025-12-13 --to 2025-12-14

📸 Example Output

Normal mode

BAT0 ████████░░  84%  11.2W ↓  2h34m

With multiple batteries

BAT0 ████████░░  84%   8.2W ↓  3h12m
BAT1 ██████░░░░  62%   3.0W ↓  2h58m

Verbose mode (-v)

BAT0 ████████░░  84% Discharging
  Power:        11.2W
  Remaining:    2h34m
  Energy:       45.2 /  54.0 Wh
  Cycle count:  142
  Health:       92.3%
  Technology:   Li-ion

📦 Installation

From crates.io

cargo install juice-cli

From source

git clone https://github.com/yawarakatai/juice
cd juice
cargo build --release

Nix

nix run github:yawarakatai/juice

Or add to your flake inputs:

{
  inputs.juice.url = "github:yawarakatai/juice";
}

✨ Features

  • Simple, clean output with progress bar and colors
  • Multiple battery support (ThinkPad, etc.)
  • Detailed view with battery health, cycle count, and more
  • No dependencies other than sysfs (works on minimal systems)

🔧 Compatibility

juice reads battery information from /sys/class/power_supply/ and supports:

  • Standard energy_* interfaces (most laptops)
  • charge_* interfaces (some older hardware)
  • current_now + voltage_now fallback for power calculation
  • Multiple batteries (BAT0, BAT1, CMB0, etc.)

Tested on:

  • NixOS
  • Arch Linux

📄 License

MIT

Commit count: 0

cargo fmt