What happened?
Running agents-cli playground on Windows crashes with Error: Got unexpected extra arguments showing files from the current working directory.
Steps to Reproduce
- Create an agent project on Windows.
- Open a terminal inside the project root folder.
- Run
agents-cli install
- Run
agents-cli playground
What did you expect to happen?
The local playground server starts successfully and hosts the web UI at http://127.0.0.1:8080/dev-ui/
Client information
CLI version: 0.5.0
CLI install path: C:\Users\abdul\AppData\Roaming\uv\tools\google-agents-cli\Lib\site-packages\google\agents\cli
OS info: Windows-11-10.0.26200-SP0
Installed skills: none
Project root: C:\Users\abdul\OneDrive\Desktop\Comp Lang NEW\Antigravity - agy-cli-projects\weather-assistant
Project name: weather-assistant
Deployment target: none
Agent directory: app
Region: us-east1
Command Output / Logs
agents-cli playground
Starting your agent playground...
Running command: uv run adk web . --host 127.0.0.1 --port 8080 --allow_origins '*' --reload_agents
Will be available at: http://127.0.0.1:8080/dev-ui/?app=app
Usage: adk web [OPTIONS] [AGENTS_DIR]
Try 'adk web --help' for help.
Error: Got unexpected extra arguments (app Dockerfile GEMINI.md pyproject.toml README.md tests uv.lock)
agents-cli v0.5.0
Error: Failed to start playground (exit code 2)
Anything else we need to know?
Cause:
When Python launches the command via uv run, the adk.exe launcher wrapper (which is compiled with MSVC's setargv.obj) automatically expands the * wildcard in --allow_origins "*" into all filenames in the current directory before passing it to Python. Click then interprets these filenames as unexpected positional arguments.
Proposed Fix:
In google/agents/cli/dev/cmd_playground.py, escape/quote the asterisk argument on Windows to prevent the launcher's C runtime from expanding it:
browser_host = "127.0.0.1" if host == "0.0.0.0" else host
url = f"http://{browser_host}:{port}/dev-ui/?app={cfg.agent_directory}"
+ import sys
+ allow_origins = '"*"' if sys.platform == "win32" else "*"
args = [
"uv",
"run",
@@ -66,7 +66,7 @@
"--port",
str(port),
"--allow_origins",
- "*",
+ allow_origins,
]
if reload_agents:
args.append("--reload_agents")
---
*Contribution & Recognition:*
* I have signed the Google Individual CLA (under the name Abdullah).
* Since this fix resolves a blocker for Windows users, I would appreciate being credited for this contribution when the fix is applied.
* Once merged, I would also love to be nominated for the Google Open Source Peer Bonus program.
What happened?
Running
agents-cli playgroundon Windows crashes withError: Got unexpected extra argumentsshowing files from the current working directory.Steps to Reproduce
agents-cli installagents-cli playgroundWhat did you expect to happen?
The local playground server starts successfully and hosts the web UI at http://127.0.0.1:8080/dev-ui/
Client information
CLI version: 0.5.0
CLI install path: C:\Users\abdul\AppData\Roaming\uv\tools\google-agents-cli\Lib\site-packages\google\agents\cli
OS info: Windows-11-10.0.26200-SP0
Installed skills: none
Project root: C:\Users\abdul\OneDrive\Desktop\Comp Lang NEW\Antigravity - agy-cli-projects\weather-assistant
Project name: weather-assistant
Deployment target: none
Agent directory: app
Region: us-east1
Command Output / Logs
agents-cli playground
Starting your agent playground...
Running command: uv run adk web . --host 127.0.0.1 --port 8080 --allow_origins '*' --reload_agents
Will be available at: http://127.0.0.1:8080/dev-ui/?app=app
Usage: adk web [OPTIONS] [AGENTS_DIR]
Try 'adk web --help' for help.
Error: Got unexpected extra arguments (app Dockerfile GEMINI.md pyproject.toml README.md tests uv.lock)
agents-cli v0.5.0
Error: Failed to start playground (exit code 2)
Anything else we need to know?
Cause:
When Python launches the command via
uv run, theadk.exelauncher wrapper (which is compiled with MSVC'ssetargv.obj) automatically expands the*wildcard in--allow_origins "*"into all filenames in the current directory before passing it to Python. Click then interprets these filenames as unexpected positional arguments.Proposed Fix:
In
google/agents/cli/dev/cmd_playground.py, escape/quote the asterisk argument on Windows to prevent the launcher's C runtime from expanding it:browser_host = "127.0.0.1" if host == "0.0.0.0" else host url = f"http://{browser_host}:{port}/dev-ui/?app={cfg.agent_directory}" + import sys + allow_origins = '"*"' if sys.platform == "win32" else "*" args = [ "uv", "run", @@ -66,7 +66,7 @@ "--port", str(port), "--allow_origins", - "*", + allow_origins, ] if reload_agents: args.append("--reload_agents") --- *Contribution & Recognition:* * I have signed the Google Individual CLA (under the name Abdullah). * Since this fix resolves a blocker for Windows users, I would appreciate being credited for this contribution when the fix is applied. * Once merged, I would also love to be nominated for the Google Open Source Peer Bonus program.