812fedbd903aa0a53a075113ed74fa4c06fb0bb9
Some checks failed
CI / test (3.10) (push) Has been cancelled
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / test (3.8) (push) Has been cancelled
CI / test (3.9) (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / typecheck (push) Has been cancelled
CI / build-package (push) Has been cancelled
Devterm
A CLI tool that spawns a local web server providing browser-based developer utilities. Features a TUI menu for tool selection, hot-reload support, and a modern web interface built with HTMX.
Features
- TUI Menu: Interactive terminal menu using Rich for beautiful CLI interactions
- Browser Interface: Clean, modern UI with HTMX for dynamic content
- Hot Reload: Uvicorn reload for development - changes reflect instantly
- Local Processing: All data processed locally, no external API calls
- Multiple Tools: Essential developer utilities in one place
Available Tools
- JSON Formatter - Format, validate, and prettify JSON data
- JWT Decoder - Decode and inspect JWT tokens header and payload
- Cron Validator - Validate cron expressions and calculate next run times
- Base64 Tool - Encode and decode Base64 strings
- URL Encoder - Encode and decode URL components
Installation
From PyPI
pip install devterm
From Source
git clone https://7000pct.gitea.bloupla.net/7000pctAUTO/devterm.git
cd devterm
pip install -e .
Using pipx (Recommended for CLI Tools)
pipx install devterm
Usage
Basic Usage
Start the Devterm server with default settings:
devterm
This will:
- Display a TUI menu with available tools
- Automatically open your browser to
http://127.0.0.1:8000 - Start the server with hot-reload enabled
Custom Configuration
Set custom host and port using environment variables:
DEVTERM_HOST=0.0.0.0 DEVTERM_PORT=8080 devterm
Or via command-line arguments (if supported):
devterm --host 0.0.0.0 --port 8080
Configuration
Environment Variables
| Variable | Default | Description |
|---|---|---|
DEVTERM_HOST |
127.0.0.1 |
Server host address |
DEVTERM_PORT |
8000 |
Server port |
DEVTERM_DEBUG |
false |
Enable debug mode |
Programmatic Usage
from devterm.main import main
# Start the server programmatically
main(host="127.0.0.1", port=8000)
Architecture
devterm/
├── __init__.py # Package initialization
├── main.py # Entry point
├── config.py # Configuration management
├── server/
│ ├── app.py # FastAPI application
│ └── routes.py # API routes
├── tools/
│ ├── json_tool.py # JSON formatting tool
│ ├── jwt_tool.py # JWT decoder tool
│ ├── cron_tool.py # Cron validator tool
│ ├── base64_tool.py # Base64 encoder/decoder
│ └── url_tool.py # URL encoder/decoder
├── templates/ # HTML templates
├── tui/
│ └── menu.py # TUI menu implementation
└── tests/ # Test suite
Development
Setup
git clone https://7000pct.gitea.bloupla.net/7000pctAUTO/devterm.git
cd devterm
pip install -e ".[dev]"
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=devterm --cov-report=html
# Run specific test categories
pytest tests/unit/ # Unit tests
pytest tests/integration/ # Integration tests
Linting
# Check code style
ruff check .
# Auto-fix issues
ruff check --fix .
Type Checking
mypy devterm/
Running Locally
# Start development server with hot reload
devterm
# Or run directly with uvicorn
uvicorn devterm.server.app:app --reload --host 127.0.0.1 --port 8000
Tech Stack
- FastAPI - Modern Python web framework
- Uvicorn - ASGI server implementation
- Rich - Rich text and beautiful formatting in terminal
- Jinja2 - Template engine
- HTMX - Dynamic HTML content
- PyJWT - JWT handling
- Pycron - Cron expression parsing
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests and linting
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Changelog
See CHANGELOG.md for a list of changes.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- 📧 Email: support@devterm.dev
- 🐛 Issues: Gitea Issues
- 💬 Discussions: Gitea Discussions