Skip to content

workflow: auto-update cli-commands on release#6755

Merged
dianed-square merged 4 commits intomainfrom
automation/cli-commands-doc
Feb 12, 2026
Merged

workflow: auto-update cli-commands on release#6755
dianed-square merged 4 commits intomainfrom
automation/cli-commands-doc

Conversation

@dianed-square
Copy link
Contributor

@dianed-square dianed-square commented Jan 27, 2026

Summary

Automates detection and documentation of CLI changes between releases.

  • Extracts CLI structure from tagged versions
  • Generates AI-powered change analysis
  • Updates goose-cli-commands.md automatically
  • Creates PRs with documentation changes

Type of Change

  • Feature
  • Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release - New GitHub Action workflow
  • Other (specify below)

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

Tested across multiple version ranges locally and in my fork, e.g.:

  • v1.13.2 → v1.14.0 (12 commands modified, 11 breaking changes)
  • v1.17.0 → v1.20.1 (100% consistency across final 3 runs)

@dianed-square dianed-square requested a review from a team as a code owner January 27, 2026 22:16
Copilot AI review requested due to automatic review settings January 27, 2026 22:16
@github-actions
Copy link
Contributor

github-actions bot commented Jan 27, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-02-12 16:33 UTC

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR automates the detection and documentation of CLI command changes between goose releases by building a comprehensive pipeline that:

Changes:

  • Adds scripts to extract CLI structure from goose binaries and compare versions
  • Implements AI-powered recipes to synthesize human-readable change documentation
  • Creates GitHub Actions workflow to automatically update CLI documentation on releases

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
.github/workflows/docs-update-cli-ref.yml GitHub Actions workflow that triggers on release to compare CLI versions and create PRs
documentation/automation/cli-command-tracking/scripts/run-pipeline.sh End-to-end orchestration script coordinating extraction, diffing, and AI synthesis
documentation/automation/cli-command-tracking/scripts/extract-cli-structure.sh Downloads/builds goose binaries and extracts CLI structure via help output
documentation/automation/cli-command-tracking/scripts/extract-cli-structure.py Parses help text to generate structured JSON of commands and options
documentation/automation/cli-command-tracking/scripts/diff-cli-structures.py Compares two CLI structure JSONs and identifies breaking/non-breaking changes
documentation/automation/cli-command-tracking/recipes/synthesize-cli-changes.yaml AI recipe to generate human-readable change documentation from diffs
documentation/automation/cli-command-tracking/recipes/update-cli-commands.yaml AI recipe to apply changes to goose-cli-commands.md documentation
documentation/automation/cli-command-tracking/config/skip-commands.json Configuration for commands to exclude from tracking
documentation/automation/cli-command-tracking/README.md Comprehensive documentation of the automation system
documentation/automation/cli-command-tracking/TESTING.md Detailed testing guide for local and CI workflows
documentation/automation/cli-command-tracking/.gitignore Excludes generated output files from git

- name: Configure goose for CI
env:
GOOSE_PROVIDER: ${{ vars.GOOSE_PROVIDER || 'openai' }}
GOOSE_MODEL: ${{ vars.GOOSE_MODEL || 'gpt-5' }}
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

The PR description mentions "GPT-5" which doesn't exist. This model name also appears in the workflow as the default (line 91). This will cause the workflow to fail. The description should be corrected to match whatever valid model is actually being used (likely gpt-4o or another existing model).

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This workflow was tested in the fork (runs 21379191396, 21379197115, 21379200739) using provider: openai and model: gpt-5 with secrets.OPENAI_API_KEY, all runs succeeded. Will test in this repo after merging. We used the pattern from test-finder.yml but notice that hasn't been run for a while.

Copy link
Collaborator

Choose a reason for hiding this comment

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

any reason not to use a claude model?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe not a good reason. I found this pattern and was able to obtain an openai key for testing in my fork. I did see some Anthropic models used by other actions so I could try them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the workflow defaults to Anthropic (GOOSE_PROVIDER=anthropic, GOOSE_MODEL=claude-opus-4-5) and switched to ANTHROPIC_API_KEY, matching the patterns in .github/workflows/goose-pr-reviewer.yml and .github/workflows/goose-issue-solver.yml

grep -v "^Closing session" | \
grep -v "^Loading recipe:" | \
grep -v "^Description:" | \
sed '/^$/N;/^\n$/D'
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

The sed command pattern /^$/N;/^\n$/D appears again with the same maintainability concerns as line 117.

Suggested change
sed '/^$/N;/^\n$/D'
awk 'NF { blank = 0 } !NF { blank++ } blank < 2'

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

replaced the sed '/^$/N;/^\n$/D' blank-line squashing with cat -s instead of the suggested awk one-liner
cat -s is simpler/readable and does the same “collapse consecutive blank lines” behavior on Ubuntu runners

try:
from datetime import timezone
now = datetime.now(timezone.utc).isoformat().replace('+00:00', 'Z')
except:
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

Except block directly handles BaseException.

