From 7130f3f5ed154f4fe59c51647f49359fa003ee5a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 27 Sep 2025 20:40:45 +0000 Subject: [PATCH 1/3] Initial plan From 8124f1e9fca21ac0d2687088c1ff2f211d1b9a2b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 27 Sep 2025 20:50:32 +0000 Subject: [PATCH 2/3] Fix Windows CLI import issue by adding compatibility module Co-authored-by: JPrier <24302717+JPrier@users.noreply.github.com> --- cli.py | 21 +++++++++++++++++++++ src/treeagent/__main__.py | 7 +++++++ 2 files changed, 28 insertions(+) create mode 100644 cli.py create mode 100644 src/treeagent/__main__.py diff --git a/cli.py b/cli.py new file mode 100644 index 0000000..ff0a22f --- /dev/null +++ b/cli.py @@ -0,0 +1,21 @@ +"""CLI entry point compatibility module. + +This module provides compatibility for Windows installations where +entry points might resolve differently. It imports and re-exports +the main function from the actual CLI module. + +This addresses the issue where Windows pip installations generate entry scripts +that import 'cli' instead of 'src.cli', causing ModuleNotFoundError. +""" + +try: + # Try to import from the src package structure (development/editable install) + from src.cli import main +except ImportError: + # Fallback for potential different package structures + try: + from .cli import main + except ImportError: + raise ImportError("Could not import CLI main function from either src.cli or .cli") + +__all__ = ['main'] \ No newline at end of file diff --git a/src/treeagent/__main__.py b/src/treeagent/__main__.py new file mode 100644 index 0000000..0842cab --- /dev/null +++ b/src/treeagent/__main__.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 +"""Main entry point for TreeAgent CLI when run as module (python -m treeagent).""" + +from src.cli import main + +if __name__ == "__main__": + main() \ No newline at end of file From 7588c353ccf1b5b5b8fc360dad70d9367e293aed Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 27 Sep 2025 20:53:06 +0000 Subject: [PATCH 3/3] Update README with Windows compatibility note Co-authored-by: JPrier <24302717+JPrier@users.noreply.github.com> --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index f3093be..961587e 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,11 @@ treeagent "hello world" # prints skeleton task tree treeagent --model-type openai "hello" # use OpenAI accessor by default ``` +> **Note**: If you encounter import issues with the `treeagent` command on Windows, you can alternatively use: +> ```bash +> python -m src.treeagent "hello world" +> ``` + > Heads-up: you’ll need an OpenAI (or other) API key in your shell once the first agent stubs call an LLM.