Project overview This project implements a Python-based command terminal that mimics a real system terminal’s behavior with a clean CLI and a lightweight hosted web UI for demonstrations. It supports standard file and directory operations, robust error handling, and basic system monitoring, fulfilling the problem’s mandatory requirements and selected optional enhancements.
What it does Core terminal: Executes commands via a Python dispatcher with handlers for pwd, ls, cd, mkdir, rm, cat, echo, and touch, returning accurate outputs and clear errors for invalid usage.
System monitoring: Includes cpu, mem, and ps commands to inspect CPU usage, memory stats, and running processes, integrated into the same Python backend.
Optional enhancements: Command history and tab completion for a smooth CLI experience, plus a simple natural language helper (nl "…") that maps phrases like “create folder logs” to actual commands.
How it works Architecture: Input is parsed and routed through a command dispatcher to Python handlers that perform filesystem and monitoring actions, then format output or errors consistently. This ensures extensibility and correctness without relying on external shells.
Interfaces:
CLI: A polished prompt loop (with graceful fallback for IDEs without a Windows console) provides local interaction for development and testing.
Hosted web UI: A minimal FastAPI application exposes a browser page and a POST /run endpoint to execute one command per request, enabling a live demo URL as required. https://codemate-python-terminal-1.onrender.com/
Why these choices Completeness in 24 hours: A Python-only backend with direct handlers offers a tight MVP that is easy to test and extend, avoiding complex external integrations while meeting all mandatory items.
Reliability: The CLI includes robust error messages and usage hints; the web layer reuses the same executor logic to keep behavior identical across local and hosted environments.
Hosting details Backend: Served with FastAPI and Uvicorn, binding to 0.0.0.0 and the platform-provided PORT; no custom environment variables are required. This provides a public URL for the demo and submission.
Frontend: A simple HTML page calls the backend’s /run endpoint to display outputs in the browser; alternatively, the API can be used directly with JSON requests.
Compliance with guidelines Tools: Built using the specified AI tooling workflow (CodeMate Build and Extension usage demonstrated in development notes and demo), as required by the event.