Suggested change
except:
except Exception:

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed the try/except entirely and always use a timezone-aware UTC timestamp (datetime.now(timezone.utc)), since we already require Python 3.7+, which avoids the deprecated datetime.utcnow() fallback and eliminates the broad exception handler

try:
from datetime import timezone
now = datetime.now(timezone.utc).isoformat().replace('+00:00', 'Z')
except:
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

Except block directly handles BaseException.

Suggested change
except:
except (ImportError, AttributeError):

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed the try/except entirely and always use a timezone-aware UTC timestamp (datetime.now(timezone.utc)), since we already require Python 3.7+, which avoids the deprecated datetime.utcnow() fallback and eliminates the broad exception handler

Copilot AI review requested due to automatic review settings February 11, 2026 20:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 11 comments.

# - If new_version not provided: uses the most recent release tag (or RELEASE_TAG env var)
# - HEAD is only used when explicitly passed for testing unreleased changes

set -e
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

set -e won’t fail the script if goose run ... | sed | grep ... fails because the pipeline’s exit status is from the last command; add set -o pipefail (or set -euo pipefail) near the top so failed extraction/synthesis doesn’t silently produce empty/partial outputs.

Suggested change
set -e
set -e -o pipefail

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Didn’t enable global set -o pipefail here because grep -v can exit 1 on empty output and would cause false failures. Instead we check PIPESTATUS[0] to ensure we still fail when goose run fails.

Comment on lines 139 to 143
# First line has the flags and value_name
first_line = lines[0].strip()

# Extract short flag (e.g., -f)
short_match = re.search(r'-([a-zA-Z])\b', first_line)
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

parse_option_block() doesn’t capture help text that appears on the same line as the flags (common in clap output), so many options will end up with help: null and help-text diffs won’t be detected; parse the trailing description text from first_line.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implemented inline option help capture by splitting the flags line on 2+ spaces (clap-style formatting), rather than a more complex parse.

@dianed-square dianed-square added this pull request to the merge queue Feb 12, 2026
Merged via the queue into main with commit b904842 Feb 12, 2026
21 checks passed
@dianed-square dianed-square deleted the automation/cli-commands-doc branch February 12, 2026 16:29
tlongwell-block added a commit that referenced this pull request Feb 12, 2026
…provenance

* origin/main: (68 commits)
  Upgraded npm packages for latest security updates (#7183)
  docs: reasoning effort levels for Codex provider (#6798)
  Fix speech local (#7181)
  chore: add .gooseignore to .gitignore (#6826)
  Improve error message logging from electron (#7130)
  chore(deps): bump jsonwebtoken from 9.3.1 to 10.3.0 (#6924)
  docs: standalone mcp apps and apps extension (#6791)
  workflow: auto-update cli-commands on release (#6755)
  feat(apps): Integrate AppRenderer from @mcp-ui/client SDK (#7013)
  fix(MCP): decode resource content (#7155)
  feat: reasoning_content in API for reasoning models (#6322)
  Fix/configure add provider custom headers (#7157)
  fix: handle keyring fallback as success (#7177)
  Update process-wrap to 9.0.3 (9.0.2 is yanked) (#7176)
  feat: support extra field in chatcompletion tool_calls for gemini openai compat (#6184)
  fix: replace panic with proper error handling in get_tokenizer (#7175)
  Lifei/smoke test for developer (#7174)
  fix text editor view broken (#7167)
  docs: White label guide (#6857)
  Add PATH detection back to developer extension (#7161)
  ...

# Conflicts:
#	.github/workflows/nightly.yml
jh-block added a commit that referenced this pull request Feb 13, 2026
* origin/main: (21 commits)
  nit: show dir in title, and less... jank (#7138)
  feat(gemini-cli): use stream-json output and re-use session (#7118)
  chore(deps): bump qs from 6.14.1 to 6.14.2 in /documentation (#7191)
  Switch jsonwebtoken to use aws-lc-rs (already used by rustls) (#7189)
  chore(deps): bump qs from 6.14.1 to 6.14.2 in /evals/open-model-gym/mcp-harness (#7184)
  Add SLSA build provenance attestations to release workflows (#7097)
  fix save and run recipe not working (#7186)
  Upgraded npm packages for latest security updates (#7183)
  docs: reasoning effort levels for Codex provider (#6798)
  Fix speech local (#7181)
  chore: add .gooseignore to .gitignore (#6826)
  Improve error message logging from electron (#7130)
  chore(deps): bump jsonwebtoken from 9.3.1 to 10.3.0 (#6924)
  docs: standalone mcp apps and apps extension (#6791)
  workflow: auto-update cli-commands on release (#6755)
  feat(apps): Integrate AppRenderer from @mcp-ui/client SDK (#7013)
  fix(MCP): decode resource content (#7155)
  feat: reasoning_content in API for reasoning models (#6322)
  Fix/configure add provider custom headers (#7157)
  fix: handle keyring fallback as success (#7177)
  ...
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.

3 participants