Skip to content

feat: dev/migrate CLI commands and LOG_CONSOLE env vars - #40

Merged
AhmadHammad21 merged 2 commits into
mainfrom
feat/cli-and-logging-improvements
May 18, 2026
Merged

AhmadHammad21 merged 2 commits into
mainfrom
feat/cli-and-logging-improvements

Conversation

@AhmadHammad21

@AhmadHammad21 AhmadHammad21 commented May 18, 2026 •

Copy link
Copy Markdown
Owner

Closes #35
Closes #36

Changes

Issue #35 — Better CLI commands

  • uv run dev / devops-agent dev — starts uvicorn with --reload for local development
  • uv run migrate / devops-agent migrate — applies all migrations/*.sql files in order against the configured Postgres DB; prints ✓/✗ per file and exits non-zero on failure
  • pyproject.toml: added testpaths = ["tests"] to [tool.pytest.ini_options]

Issue #36 — LOG_LEVEL env vars

  • LOG_CONSOLE_ENABLED (default true) — set to false to silence all console output; useful when logging to a file or external collector
  • LOG_CONSOLE_COLORIZE (default true) — set to false to strip ANSI colour codes; useful for CI pipelines and Docker log drivers that don't handle colour
  • Both wired through appsettings.py → _setup_logging() in cli/main.py
  • Documented in .env.example

Usage

# Development server with hot reload
uv run dev

# Apply all SQL migrations (postgres backend only)
uv run migrate

# Control log output
LOG_CONSOLE_COLORIZE=false uv run dev   # plain text logs
LOG_CONSOLE_ENABLED=false uv run dev    # silent (redirect to file etc.)

Test plan

  • uv run dev starts server with reload, URL printed to console
  • uv run migrate with postgres DSN applies all 11 migrations and prints ✓ per file
  • uv run migrate without postgres config prints clear error and exits 1
  • LOG_CONSOLE_COLORIZE=false produces plain text log output
  • LOG_CONSOLE_ENABLED=false produces no console output

Closes #35, closes #36

- uv run dev: starts uvicorn with reload=True for local development
- uv run migrate: applies all migrations/*.sql files in order against
  the configured PostgreSQL database (requires CHECKPOINT_BACKEND=postgres)
- Both also registered as devops-agent dev / devops-agent migrate subcommands
- LOG_CONSOLE_ENABLED: set false to suppress all console output (e.g. production)
- LOG_CONSOLE_COLORIZE: set false to strip ANSI colour codes (CI / Docker logs)
- pyproject.toml: add testpaths = ["tests"] to pytest config
- .env.example: document the three new log env vars
@AhmadHammad21
AhmadHammad21 merged commit d27b84e into main May 18, 2026
2 checks passed
@AhmadHammad21
AhmadHammad21 deleted the feat/cli-and-logging-improvements branch May 18, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

enhancement: Add LOG_LEVEL env Add better cli commands

1 participant