Initial upload: Devtoolbelt v1.0.0 - unified CLI toolkit for developers
This commit is contained in:
183
README.md
183
README.md
@@ -1,3 +1,182 @@
|
|||||||
# devtoolbelt
|
# Devtoolbelt
|
||||||
|
|
||||||
A unified CLI toolkit for developers - database inspection, API testing, and utility functions
|
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
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Clone the repository
|
||||||
|
git clone https://7000pct.gitea.bloupla.net/7000pctAUTO/devtoolbelt.git
|
||||||
|
cd devtoolbelt
|
||||||
|
|
||||||
|
# Install the package
|
||||||
|
pip install -e .
|
||||||
|
```
|
||||||
|
|
||||||
|
### From PyPI
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pip install devtoolbelt
|
||||||
|
```
|
||||||
|
|
||||||
|
## Quick Start
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 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 queries
|
||||||
|
- `api` - API testing and requests
|
||||||
|
- `utils` - Common utility functions
|
||||||
|
|
||||||
|
## Database Commands
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 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
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 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
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 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
|
||||||
|
|
||||||
|
```bash
|
||||||
|
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
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
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.
|
||||||
|
|
||||||
|
1. Fork the repository
|
||||||
|
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
||||||
|
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
||||||
|
4. Push to the branch (`git push origin feature/amazing-feature`)
|
||||||
|
5. Open a Pull Request
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
||||||
|
|||||||
Reference in New Issue
Block a user