d1eacea4976e09a56fb95b7bde6682b3ba745b6e
Devtoolbelt
A unified CLI toolkit for developers that combines database inspection, API testing, and common utility functions in a single terminal-based tool with colorized output.
Features
- Database Commands: List tables, view schemas, execute queries for PostgreSQL, MySQL, SQLite, and MSSQL
- API Testing: GET/POST requests, endpoint testing, benchmarking with colored output
- Utility Functions: Timestamp conversion, hash generation, UUIDs, base64, URL encoding, JWT decoding, cron parsing, password generation
- Interactive Mode: Shell-like interface for quick access to all commands
- Configuration: YAML-based config for databases and API endpoints
Installation
From Source
# Clone the repository
git clone https://7000pct.gitea.bloupla.net/7000pctAUTO/devtoolbelt.git
cd devtoolbelt
# Install the package
pip install -e .
From PyPI
pip install devtoolbelt
Quick Start
# Show help
devtoolbelt --help
# Start interactive mode
devtoolbelt interactive
# Show version
devtoolbelt version
Commands Overview
Devtoolbelt provides three main command groups:
db- Database inspection and queriesapi- API testing and requestsutils- Common utility functions
Database Commands
# List configured databases
devtoolbelt db list
# Connect to a database
devtoolbelt db connect mydb
# List tables with verbose output
devtoolbelt db tables mydb --verbose
# View table schema
devtoolbelt db schema mydb users
# Execute queries
devtoolbelt db query mydb "SELECT * FROM users LIMIT 10"
devtoolbelt db query mydb "SELECT * FROM users" --format json --limit 50
# Add database configuration
devtoolbelt db add mydb \
--type postgresql \
--host localhost \
--port 5432 \
--database myapp \
--user myuser \
--password mypassword
API Testing Commands
# List configured endpoints
devtoolbelt api list
# Make GET requests
devtoolbelt api get https://api.example.com/users
devtoolbelt api get users --headers "Authorization: Bearer token123"
# Make POST requests
devtoolbelt api post https://api.example.com/users \
--data '{"name": "John", "email": "john@example.com"}'
# Test endpoints
devtoolbelt api test https://api.example.com/health --expect-status 200
# Benchmark endpoints
devtoolbelt api benchmark https://api.example.com/users \
--requests 100 \
--concurrency 5
Utility Commands
# Timestamp operations
devtoolbelt utils timestamp
devtoolbelt utils timestamp --utc
# Hash generation
devtoolbelt utils hash "hello world"
devtoolbelt utils hash "hello world" --algorithm sha256
# UUID generation
devtoolbelt utils uuid
devtoolbelt utils uuid --count 5
# Base64 encoding/decoding
devtoolbelt utils base64 "hello world"
devtoolbelt utils base64 "aGVsbG8gd29ybGQ=" --decode
# JWT decoding
devtoolbelt utils jwt "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
# Password generation
devtoolbelt utils password
devtoolbelt utils password --length 24 --no-special
Interactive Mode
devtoolbelt interactive
# Example session:
[devtoolbelt] db list
[devtoolbelt] uuid
[devtoolbelt] hash mypassword
[devtoolbelt] exit
Configuration
Devtoolbelt uses a YAML configuration file (.devtoolbelt.yml) for storing database and API configurations.
Default Location
- Linux/macOS:
~/.config/devtoolbelt/.devtoolbelt.yml - Windows:
%APPDATA%\devtoolbelt\.devtoolbelt.yml
Example Configuration
databases:
myapp:
type: postgresql
host: localhost
port: 5432
database: myapp
user: myuser
password: mypassword
api_endpoints:
users: https://api.example.com/users
auth: https://api.example.com/auth
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Releases
1
Devtoolbelt v1.0.0
Latest
Languages
Python
100%