Skip to content

Add cli_args/CLIArgs to Python and Go SDKs for cross-SDK consistency#394

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/fix-cli-args-in-python-module
Draft

Add cli_args/CLIArgs to Python and Go SDKs for cross-SDK consistency#394
Copilot wants to merge 5 commits intomainfrom
copilot/fix-cli-args-in-python-module

Conversation

Copy link
Contributor

Copilot AI commented Feb 6, 2026

Python and Go SDKs lacked the CLI arguments pass-through option available in Node.js and .NET, preventing users from passing custom flags to the underlying Copilot CLI process.

Changes

Python SDK (cli_args: list[str])

  • Added field to CopilotClientOptions TypedDict
  • Arguments prepended before SDK-managed flags in _start_cli_server
  • Defensive copy via list() to prevent mutations

Go SDK (CLIArgs []string)

  • Added field to ClientOptions struct
  • Arguments prepended before SDK-managed flags in startCLIServer
  • Defensive copy via append([]string{}, ...) pattern

Documentation

  • Updated READMEs for both SDKs

Usage

# Python
client = CopilotClient({
    "cli_args": ["--custom-flag", "--debug-mode"],
    "log_level": "info"
})
// Go
client := copilot.NewClient(&copilot.ClientOptions{
    CLIArgs: []string{"--custom-flag", "--debug-mode"},
    LogLevel: "info",
})

User-provided arguments are inserted before SDK-managed flags like --headless and --no-auto-update, allowing CLI customization while preserving SDK functionality.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/copilot_internal/user
    • Triggering command: /opt/hostedtoolcache/node/22.22.0/x64/bin/node node /home/REDACTED/work/copilot-sdk/copilot-sdk/nodejs/node_modules/@github/copilot/index.js --headless --no-auto-update --log-level info --stdio (http block)
    • Triggering command: /opt/hostedtoolcache/node/22.22.0/x64/bin/node node /home/REDACTED/work/copilot-sdk/copilot-sdk/nodejs/node_modules/@github/copilot/index.js --headless --no-auto-update --log-level info --stdio /usr/local/.ghcu--64 (http block)
    • Triggering command: /opt/hostedtoolcache/node/22.22.0/x64/bin/node node /home/REDACTED/work/copilot-sdk/copilot-sdk/nodejs/node_modules/@github/copilot/index.js --headless --no-auto-update --log-level info --stdio x64/pkg/tool/lin--64 (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Cant pass CLI arguments in python module, despite possible in Node.js module</issue_title>
<issue_description>CopilotClientOptions.cliArgs field in nodejs module is not available in the py module equivalent object. An SDK inconsistency.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits February 6, 2026 19:10
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CLI arguments handling in Python module Add cli_args/CLIArgs to Python and Go SDKs for cross-SDK consistency Feb 6, 2026
Copilot AI requested a review from friggeri February 6, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cant pass CLI arguments in python module, despite possible in Node.js module

2 participants