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. 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