Skip to content

sandrolain/sdt

Repository files navigation

sdt

CI Security Go Report Card License

Smart Developer Tools - A collection of powerful CLI utilities for developers

⚠️ Work in Progress: Use at your own risk! This project is under active development.

Features

  • Developer-Friendly - Intuitive CLI interface with comprehensive help
  • Pipe Support - Seamless integration with Unix pipes and standard I/O
  • Wide Range - 50+ commands for encoding, hashing, JWT, time, and more
  • Web Interface - WASM-based web application for browser usage
  • Cross-Platform - Works on Linux, macOS, and Windows
  • Zero Dependencies - Single binary with no runtime dependencies
  • Fast & Lightweight - Built with Go for maximum performance

Quick Start

Installation

Using Go Install (Recommended)

go install github.com/sandrolain/sdt/cli@latest

Build from Source

# Clone the repository
git clone https://github.com/sandrolain/sdt
cd sdt

# Build and install using Task
task build

# Or build manually
go build -o bin/sdt ./cli

Pre-built Binaries

Download the latest release from the releases page.

Quick Example

# Encode a string to base64
echo "Hello, World!" | sdt b64

# Generate a UUID
sdt uid v4

# Hash a string with SHA-256
echo "password" | sdt sha256

# Generate a JWT token
sdt jwt generate --secret mysecret --payload '{"user":"john"}'

Usage

The CLI commands receive input data from:

  • Standard Input (stdin) - via pipes or redirects
  • Command arguments - without flags
  • File input - using the --input flag

Output is sent to Standard Output (stdout), making it easy to chain commands.

If an error occurs, the command exits with code 1.

Documentation

Command Categories

Encoding & Decoding

Command Description
b32 / b32 dec Base32 encode/decode
b64 / b64 dec Base64 encode/decode
b64url / b64url dec Base64 URL-safe encode/decode
hex / hex dec Hexadecimal encode/decode
url enc / url dec URL encode/decode
html encode / html decode HTML entity encode/decode

Hashing & Cryptography

Command Description
md5 MD5 hash
sha1 SHA-1 hash
sha256 SHA-256 hash
sha384 SHA-384 hash
sha512 SHA-512 hash
bcrypt / bcrypt verify Bcrypt hash and verification

JWT & Tokens

Command Description
jwt parse Parse JWT token
jwt claims Extract JWT claims
jwt valid Validate JWT token

UUID & IDs

Command Description
uid v4 Generate UUID v4
uid nano Generate Nano ID
uid ks Generate KSUID

Time & Date

Command Description
time unix Unix timestamp
time iso ISO 8601 timestamp
time http HTTP date format

String Operations

Command Description
string uppercase Convert to UPPERCASE
string lowercase Convert to lowercase
string titlecase Convert to Title Case
string count Count characters/words/lines
string escape Escape special characters

JSON Operations

Command Description
json pretty Pretty-print JSON
json minify Minify JSON
json valid Validate JSON

Compression

Command Description
gzip Compress with gzip
gunzip Decompress gzip

Network & Utilities

Command Description
http Make HTTP requests
ipinfo Get IP information
nslookup DNS lookup
qrcode Generate QR code
totp TOTP operations

See the complete documentation for all commands and options.

Common Use Cases

Working with JWT Tokens

# Parse a JWT token
echo "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." | sdt jwt parse

# Validate a JWT token
echo "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." | sdt jwt valid --secret mysecret

# Extract claims from JWT
echo "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." | sdt jwt claims

Data Encoding Chains

# Encode to base64, then URL encode
echo "Hello, World!" | sdt b64 | sdt url enc

# Hash with SHA-256 and encode as hex
echo "password" | sdt sha256 | sdt hex

JSON Processing

# Validate and pretty-print JSON
cat data.json | sdt json valid && cat data.json | sdt json pretty

# Minify JSON for transmission
cat large-config.json | sdt json minify > config.min.json

Password & Security

# Generate a secure password
sdt password --length 32 --symbols

# Hash a password with bcrypt
echo "mypassword" | sdt bcrypt

# Verify bcrypt password
echo "mypassword" | sdt bcrypt verify '$2a$10$...'

TOTP Authentication

# Generate TOTP URI for QR code
sdt totp uri --issuer MyApp --account user@example.com

