Skip to content

breakingthebot/Dev-toolkit

Repository files navigation

Dev Toolkit

A Click-based Python CLI for common developer utilities.

Stack

  • Python 3.12
  • Click
  • pytest
  • No database

Setup

py -m venv venv
venv\Scripts\activate
python -m pip install --upgrade pip
pip install -e ".[dev]"

Environment Variables

No environment variables are required. Optional defaults can be set for repeated local use:

  • DEV_TOOLKIT_PASSWORD_LENGTH: default password length, from 8 to 128.
  • DEV_TOOLKIT_JSON_INDENT: default JSON format indentation, from 0 to 8.

See .env.example for the template used by this project.

Running Locally

dev-toolkit --version
dev-toolkit uuid
dev-toolkit password --length 24
dev-toolkit base64 encode "hello"
dev-toolkit base64 decode "aGVsbG8="
dev-toolkit base64 encode --clipboard-input
dev-toolkit base64 encode "hello" --clipboard-output
dev-toolkit base64 encode --input-file plain.txt --output-file encoded.txt
dev-toolkit base64 decode --input-file encoded.txt --output-file plain.txt
dev-toolkit file size README.md
dev-toolkit file size --human README.md
dev-toolkit file lines README.md
dev-toolkit file stats README.md
dev-toolkit hash text sha256 "hello"
dev-toolkit hash file sha512 plain.txt
dev-toolkit hash verify sha256 "<expected-digest>" plain.txt
dev-toolkit json format '{\"b\":2,\"a\":1}'
dev-toolkit json format --clipboard-input
dev-toolkit json minify '{ \"b\": 2, \"a\": 1 }' --clipboard-output
dev-toolkit json minify '{ \"b\": 2, \"a\": 1 }'
dev-toolkit json validate --input-file data.json
dev-toolkit system info
dev-toolkit system cwd
dev-toolkit system python
dev-toolkit system env PATH
dev-toolkit timestamp 1718064000
dev-toolkit timestamp --to-unix "2024-06-11T00:00:00+00:00"
dev-toolkit timestamp --to-unix --milliseconds "2001-09-09T01:46:40Z"
dev-toolkit url encode "hello world"
dev-toolkit url encode --component "hello world"
dev-toolkit url decode "hello+world"

Optional environment defaults are used only when the matching command flag is omitted:

$env:DEV_TOOLKIT_PASSWORD_LENGTH = "32"
dev-toolkit password

$env:DEV_TOOLKIT_JSON_INDENT = "4"
dev-toolkit json format '{\"a\":{\"b\":1}}'

Shell Completion

Shell completion is available through Click for PowerShell, Bash, and Zsh.

See docs/SHELL_COMPLETION.md for setup commands.

Help Examples

Every major command group includes examples in its help output:

dev-toolkit --help
dev-toolkit base64 --help
dev-toolkit file --help
dev-toolkit hash --help
dev-toolkit json --help
dev-toolkit system --help
dev-toolkit timestamp --help
dev-toolkit url --help

Testing

venv\Scripts\python.exe -m pytest

If an older local .pytest-tmp/ folder exists from a previous run, it is ignored by Git and is no longer used by the test suite.

Release Check

Build the source distribution and wheel before tagging a release:

venv\Scripts\python.exe -m build

The generated artifacts are written to dist/, which is intentionally ignored by Git.

Deployed

Not deployed. This is a local command-line tool.

Architecture Notes

This is a small terminal toolkit that groups common developer utilities behind predictable commands while keeping each utility isolated in its own module so it is easy to test and extend. The Click layer in src/dev_toolkit/cli.py handles command parsing, file option handling, shell-completion-compatible command metadata, practical help examples, environment-backed defaults, and user-facing errors. The actual work lives in service modules under src/dev_toolkit/services/, while validated default configuration lives under src/dev_toolkit/config/.

Notes

  • The CLI entry point is dev-toolkit.
  • CI runs both the test suite and Python package build check.
  • Password generation uses Python's secrets module.
  • Password length can default from DEV_TOOLKIT_PASSWORD_LENGTH.
  • Base64 commands accept direct text or file input with optional file output.
  • Base64 commands support clipboard input and output for text workflows.
  • File commands inspect byte size, human-readable size, line count, and text statistics.
  • Hash commands support SHA-256 and SHA-512 for direct text, files, and checksum verification.
  • JSON commands support formatting, minification, validation, file input, and file output.
  • JSON commands support clipboard input and output for text workflows.
  • JSON indentation can default from DEV_TOOLKIT_JSON_INDENT.
  • System commands show current directory, platform, Python, and selected environment diagnostics.
  • Timestamp conversion accepts Unix timestamps in seconds or milliseconds, returns UTC ISO 8601 output, and can convert ISO 8601 datetimes back to Unix seconds or milliseconds.
  • URL commands support query-style encoding, component percent encoding, decoding, file IO, and clipboard IO.
  • Shell completion setup is documented for PowerShell, Bash, and Zsh.

About

Click-based Python CLI bundling UUID/password generation, base64, hashing, JSON formatting, timestamp conversion, URL encoding, and file/clipboard I/O across all commands.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages