#duration #time #cli

bin+lib nai

Measure the duration of meaningful pursuits

14 releases (4 stable)

1.1.1 Jul 22, 2023
0.9.0 Jun 21, 2023

#2043 in Command line utilities

Download history 20/week @ 2024-02-19 3/week @ 2024-02-26 28/week @ 2024-03-11 89/week @ 2024-04-01

117 downloads per month

MIT license

28KB
519 lines

Nai (나이)

Measure the duration of meaningful pursuits.

Build status Sponsor me

demo


Features

  • Measure the duration of cherished moments.
  • Use any template in your imagination!.
  • Fancy error message and colorful output.
  • Cross-platform and single binary.

Why?

I want to have a fast way to calculate my family age, how long I have been working for a company, marriage, and other stuff.

Usage

Create a file named config.ron in ~/.config/nai/. If you are on Windows, put it under \AppData\Nai. Then add your configuration:

Config(
    moments: [
        // My birthday
        (
            start_date: "1980-Oct-15",
            // Currently, only `start_date` and `duration` are available
            format: "👶 {{ 'Aragorn II Elessar age (Me)' | cyan | bold }}\nBorn at: {{ start_date | red }}\nAge: {{ duration }}\n",
        ),
    ],
)

To see more configuration, see the example directory.

Installation

From binaries

The release page includes pre-compiled binaries for GNU/Linux, macOS, and Windows.

From source

Using cargo-binstall

$ cargo binstall nai

Using Rust's package manager cargo:

$ cargo install nai

Development

git clone https://github.com/azzamsa/nai

# Build
cd nai
cargo build

# Run unit tests and integration tests
cargo test

# Install
cargo install --path .

Contributing

To learn more read the development guide

Origin of the name

Nai (나이) means "age" in Korean.

Credits

Dependencies

~12MB
~222K SLoC