Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DanStough/epok

Repository files navigation

epok

Pronounced "epic-but-with-a-k"

A CLI for working with Unix Timestamps inspired by epochconverter.com. Also kind of like Unix date, but for smoother brains and folks who like nanosecond timestamps.

Terminal prompt showing generating a timestamp and parsing it with epok

Main commands:

  1. parse - read a unix timestamp and return the human readable form. Infers the precision.
  2. now - generate a unix timestamp for the current instant. Multiple precisions supported.
  3. timezone (TBA)- work with system timezones (view, list, search)
  4. at (TBA)- convert human readable timestamps and expressions to unix timestamps
  5. between (TBA)- find the human readable delta between two timestamps

Built with great open source libraries:

Installation

Homebrew

Install on MacOS and Linux using this homebrew tap:

brew install DanStough/tap/epok

Install from Source

You can install the tool directly if you have a Go installation >= 1.21:

go install github.com/DanStough/epok@latest

Documentation

Run epok help.

Development

Important

Tests require the use of the experimental testing/synctest package. You will need to configure your Go environment with GOEXPERIMENT=synctest. Setting GOTRACEBACK=all can also be helpful for debugging synctest errors (Go #70911).

For now, you can use the vanilla Go commands for building and testing:

# Run
go run . parse --help

# Test
go test -v ./...

TODO

MVP
  • parse command
    • Outputs UTC and local system time from arg
    • Outputs UTC and local system time from stdin
  • Lipgloss for styling
  • now command to return the instantaneous timestamp.
    • -p,--precision to specify the precision
  • go install instructions
  • Version command (handled by fang)
  • Flair: GIF + Ascii Art
  • CI
    • go releaser
  • homebrew tap

Milestone 1

  • Makefile, Taskfile or Just to build
  • parse command
    • timezone flag for parse command to specify additional output zone
  • timezone command
    • list command (include source?)
    • show current system timezone
  • Output Mode: simple - something that can be copy/pasted
  • CI
    • go test
    • conventional commits check

Future

  • between command - compare two timestamps
  • Output Mode: json
  • golintci + CI
  • at command for generating a unix timestamp from multiple formats.
  • Add "preferred timezones" to the config file, which are used when outputting human-readable information.
  • batch process multiple timestamps and return tabular delta
  • built-in copy/paste functionality (yes, I know pbcopy/pbpaste is a thing) now I'm thinking this doesn't make much sense if you can read from stdin.
  • "default" command - alias your favorite command in the tool

About

A CLI for working with Unix Timestamps & Timezones

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published