Skip to content

danekja/toolitka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toolitka

A versatile command-line toolkit written in Go that provides utilities for whatever I occasionally need.

Features

JWT Token Decoder

Decode JWT tokens without signature verification and display claims in a formatted JSON output.

X.509 Certificate Parser

Parse and display X.509 certificate information including subject, issuer, serial number, validity period, and DNS names. Supports both PEM-formatted certificates and raw certificate data.

OIDC Client

OAuth 2.0 client credentials flow implementation with automatic token refresh and caching. Supports custom scopes and token endpoint configuration.

Maven Artifact Migrator

Migrate Maven artifacts between repositories with support for:

  • Version filtering (min/max range)
  • Multiple artifact types (JAR, POM, sources, javadoc)
  • Dry-run mode for preview
  • Authentication for both source and target repositories
  • Batch migration of all versions

Installation

Prerequisites

  • Go 1.23.0 or later
  • Make (optional, for building)

Build from Source

# Clone the repository
git clone <repository-url>
cd toolitka

# Build for current platform
go build -o toolitka *.go

# Or use Make to build for both Linux and Windows
make build

The Makefile builds binaries for:

  • Linux (AMD64): out/toolitka
  • Windows (AMD64): out/toolitka.exe

Deploy to System

make deploy

This copies the built binaries to:

  • WSL/Linux: ~/.local/bin/toolitka
  • Windows: C:\Users\<username>\AppData\Local\MyApps\toolitka.exe

Usage

JWT Token Decoder

toolitka -jwtdecode <token>

Example:

toolitka -jwtdecode eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

X.509 Certificate Parser

toolitka -x509 <certificate-pem>

Example:

toolitka -x509 "-----BEGIN CERTIFICATE-----
MIIDXTCCAkWgAwIBAgIJAKZ...
-----END CERTIFICATE-----"

Or with raw certificate data (PEM headers will be added automatically):

toolitka -x509 "MIIDXTCCAkWgAwIBAgIJAKZ..."

OIDC Client

toolitka -oidc -clientid <id> -secret <secret> -tokenUrl <url> [-scopes <scopes>] [-nodecode]

Parameters:

  • -clientid: OAuth client ID (required)
  • -secret: OAuth client secret (required)
  • -tokenUrl: Token endpoint URL (required)
  • -scopes: Comma-separated list of scopes (optional)
  • -nodecode: Skip JWT decoding and return raw token (optional)

Example:

toolitka -oidc \
  -clientid my-client \
  -secret my-secret \
  -tokenUrl https://idp.example.com/oauth/token \
  -scopes "read,write"

Maven Artifact Migrator

toolitka -maven \
  -sourceUrl <url> \
  -groupId <groupId> \
  -artifactId <artifactId> \
  [-sourceUser <username>] \
  [-sourcePassword <password>] \
  [-targetUrl <url>] \
  [-targetUser <username>] \
  [-targetPassword <password>] \
  [-versionMin <version>] \
  [-versionMax <version>] \
  [-dryrun]

Parameters:

  • -sourceUrl: Source Maven repository URL (required)
  • -groupId: Maven artifact groupId (required)
  • -artifactId: Maven artifact artifactId (required)
  • -sourceUser: Source repository username (optional)
  • -sourcePassword: Source repository password (optional)
  • -targetUrl: Target Maven repository URL (required unless -dryrun)
  • -targetUser: Target repository username (optional)
  • -targetPassword: Target repository password (optional)
  • -versionMin: Minimum version to migrate, inclusive (optional)
  • -versionMax: Maximum version to migrate, inclusive (optional)
  • -dryrun: Preview artifacts without downloading/uploading (optional)

Example - Dry Run:

toolitka -maven \
  -sourceUrl https://repo1.maven.org/maven2 \
  -groupId org.apache.commons \
  -artifactId commons-lang3 \
  -dryrun

Example - Full Migration:

toolitka -maven \
  -sourceUrl https://source-repo.example.com/maven2 \
  -sourceUser myuser \
  -sourcePassword mypass \
  -targetUrl https://target-repo.example.com/maven2 \
  -targetUser admin \
  -targetPassword admin123 \
  -groupId com.example \
  -artifactId my-library \
  -versionMin 1.0.0 \
  -versionMax 2.0.0

Migrated Artifacts: For each version, the tool attempts to migrate:

  • Main JAR file (optional)
  • POM file (required)
  • Sources JAR (optional)
  • Javadoc JAR (optional)

Dependencies

License

This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

About

Tiny little helpers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors