epok

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2025 License: MIT Imports: 7 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
cmd
styles
Package styles provides the pre-computed lipgloss styles and colors used throughout the application.
Package styles provides the pre-computed lipgloss styles and colors used throughout the application.
Package parse is a module for parsing Unix timestamps into time.Time objects.
Package parse is a module for parsing Unix timestamps into time.Time objects.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL