goats_cli/¶
This package implements the command-line interface (CLI) for GOATS. It enables users to install and run the GOATS application without needing to manually configure Django, Redis, or background workers.
The CLI is built with Click and exposed via the goats command, defined in pyproject.toml under [project.scripts].
Main Responsibilities¶
Scaffold a new GOATS project (via
django-admin startproject).Apply project-specific settings using TOMToolkit integration.
Configure and launch the following components:
Redis server
Django development server
Background workers via Dramatiq
Validate port bindings, environment state, and Redis availability.
Open GOATS in the browser automatically after startup.
Support for non-interactive CI installs.
Files¶
cli.pyEntry point for the CLI. Defines top-level commands likeinstallandrun. UsesClickdecorators and option validation. Handles startup, process management, and error reporting.config.pyCentralized configuration (e.g., default Redis address, regex patterns).exceptions.pyDefinesGOATSClickException, used for CLI-specific error handling.modify_settings.pyDynamically modifies Djangosettings.pyduring install to register GOATS and TOMToolkit apps.plugins.pyProvides a framework for CLI plugin discovery and registration when modifying settings.process_manager.pyStarts and supervises subprocesses (Redis, Django, Dramatiq workers). Gracefully stops all processes on exit or interruption.utils.pyShared helper functions for messaging, port checks, browser launching, and CLI output formatting.