Nox is a Python CLI tool designed to automate and streamline various day-to-day tasks commonly performed by software engineers. It provides functionalities like JWT management, encryption/decryption, interaction with AWS S3, database operations, Docker management, and more.
- Features
- Usage
- JWT Management
- Encryption and Decryption
- S3 File Management
- Database Operations
- Docker Management
- Network Operations
- Secrets Management
- File and Directory Operations
- UUID Generation
- Hashing Utilities
- Environment Management
- Service Management
- Template Generation
- Time and Date Utilities
- Cloud Operations
- Plugins
- Contributing
- License
- JWT Management: Generate and verify JWT tokens for different environments.
- Encryption/Decryption: Encrypt and decrypt text or files using various algorithms.
- S3 File Management: List, upload, and remove files from AWS S3 buckets.
- Database Operations: Run queries and manage database migrations.
- Docker Management: Build and run Docker containers with ease.
- Network Operations: Perform network-related tasks like ping, traceroute, and DNS lookups.
- Secrets Management: Store and retrieve secrets securely.
- File and Directory Operations: Search for files, calculate directory sizes, and more.
- UUID Generation: Generate UUIDs for various purposes.
- Hashing Utilities: Hash text or files using algorithms like SHA-256, MD5, etc.
- Environment Management: Manage environment variables by setting, getting, and listing them.
- Service Management: Start, stop, and check the status of system services.
- Template Generation: Generate boilerplate code for projects or components.
- Time and Date Utilities: Work with dates and times, convert timezones, etc.
- Cloud Operations: Deploy and manage applications on cloud providers.
Nox provides a variety of commands. Here are some examples:
Generate a JWT for a specific environment:
nox jwt generate --env prod --key /path/to/key.pem --claims claims.jsonVerify a JWT token:
nox jwt verify --token your.jwt.token --key /path/to/public.pemEncrypt a file using Base64 encryption:
nox encrypt base64 --input /path/to/file --output /path/to/outputDecrypt a file:
nox decrypt base64 --input /path/to/encrypted_file --output /path/to/decrypted_fileList files in an S3 bucket:
nox s3 list --bucket my-bucket --region us-west-2Backup a PostgreSQL database:
nox db backup --db "postgresql://user:password@localhost:5432/mydb" --output /path/to/backup.sqlRestore a PostgreSQL database:
nox db restore --db "postgresql://user:password@localhost:5432/mydb" --input /path/to/backup.sqlClean up unused Docker containers, images, and volumes:
nox docker cleanTail logs for a Docker container:
nox docker logs --container container_namePing a host:
nox net ping --host google.comPerform a DNS lookup:
nox net dns --domain example.comEncrypt a secret:
nox secrets encrypt --secret "mysecret" --key /path/to/key.pemDecrypt a secret:
nox secrets decrypt --secret "encrypted_secret" --key /path/to/key.pemCompress a directory:
nox file compress --input /path/to/directory --output /path/to/output.zip --algorithm zipDecompress a file:
nox file decompress --input /path/to/file.zip --output /path/to/output_directoryGenerate a new UUID:
nox uuid generateHash a text using SHA-256:
nox hash --text "your text" --algorithm sha256Hash a file:
nox hash --file /path/to/file --algorithm sha256Set environment variables from a file:
nox env set --file /path/to/.envRetrieve the value of an environment variable:
nox env get --name ENV_VAR_NAMEStart a system service:
nox service start --name dockerCheck the status of a system service:
nox service status --name dockerCreate a new project template:
nox template create --type flask-app --name my_projectDisplay the current date and time in ISO format:
nox time now --format isoDeploy an application to a cloud provider:
nox cloud deploy --provider aws --config deploy_config.jsonCheck the status of a deployed application:
nox cloud status --provider aws --app my_appNox supports a plugin system that allows you to extend its functionality without modifying the core codebase.
To create a plugin, follow these steps:
- Create a new Python file in the
nox/plugins/directory. - Implement the
NoxPlugininterface.
# nox/plugins/my_plugin.py
import click
from nox.plugins import NoxPlugin
class MyPlugin(NoxPlugin):
def register_commands(self, cli):
@cli.command()
def my_command():
"""Command provided by MyPlugin."""
click.echo("This is a command from MyPlugin!")
plugin = MyPlugin()- Your plugin will be automatically discovered and loaded when you run Nox.
To load plugins distributed as separate packages, ensure they are installed in the same environment as Nox, and they will be discovered automatically.
Contributions are welcome! Please feel free to submit a Pull Request. Before contributing, please ensure you have read the Contributing Guidelines.
This project is licensed under the MIT License. See the LICENSE file for details.