# Generate TOTP code
sdt totp code --secret JBSWY3DPEHPK3PXP

# Verify TOTP code
sdt totp verify --secret JBSWY3DPEHPK3PXP --code 123456

Web Interface

SDT includes a WASM-based web interface that runs entirely in your browser. No server needed!

Running the Web Interface Locally

# Build the web interface
task build:web

# Serve it locally
task serve:web
# Or use Docker
docker run -p 3000:3000 sandrolain/sdt:latest

The web interface provides:

  • All CLI commands in a user-friendly interface
  • File upload support
  • Clipboard integration
  • No data sent to any server (100% client-side)

Development

Prerequisites

  • Go 1.22 or later
  • Task (recommended) or standard Go tools
  • Docker (optional, for containerization)

Building

# Build the CLI binary
task build

# Build with compression
task build:compress

# Build WASM version
task wasm:build

# Build web interface
task build:web

Testing

# Run all tests
task test

# Run tests with coverage
task test:coverage

# Run benchmarks
task test:bench

# Run all checks (fmt, lint, vet, test, security)
task check

Code Quality

# Format code
task fmt

# Run linter
task lint

# Run go vet
task vet

# Run security scan
task gosec

# Run vulnerability scan
task trivy

Docker

Using Pre-built Image

# Pull the image
docker pull sandrolain/sdt:latest

# Run the web interface
docker run -p 3000:3000 sandrolain/sdt:latest

Building Docker Image

# Build for current platform
task docker:build

# Build multi-arch image
task docker:build:multi

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes with tests
  4. Run quality checks (task check)
  5. Commit your changes following Conventional Commits
  6. Push to your branch
  7. Open a Pull Request

See CONTRIBUTING.md for detailed guidelines.

Roadmap

See the Wishlist section below for planned features and improvements.

Wishlist

DevOps Wishlist

  • Unit Tests!!!
  • Use UPX

Features Wishlist

  • Color conversion
  • JQ integration
  • Template with mustache
  • Data faker
  • File change watcher with command execution
  • Interval watcher with command execution
  • RegExp all matches
  • RegExp replace
  • Data conversion between:
  • Save []string to multiple files
  • Static file server
  • WASM web app:
    • Commands without sdt
    • Button for quick help
    • Commands selection
      • Various types of conversion
      • Bytes b64
      • Bytes hex
    • Input from textarea
    • Input from file
    • Flag for inputs as B64
    • Output to textarea
    • Output to file
  • GUI app:
    • Commands selection
    • Input from textarea
    • Input from file
    • Output to textarea
    • Output to file
  • Docker images
    • WASM webapp
    • CLI as Docker image ???
  • HTTP service
    • commands as http APIs
  • Edit config file
  • Request input from CLI
  • Global --input (file) flag
  • Base 32 encode/decode
  • HTTP request
  • RegEx match
  • Lorem Ipsum
  • QR code generation
  • TOTP
  • CSV to JSON
  • Backslash escape/unsescape
  • String case converter
  • JSON validator
  • Read / Write File
  • JSON minify
  • JSON prettify
  • Bcrypt hash
  • Bcrypt check
  • Hash SHA-384
  • Hash SHA-256
  • Hash sha1
  • Random Bytes
  • UUID v4
  • Base 64 encode/decode
  • URL encode / decode
  • Time unix
  • Time ISO
  • Time UTC
  • JWT validate
  • JWT claims
  • Gzip / Gunzip
  • My IP (https://ipapi.co/)
  • IP Lookup (https://ipapi.co/)
  • NS lookup
  • QR code reader
  • Base 36
  • HMAC generator
  • Validator
    • JSON
    • YAML
    • TOML
    • CSV
  • String
    • Character count
    • Word count
    • Line count
    • UPPER CASE
    • lower case
    • camelCase
    • Capital Case
    • CONSTANT_CASE (Upper case + Replace spaces with character)
    • dot.case (Replace spaces with character)
    • Header-Case (Capital case + Replace spaces with character)
    • param-case (Replace spaces with character)
    • snake_case (Replace spaces with character)
    • Slug generator
    • html encode, html decode
    • Sort Lines (reverse, shuffle) (by content, by length)

External Libraries Used

License

MIT License

Copyright (c) 2025 Sandro Lain

Support


Made with ❤️ by Sandro Lain

About

Smart Developer Tools

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors