You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The client operates in one of two modes: **spawning a local CLI process** (default) or **connecting to an external server** via `cli_url`. Some arguments only apply to one mode.
106
+
107
+
*General options (always applicable):*
106
108
107
-
-`cli_path` (str): Path to CLI executable (default: "copilot" or `COPILOT_CLI_PATH` env var)
108
-
-`cli_url` (str): URL of existing CLI server (e.g., `"localhost:8080"`, `"http://127.0.0.1:9000"`, or just `"8080"`). When provided, the client will not spawn a CLI process.
109
-
-`cwd` (str): Working directory for CLI process
110
-
-`port` (int): Server port for TCP mode (default: 0 for random)
111
-
-`use_stdio` (bool): Use stdio transport instead of TCP (default: True)
112
-
-`log_level` (str): Log level (default: "info")
113
109
-`auto_start` (bool): Auto-start server on first use (default: True)
110
+
-`on_list_models` (callable | None): Custom handler for listing available models. When provided, `list_models()` calls this handler instead of querying the CLI server.
111
+
112
+
*Local CLI process options (not allowed when `cli_url` is provided):*
113
+
114
+
-`cli_path` (str | None): Path to the Copilot CLI executable. When ``None`` (default), uses the bundled CLI binary shipped with the platform-specific wheel.
115
+
-`cli_args` (list[str] | None): Extra arguments to pass to the CLI executable (inserted before SDK-managed args).
116
+
-`cwd` (str | None): Working directory for the CLI process. Defaults to the current working directory.
117
+
-`port` (int): Server port for TCP mode (default: 0 for random). Ignored in stdio mode.
118
+
-`use_stdio` (bool | None): Use stdio transport instead of TCP (default: True). Passing explicitly alongside `cli_url` raises an error.
119
+
-`log_level` (str): Log level (default: "info")
114
120
-`auto_restart` (bool): Auto-restart on crash (default: True)
115
-
-`github_token` (str): GitHub token for authentication. When provided, takes priority over other auth methods.
116
-
-`use_logged_in_user` (bool): Whether to use logged-in user for authentication (default: True, but False when `github_token` is provided). Cannot be used with `cli_url`.
121
+
-`env` (dict[str, str] | None): Environment variables for the CLI process. When ``None``, the current process's environment is used.
122
+
-`github_token` (str | None): GitHub token for authentication. When provided, takes priority over other auth methods. Cannot be used with `cli_url`.
123
+
-`use_logged_in_user` (bool | None): Whether to use the logged-in user for authentication. Defaults to ``True`` when no `github_token` is given, ``False`` otherwise. Cannot be used with `cli_url`.
124
+
125
+
*External server options:*
126
+
127
+
-`cli_url` (str | None): URL of an existing CLI server (e.g., `"localhost:8080"`, `"http://127.0.0.1:9000"`, or just `"8080"`). When provided, the client connects over TCP instead of spawning a process. Mutually exclusive with `cli_path` and its exclusive arguments.
0 commit comments