7000pctAUTO 2188390a3e
Some checks failed
CI / test (3.10) (push) Failing after 12s
CI / test (3.11) (push) Failing after 21s
CI / test (3.12) (push) Failing after 25s
CI / test (3.8) (push) Failing after 30s
CI / lint (push) Has been cancelled
CI / typecheck (push) Has been cancelled
CI / build-package (push) Has been cancelled
CI / test (3.9) (push) Has been cancelled
Add devterm tools and TUI menu
2026-01-29 11:11:43 +00:00
2026-01-29 11:11:43 +00:00
2026-01-29 11:09:46 +00:00

Devterm

Python Version License Version

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 .
pipx install devterm

Usage

Basic Usage

Start the Devterm server with default settings:

devterm

This will:

  1. Display a TUI menu with available tools
  2. Automatically open your browser to http://127.0.0.1:8000
  3. 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

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests and linting
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. 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

Description
A CLI tool that spawns a local web server providing browser-based developer utilities with TUI menu and hot-reload support
Readme MIT 66 KiB
v0.1.0 Latest
2026-01-29 11:14:03 +00:00
Languages
HTML 54.8%
Python 45.2%