From 82cfa5a41d88c4c74f0dfec1676c145ecf948623 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 18 May 2026 18:58:48 +0000 Subject: [PATCH 1/2] Initial plan From 83aa0c2b1da8ae86062180950ed0569f29c38bab Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 18 May 2026 19:14:49 +0000 Subject: [PATCH 2/2] fix: align cli help and docs consistency items Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- docs/src/content/docs/setup/cli.md | 15 +++++++++++++++ pkg/cli/forecast_command.go | 6 +++--- pkg/cli/forecast_test.go | 3 +++ pkg/cli/mcp_server_command.go | 2 +- pkg/cli/mcp_server_command_test.go | 17 +++++++++++++++++ pkg/cli/project_command.go | 2 +- pkg/cli/project_command_test.go | 2 ++ 7 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 pkg/cli/mcp_server_command_test.go diff --git a/docs/src/content/docs/setup/cli.md b/docs/src/content/docs/setup/cli.md index 7c4d2a759e2..fbc7d1c2c6c 100644 --- a/docs/src/content/docs/setup/cli.md +++ b/docs/src/content/docs/setup/cli.md @@ -517,6 +517,19 @@ gh aw logs --format markdown --repo owner/repo --count 10 # Specify repository See [Audit Commands](/gh-aw/reference/audit/) for the full reference. ::: +#### `outcomes` + +Check what happened to a workflow run's safe outputs (accepted, rejected, ignored, or pending). + +```bash wrap +gh aw outcomes 1234567890 # Check outcomes for a specific run +gh aw outcomes 1234567890 --json # JSON output +gh aw outcomes 1234567890 --repo owner/repo # Specify repository +gh aw outcomes 1234567890 --outcomes-dir ./otlp # Write outcome JSONL for OTLP export +``` + +**Options:** `--json/-j`, `--repo/-r`, `--output/-o`, `--outcomes-dir` + #### `health` Display workflow health metrics and success rates. @@ -731,11 +744,13 @@ Create a new GitHub Project V2 owned by a user or organization with optional rep gh aw project new "My Project" --owner @me # Create user project gh aw project new "Team Board" --owner myorg # Create org project gh aw project new "Bugs" --owner myorg --link myorg/myrepo # Create and link to repo +gh aw project new "Project Q1" --owner myorg --with-project-setup # Create with standard views and fields ``` **Options:** - `--owner` (required): Project owner - use `@me` for current user or specify organization name - `--link`: Repository to link project to (format: `owner/repo`) +- `--with-project-setup`: Create standard project views and custom fields **Token Requirements:** diff --git a/pkg/cli/forecast_command.go b/pkg/cli/forecast_command.go index 402c16e9ed3..b6d7abbb736 100644 --- a/pkg/cli/forecast_command.go +++ b/pkg/cli/forecast_command.go @@ -37,8 +37,8 @@ func NewForecastCommand() *cobra.Command { recent run history and projecting forward on a per-week or per-month basis. The forecaster downloads a sample of recent completed workflow runs and derives -per-run metrics (effective tokens, duration, success rate). When runs have been -previously processed by 'gh aw logs', cached token-usage data is used. The +per-run metrics (effective tokens, duration, success rate). When runs have been +previously processed by 'gh aw logs', cached token-usage data is used. The observed run frequency is then projected to the target period using a Monte Carlo simulation that models three sources of uncertainty: run count (Poisson), per-run token usage (bootstrap resampling), and per-run success (Bernoulli). @@ -57,7 +57,7 @@ Backtesting (--eval): Shifts the training window back by one projection period, builds the forecast, then measures actual runs in that period and computes quality metrics: P50 absolute/percentage error and whether the actual value fell inside the - P10–P90 confidence interval. Use this to validate the model before relying on + P10–P90 confidence interval. Use this to validate the model before relying on forward projections. ` + WorkflowIDExplanation + ` diff --git a/pkg/cli/forecast_test.go b/pkg/cli/forecast_test.go index 7c63d898fe8..199486389a4 100644 --- a/pkg/cli/forecast_test.go +++ b/pkg/cli/forecast_test.go @@ -86,6 +86,9 @@ func TestNewForecastCommand_DaysFlagDocumentsAllowedValues(t *testing.T) { daysFlag := cmd.Flags().Lookup("days") require.NotNil(t, daysFlag, "forecast command should register --days") assert.Equal(t, "Historical window in days to sample run history (allowed values: 7, 30)", daysFlag.Usage) + assert.NotContains(t, cmd.Long, "). When runs have been", "Long description should not contain duplicate spacing") + assert.NotContains(t, cmd.Long, "used. The", "Long description should not contain duplicate spacing") + assert.NotContains(t, cmd.Long, "interval. Use this", "Long description should not contain duplicate spacing") } // ── Duration enrichment ─────────────────────────────────────────────────────── diff --git a/pkg/cli/mcp_server_command.go b/pkg/cli/mcp_server_command.go index 1e6bc113c59..e28909fd21e 100644 --- a/pkg/cli/mcp_server_command.go +++ b/pkg/cli/mcp_server_command.go @@ -55,7 +55,7 @@ an HTTP server with SSE (Server-Sent Events) transport instead. Examples: gh aw mcp-server # Run with stdio transport (default for MCP clients) gh aw mcp-server --validate-actor # Run with actor validation enforced - gh aw mcp-server --port 8080 # Run HTTP server on port 8080 (for web-based clients) + gh aw mcp-server --port 8080 # Run HTTP server on port 8080 with SSE transport (for web-based clients) gh aw mcp-server --cmd ./gh-aw # Use custom gh-aw binary path GITHUB_ACTOR=octocat gh aw mcp-server # Set actor via environment variable for access control DEBUG=mcp:* GITHUB_ACTOR=octocat gh aw mcp-server # Run with verbose debug logging and actor set via environment variable`, diff --git a/pkg/cli/mcp_server_command_test.go b/pkg/cli/mcp_server_command_test.go new file mode 100644 index 00000000000..f4ad8f4eb49 --- /dev/null +++ b/pkg/cli/mcp_server_command_test.go @@ -0,0 +1,17 @@ +//go:build !integration + +package cli + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestNewMCPServerCommand_PortExampleMentionsSSE(t *testing.T) { + cmd := NewMCPServerCommand() + require.NotNil(t, cmd) + + assert.Contains(t, cmd.Long, "Run HTTP server on port 8080 with SSE transport", "Port example should match SSE transport behavior") +} diff --git a/pkg/cli/project_command.go b/pkg/cli/project_command.go index eb1be2a8308..052139468b8 100644 --- a/pkg/cli/project_command.go +++ b/pkg/cli/project_command.go @@ -68,7 +68,7 @@ The project can optionally be linked to a specific repository. Authentication Requirements: The default GITHUB_TOKEN cannot create projects. You must use additional authentication. - See https://github.github.io/gh-aw/reference/auth-projects/. + See https://github.github.com/gh-aw/reference/auth-projects/. Project Setup: Use --with-project-setup to automatically create: diff --git a/pkg/cli/project_command_test.go b/pkg/cli/project_command_test.go index f2caa91b09c..9dc7e9eca40 100644 --- a/pkg/cli/project_command_test.go +++ b/pkg/cli/project_command_test.go @@ -23,6 +23,8 @@ func TestNewProjectNewCommand(t *testing.T) { require.NotNil(t, cmd, "Command should be created") assert.Equal(t, "new