From 05dbdfc0ceb5de7629db22468edadf94477fe9d9 Mon Sep 17 00:00:00 2001 From: MFA-X-AI Date: Sun, 22 Feb 2026 15:58:53 +0900 Subject: [PATCH 1/2] enable users to specify python version for agent init --- src/xaibo/cli/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/xaibo/cli/__init__.py b/src/xaibo/cli/__init__.py index 06e0cf3..126fe54 100644 --- a/src/xaibo/cli/__init__.py +++ b/src/xaibo/cli/__init__.py @@ -319,7 +319,12 @@ def init(args, extra_args=[]): project_name = args.project_name curdir = Path(os.getcwd()) project_dir = curdir / project_name - universal_run(f"uv init --bare {project_name}", cwd=curdir) + + # Build uv init command with optional python version + uv_init_cmd = f"uv init --bare {project_name}" + if args.python: + uv_init_cmd += f" --python {args.python}" + universal_run(uv_init_cmd, cwd=curdir) universal_run(f"uv add xaibo xaibo[{','.join(modules)}] pytest", cwd=project_dir) (project_dir / "agents").mkdir() @@ -509,6 +514,8 @@ def main(): # 'init' command. init_parser = subparsers.add_parser('init', help='Initialize a Xaibo project') init_parser.add_argument('project_name', type=str, help='Name of the project') + init_parser.add_argument('--python', type=str, default=None, + help='Python version to use (e.g., 3.11, 3.12, 3.13). If not specified, uv will use the version from .python-version file, or the first Python found on PATH.') init_parser.set_defaults(func=init) # 'eject' command From 0e7651aaef1cb040f7d54aef75c63aaf1020a1a7 Mon Sep 17 00:00:00 2001 From: MFA-X-AI Date: Mon, 23 Feb 2026 15:43:03 +0900 Subject: [PATCH 2/2] update docs to include change --- docs/reference/cli.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/reference/cli.md b/docs/reference/cli.md index a3395b8..662ee56 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -11,7 +11,7 @@ Initialize a new Xaibo project with recommended structure. ### Syntax ```bash -uvx xaibo init +uvx xaibo init [--python ] ``` ### Parameters @@ -19,6 +19,7 @@ uvx xaibo init | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `project_name` | `str` | Yes | Name of the project directory to create | +| `--python` | `str` | No | Python version to use (e.g., `3.11`, `3.12`, `3.13`). If not specified, uv will use the version from `.python-version` file, or the first Python found on PATH | ### Generated Structure @@ -42,6 +43,9 @@ project_name/ # Create a new project uvx xaibo init my_agent_project +# Create a new project with specific Python version +uvx xaibo init my_agent_project --python 3.12 + # Navigate to project cd my_agent_project