Add root --skill flag printing the bundled skill text - #15264
Open
schacon wants to merge 1 commit into
Open
Conversation
but --skill writes SKILL.md (with the CLI version injected) to stdout and exits, like --version, so agents can load the base skill without installing it. Also cross-referenced from the but skill command help.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new root-only --skill flag to the but CLI that prints the bundled SKILL.md (with the CLI version injected) to stdout and exits, enabling agents/users to easily load the GitButler skill text into context via piping/redirection.
Changes:
- Added a new top-level
--skillflag and short-circuit execution path to print the bundled base skill text and exit. - Exposed
command::skill::base_skill_text()to reuse the existing skill content preparation/version-injection logic. - Added an integration test asserting
but --skilloutput matches the bundledSKILL.mdwith the runtime--versioninjected, and updatedbut skill --helpdocs to reference the flag.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/but/src/args/mod.rs | Adds the root-only --skill flag and updates skill subcommand help text to reference it. |
| crates/but/src/lib.rs | Implements early-exit behavior that prints the skill text when --skill is set. |
| crates/but/src/command/skill/mod.rs | Introduces base_skill_text() to produce version-injected SKILL.md content for --skill. |
| crates/but/tests/but/command/skill.rs | Adds an integration test validating but --skill output against the bundled SKILL.md with version injection. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+284
to
+288
| // Like `--version`, `--skill` prints and exits without dispatching a subcommand. | ||
| if args.skill { | ||
| print!("{}", command::skill::base_skill_text()?); | ||
| return Ok(()); | ||
| } |
Member
|
Since we already have a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
but --skillwrites the bundled base skill text (SKILL.md) to stdout and exits, so agents can load the GitButler skill into context directly (e.g.but --skill >> prompt.md) without installing skill files first.What changed
--skillflag onArgs. It short-circuits right after argument parsing, like--version:but --skillprints the skill even if a subcommand follows, andbut status --skillis rejected since the flag is not global.prepare_skill_contentpath via a newcommand::skill::base_skill_text(), so the CLI version is injected into the frontmatter exactly asbut skill installwrites it, and the embedded file is UTF-8 validated.but skill --helplong help now cross-referencesbut --skillfor discoverability.Decisions
SKILL.mdis printed, not thereferences/files; the flag targets bootstrap/context-loading, where the base skill is the entry point.Testing
Integration test asserts
but --skilloutput equals the embeddedSKILL.mdwith the version swapped in, deriving the expected version frombut --versionso it holds for bothdevand release builds.