Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: PR Check

on:
pull_request:
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true

- name: Install dependencies
run: uv sync --group dev

- name: Run test suite
run: uv run pytest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ build/
.claude/settings.local.json
.claude/memory/
.claude/scheduled_tasks.json
.omx/
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ agent = create_code_agent(
```bash
# Run the agent (approvals enabled by default)
python -m deep_code_agent

# Show the installed CLI version
python -m deep_code_agent --version
```

When using the CLI, you'll be prompted for approval when the agent attempts to modify files or execute commands:
Expand Down
3 changes: 3 additions & 0 deletions src/deep_code_agent/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import argparse
from typing import TYPE_CHECKING, Any

from deep_code_agent import __version__

if TYPE_CHECKING:
from langchain_core.runnables import RunnableConfig

Expand Down Expand Up @@ -184,6 +186,7 @@ def _handle_interrupt(agent, interrupt_data, config: "RunnableConfig") -> dict[s

def main() -> None:
parser = argparse.ArgumentParser(prog="deep-code-agent", description="Deep Code Agent CLI")
parser.add_argument("--version", action="version", version=f"%(prog)s {__version__}")
parser.add_argument("--backend-type", choices=["state", "filesystem"], default="state", help="Backend type")
parser.add_argument("--model-name", default=None, help="Model name")
parser.add_argument("--model-provider", default="openai", help="Model provider")
Expand Down
19 changes: 19 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""Tests for CLI argument handling."""

from unittest.mock import patch

import pytest

from deep_code_agent import __version__
from deep_code_agent.cli import main


def test_main_prints_version_and_exits(capsys):
"""The CLI should expose the packaged version via --version."""
with patch("sys.argv", ["deep-code-agent", "--version"]):
with pytest.raises(SystemExit) as exc_info:
main()

assert exc_info.value.code == 0
captured = capsys.readouterr()
assert captured.out.strip() == f"deep-code-agent {__version__}"
Loading