Skip to content

CLI-004: Container List, Shell, and Logs Commands

This Reference preserves the recorded requirement contract. The front matter states its lifecycle status; this editorial notice does not change that status. An ACTIVE contract is not a historical implementation or qualification result. The statement, rationale, identifiers, and traceability below keep their recorded meaning. The original file is available at source revision 6d35d245f11a.

Statement

The CLI shall provide aptl container list, aptl container shell, and aptl container logs commands for inspecting and interacting with running lab containers.

Rationale

Users need to inspect container state and access shells without manually constructing Docker commands.

Traceability

  • IMPLEMENTS → CODE_FILE src/aptl/cli/container.py (aptl container list/shell/logs commands)
  • IMPLEMENTS → CODE_FILE src/aptl/cli/_common.py (resolve_config_for_cli helper)
  • IMPLEMENTS → CODE_FILE src/aptl/core/deployment/backend.py (DeploymentBackend Protocol with container interaction methods)
  • IMPLEMENTS → CODE_FILE src/aptl/core/deployment/docker_compose.py (DockerComposeBackend container_list/shell/logs implementation)
  • IMPLEMENTS → CODE_FILE src/aptl/core/deployment/ssh_compose.py (SSHComposeBackend env injection for streaming + captured paths)
  • IMPLEMENTS → CODE_FILE src/aptl/core/deployment/errors.py (BackendTimeoutError)
  • IMPLEMENTS → ADR docs/adrs/adr-023-container-interaction-in-deployment-backend.md (ADR-023: Container interaction on the DeploymentBackend Protocol)
  • TESTS → TEST tests/test_cli_container.py (CLI container list/shell/logs tests)
  • TESTS → TEST tests/test_deployment_backend.py (DeploymentBackend Protocol tests (container + host inventory))
  • IMPLEMENTS → GITHUB_ISSUE 138 (Issue 138: implement stubbed CLI commands)