gool

command module
v1.0.10 Latest Latest
Warning

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

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

README ΒΆ

Gool

Test Lint Deploy codecov Go Report Card

πŸ“¦ A toolkit make your programmer life easier.

Inspired by Boop

Kapture 2025-07-29 at 00 32 36

Installation

cURL
# macOS Intel
curl -L https://github.com/cloudingcity/gool/releases/latest/download/gool_Darwin_x86_64.tar.gz | \
  tar xz && sudo mv gool /usr/local/bin/

# macOS Apple Silicon  
curl -L https://github.com/cloudingcity/gool/releases/latest/download/gool_Darwin_arm64.tar.gz | \
  tar xz && sudo mv gool /usr/local/bin/

# Linux x86_64
curl -L https://github.com/cloudingcity/gool/releases/latest/download/gool_Linux_x86_64.tar.gz | \
  tar xz && sudo mv gool /usr/local/bin/

# Or for a specific version:
curl -L https://github.com/cloudingcity/gool/releases/download/v1.0.0/gool_Darwin_x86_64.tar.gz | \
  tar xz && sudo mv gool /usr/local/bin/
Homebrew
brew install --cask cloudingcity/tap/gool

Note: On macOS, you may see a security warning since the binary is not signed/notarized (I'm too poor for Apple's $99/year developer fee 😭). To bypass this:

  1. Go to System Preferences β†’ Security & Privacy β†’ General
  2. Click "Allow Anyway" next to the blocked app warning
  3. Or run: sudo xattr -rd com.apple.quarantine /opt/homebrew/bin/gool

Usage

Interactive Shell
$ gool 

 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ”  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ”  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ” β–ˆβ–ˆβ”
β–ˆβ–ˆβ”Œβ”€β”€β”€β”€β”˜ β–ˆβ–ˆβ”Œβ”€β”€β”€β–ˆβ–ˆβ”β–ˆβ–ˆβ”Œβ”€β”€β”€β–ˆβ–ˆβ”β–ˆβ–ˆβ”‚
β–ˆβ–ˆβ”‚  β–ˆβ–ˆβ–ˆβ”β–ˆβ–ˆβ”‚   β–ˆβ–ˆβ”‚β–ˆβ–ˆβ”‚   β–ˆβ–ˆβ”‚β–ˆβ–ˆβ”‚
β–ˆβ–ˆβ”‚   β–ˆβ–ˆβ”‚β–ˆβ–ˆβ”‚   β–ˆβ–ˆβ”‚β–ˆβ–ˆβ”‚   β–ˆβ–ˆβ”‚β–ˆβ–ˆβ”‚
β””β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ”Œβ”˜β””β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ”Œβ”˜β””β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ”Œβ”˜β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ”
 β””β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”˜

 /help for more information

Κ•β—”Ο–β—”Κ” ❯ /jwt-decode
jwt-decode ❯ eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
{
  "header": {
    "alg": "HS256",
    "typ": "JWT"
  },
  "payload": {
    "sub": "1234567890",
    "name": "John Doe",
    "iat": 1516239022
  },
  "signature": "SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
jwt-decode ❯ /ts2date 1516239022
2018-01-18T01:30:22Z
jwt-decode ❯
Direct CLI
$ gool jwt-decode eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
{
  "header": {
    "alg": "HS256",
    "typ": "JWT"
  },
  "payload": {
    "sub": "1234567890",
    "name": "John Doe",
    "iat": 1516239022
  },
  "signature": "SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}

Commands

Command Description
tsconv Smart timestamp/date converter - auto-detects input type (default: show current time as both)
msconv Smart millisecond timestamp/date converter (default: show current time as both)
ts2date Covert unix timestamp to date (default: current time)
date2ts Covert date to unix timestamp (default: current time)
jwt-decode Decode JWT
md5 Computes the checksum
url-encode Encode url
url-decode Decode url
url-to-json Convert url to JSON
base64-encode Base64 encode
base64-decode Base64 decode
uuid Generate UUID v4 (default: 1)
count Get the characters length
camel-case Coverts string to camel case (fooBar)
kebab-case Coverts string to kebab case (foo-bar)
lower-case Coverts string to lower case (foo bar)
snake-case Coverts string to snake case (foo_bar)
start-case Coverts string to start case (Foo Bar)
upper-case Coverts string to upper case (FOO BAR)
text-escape Escape quotes and backslashes in text
text-unescape Unescape quotes and backslashes in text (pretty prints JSON)
format-json Cleans and format JSON

Library

package main

import (
	"fmt"

	"github.com/cloudingcity/gool/pkg/cases"
	"github.com/cloudingcity/gool/pkg/date"
	"github.com/cloudingcity/gool/pkg/text"
	"github.com/cloudingcity/gool/pkg/timestamp"
)

func main() {
	fmt.Println(cases.Snake("HelloWorld"))
	// hello_world

	fmt.Println(cases.Camel("hello world"))
	// helloWorld

	fmt.Println(date.ToTimestamp("2020-09-01"))
	// 1598918400 <nil>
	
	fmt.Println(timestamp.ToDate(1598918400))
	// 2020-09-01 08:00:00 +0800 CST

	fmt.Println(text.Escape(`{"key": "say "value""}`))
	// {\"key\": \"say \"value\"\"}

	fmt.Println(text.Unescape(`{\"key\": \"say \"value\"\"}`))
	// {"key": "say "value""}
}

Contributors


Clouding

πŸ’»

LeoZhan

πŸ’»

Toby Lam

πŸ’»

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis
internal
pkg
jwt
url

Jump to

Keyboard shortcuts

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