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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand Down
21 changes: 21 additions & 0 deletions cli.py
Original file line number Diff line number Diff line change
@@ -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']
Comment on lines +1 to +21

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Ensure compatibility shim is packaged

The new cli.py makes the Windows entry-point import succeed only when the file is present in the installation, but the build configuration (pyproject.toml packages only the src directory) does not include top-level modules. A wheel built from this repo will still omit cli.py, so treeagent.exe on Windows continues to raise ModuleNotFoundError: No module named 'cli'. Consider moving this shim into the src package or updating the packaging configuration so the module is shipped.

Useful? React with 👍 / 👎.

7 changes: 7 additions & 0 deletions src/treeagent/__main__.py
Original file line number Diff line number Diff line change
@@ -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()