feat: Implement Command Line Interface (CLI) for Backend Operations
Description
Overview
This Merge Request introduces a production-ready Command Line Interface (CLI) for the ASR Transcription Backend. The CLI provides a native terminal-based interface to interact with the backend system, enabling developers and administrators to manage application lifecycle, execute transcription jobs, and inspect system configurations without relying on HTTP requests or external scripts.
The CLI is fully integrated with the existing backend architecture and reuses the same service layer and business logic used by the FastAPI application.
Key Features
-
Zero Duplication The CLI directly integrates with existing core components such as
job_manager, models, and configuration modules. It reuses the same business logic as the API layer without duplication. -
No API Changes All existing REST API endpoints, validations, authentication, and routing logic remain unchanged and fully backward compatible.
-
Modular CLI Architecture Built using a structured
argparse-based command router with separated modules for:-
app(application control) -
jobs(transcription job management) -
admin(system configuration and insights)
-
-
Interactive Mode Supports an interactive REPL shell (
python -m cli.main interactive) for continuous command execution in a single session. -
Native Job Execution CLI commands such as
jobs createexecute the full transcription pipeline locally and return structured JSON responses directly in the terminal. -
Code Quality & Standards The implementation follows project standards and passes:
-
rufflinting -
mypytype checking -
pytesttest suite (90%+ coverage)
-
Module Breakdown
1. Application Control (app)
Manages backend server lifecycle and health monitoring:
-
start– Start backend server -
stop– Stop running server -
status– View system status -
health– Quick health check
2. Job Management (jobs)
Handles transcription job operations using the existing job_manager service:
-
create– Create transcription job -
list– List all jobs -
get– Retrieve job details and results -
delete– Remove a job
3. Administration (admin)
Provides system-level insights and configuration access:
-
config– View system configuration -
models– List available ASR models -
languages– View supported languages
Documentation Updates
- Updated
README.mdwith a new Command Line Interface (CLI) section. - Added setup instructions, command reference, and troubleshooting guide.
- Included usage examples for all major CLI modules.
Testing Performed
- Verified CLI argument parsing and help system (
--help) - Validated job lifecycle execution (
create → list → get → delete) - Tested server lifecycle commands via CLI (
start,stop,health) - Confirmed compatibility with existing
pytesttest suite - Ensured environment parity with API behavior
Checklist
-
Implemented modular CLI architecture -
Reused existing backend services (no duplication) -
Maintained full API backward compatibility -
Passed linting and type checks ( ruff,mypy) -
Verified test suite execution ( pytest) -
Updated project documentation
*Closes #32

