Skip to content

Enhance command line functionality and MCP client integration#12

Merged
kooksee merged 27 commits into
mainfrom
fix/args
May 10, 2026
Merged

Enhance command line functionality and MCP client integration#12
kooksee merged 27 commits into
mainfrom
fix/args

Conversation

@kooksee
Copy link
Copy Markdown
Contributor

@kooksee kooksee commented May 10, 2026

This pull request introduces several improvements and changes to the CLI framework, focusing on option inheritance, global flag behavior, structured response output, and better support for tool exclusion and completion. The most significant updates include making option inheritance explicit and non-default, unifying and clarifying global flag usage, introducing a new --raw-envelope flag for output control, and enhancing documentation and shell completion scripts to reflect these changes.

Core framework changes:

  • Option inheritance is now explicit and opt-in: options/flags are not inherited by subcommands unless Inherit: true is set. This is reflected in both the code (GlobalFlags, OptionSet) and documentation. (args.go [1] README.md [2] [3]
  • Global flags such as --list-commands, --list-flags, and --list-format are now only available on the root command (Inherit: false), reducing clutter and preventing accidental propagation to subcommands. (args.go [1] README.md [2]

Output and response handling:

  • Introduced a new --raw-envelope flag, allowing users to control whether output is wrapped in a structured NDJSON envelope. This flag is now available globally (with inheritance) and is documented in both user and developer docs. (args.go [1] .github/copilot-instructions.md [2]
  • MCP tool invocation responses are now unified to use a {data, message} JSON envelope, removing legacy/duplicate fields and aligning output schemas across the system. (.version/changelog/Unreleased.md .version/changelog/Unreleased.mdL7-R32)

Tool exclusion and metadata:

  • Added an agent.exclude metadata key and InfraMetadata helper to easily exclude infrastructure commands (like mcp, completion, etc.) from tool/resource listings and prompt generation. (args.go [1] cmds/completioncmd/completion.go [2]
  • llms-txt and MCP listings now consistently filter out excluded commands in all output formats. (.version/changelog/Unreleased.md .version/changelog/Unreleased.mdL7-R32)

Shell completion and documentation:

  • Updated bash, zsh, and fish completion scripts to reflect the new global flags and inheritance logic, removing non-inherited flags from subcommands and adding the new --raw-envelope flag. (cmds/completioncmd/testdata/testapp.bash.golden [1] cmds/completioncmd/testdata/testapp.zsh.golden [2] [3] [4] cmds/completioncmd/testdata/testapp.fish.golden [5]
  • Documentation (including README and changelogs) has been updated to clarify option inheritance, new flags, and response envelope behavior. (README.md [1] [2] [3] .github/copilot-instructions.md [4] .version/changelog/Unreleased.md [5]

Versioning:

  • Bumped version to v0.4.0 to reflect these breaking and feature changes. (.version/VERSION .version/VERSIONL1-R1)

kooksee and others added 25 commits May 7, 2026 21:14
- Introduced a new client command for MCP to interact with external servers, including subcommands for listing tools, resources, prompts, and calling tools.
- Enhanced the web UI to support MCP functionalities, including displaying server info, tools, resources, and prompts.
- Implemented a new in-process MCP client session to facilitate communication between the web UI and MCP server.
- Added API endpoints for MCP operations in the web server, allowing for seamless integration with the front-end.
- Updated the command structure to include the new client command and adjusted tests accordingly.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request significantly enhances the framework's MCP integration and refines flag inheritance. Key features include a new mcp client subcommand, SKILL.md generation support, and an MCP management tab in the Web UI. Flag inheritance is now disabled by default, requiring explicit configuration via the Inherit field. Documentation and internal server logic were updated to support a unified {data, message} response envelope. Review feedback recommends using a robust shell-parsing library for command strings in the MCP client and removing the unused parseExternalCommand function.

Comment thread cmds/mcpcmd/client.go
Comment thread cmds/mcpcmd/client.go
@kooksee kooksee merged commit 82aa618 into main May 10, 2026
3 checks passed
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.

1 participant