https://github.com/noah2610/climer
CLI timer written in Rust
https://github.com/noah2610/climer
cli command-line timer
Last synced: 4 months ago
JSON representation
CLI timer written in Rust
- Host: GitHub
- URL: https://github.com/noah2610/climer
- Owner: Noah2610
- License: mit
- Created: 2019-01-18T21:11:51.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-10T16:07:27.000Z (over 3 years ago)
- Last Synced: 2025-03-16T21:21:24.806Z (over 1 year ago)
- Topics: cli, command-line, timer
- Language: Rust
- Size: 72.3 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Climer
A simple CLI timer, written in Rust.
## CLI app
This project's main use is as a CLI app, but it can also be used as a crate / library.
### Installation
#### From [crates.io]
```
cargo install climer
```
#### From source
You will need `cargo` to compile from source, which is shipped with Rust.
```
git clone https://github.com/Noah2610/climer # Clone the repository
cargo install --path ./climer # Compile and install
```
### Usage
For the very basic timing feature, you can run something like:
```
climer 2m 30s
```
This will run the timer and print a readable representation of the remaining time to `stdout`.
When the time is up, the app will simply exit with exit code `0`,
so it is up to you to then play an alarm sound or whatever you may want it to trigger;
for example:
```
climer 1h 2m 30s && mpv ~/Music/alarm.mp3
```
For more detailed usage information, check out the help page with:
```
climer -h # Brief help
climer --help # More detailed help
```
## Library crate
In your `Cargo.toml` ...
```toml
[dependencies]
climer = { version = "0.7.0", default-features = false }
```
See below for available features.
### Compilation features
| Name | Description | Default? |
|:----------- |:----------- |:--------:|
| `cli` | Required for the binary app. You should disable this for library crates | `true` |
| `serialize` | Adds `serde` dependency and implements `Serialize` and `Deserialize` for `time::Time` | `false` |
| `parser` | Adds `regex` dependency and adds `time::parser` module with functions for parsing a time from a given string | enabled by `cli` feature |
### Documentation
Documentation should be available at [docs.rs/climer][docs].
## License
[MIT License][license]
[license]: ./LICENSE
[crates.io]: https://crates.io/crates/climer
[docs]: https://docs.rs/climer