Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/gh-aw/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,8 @@ Use "` + string(constants.CLIExtensionPrefix) + ` help all" to show help for all
mcpServerCmd := cli.NewMCPServerCommand()
prCmd := cli.NewPRCommand()
campaignCmd := campaign.NewCommand()
// Add create-project subcommand (defined in pkg/cli to avoid circular deps)
campaignCmd.AddCommand(cli.NewCampaignCreateProjectCommand())
secretsCmd := cli.NewSecretsCommand()
fixCmd := cli.NewFixCommand()
upgradeCmd := cli.NewUpgradeCommand()
Expand Down
70 changes: 69 additions & 1 deletion docs/src/content/docs/guides/campaigns/cli-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ gh aw campaign status --json # JSON status output
gh aw campaign new my-campaign # Scaffold new spec (advanced)
gh aw campaign validate # Validate all specs
gh aw campaign validate --no-strict # Report without failing

gh aw campaign create-project # Create GitHub Project V2
--owner myorg # Owner (org or user)
--title "My Project" # Project title
--org # Owner is an organization
--view "name:layout[:filter]" # Add view (repeatable)
--field "name:type[:options]" # Add custom field (repeatable)
```

## List campaigns
Expand Down Expand Up @@ -119,12 +126,73 @@ gh aw campaign new my-campaign-id

Creates `.github/workflows/my-campaign-id.campaign.md` with basic structure. You must:
1. Configure all required fields
2. Set up project board manually
2. Set up project board manually (or use `create-project` command)
3. Compile the spec with `gh aw compile`
4. Test thoroughly before running

The automated flow handles all this for you.

## Create GitHub Project

Create a GitHub Project V2 for campaign tracking:

```bash
gh aw campaign create-project --owner myorg --title "Security Q1 2025" --org
```

This command creates a project and optionally configures views and custom fields:

### Basic project creation

```bash
gh aw campaign create-project --owner myorg --title "Campaign Tracker" --org
```

### With views

```bash
gh aw campaign create-project --owner myorg --title "Campaign Board" --org \
--view "Progress:board:is:open" \
--view "All Items:table" \
--view "Timeline:roadmap"
```

View format: `name:layout[:filter]`
- **name**: View name (required)
- **layout**: `board`, `table`, or `roadmap` (required)
- **filter**: Optional GitHub search filter (e.g., `is:issue is:pr`)

### With custom fields

```bash
gh aw campaign create-project --owner myorg --title "Task Tracker" --org \
--field "Priority:SINGLE_SELECT:High,Medium,Low" \
--field "Size:SINGLE_SELECT:Small,Medium,Large" \
--field "Start Date:DATE" \
--field "Campaign Id:TEXT"
```

Field format: `name:type[:options]`
- **name**: Field name (required)
- **type**: `TEXT`, `DATE`, `SINGLE_SELECT`, or `NUMBER` (required)
- **options**: Comma-separated options for `SINGLE_SELECT` fields

### Complete example

```bash
gh aw campaign create-project --owner myorg --title "Security Campaign" --org \
--view "Board:board:is:issue is:pr" \
--view "Timeline:roadmap" \
--field "Priority:SINGLE_SELECT:High,Medium,Low" \
--field "Size:SINGLE_SELECT:Small,Medium,Large" \
--field "Start Date:DATE" \
--field "End Date:DATE" \
--field "Campaign Id:TEXT" \
--field "Worker Workflow:TEXT"
```

The command outputs the project URL, which you can use in your campaign spec's `project-url` field.

## Common workflows

### Check campaign health
Expand Down
10 changes: 7 additions & 3 deletions pkg/campaign/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ workflows, repo-memory paths, and risk level). This command provides a
single place to see all campaigns configured for the repo.

Available subcommands:
• status - Show live status for campaigns (compiled workflows, repo-memory)
• new - Create a new campaign spec file
• validate - Validate campaign spec files for common issues
• status - Show live status for campaigns (compiled workflows, repo-memory)
• new - Create a new campaign spec file
• create-project - Create a GitHub Project with views and custom fields
• validate - Validate campaign spec files for common issues

Examples:
` + string(constants.CLIExtensionPrefix) + ` campaign # List all campaigns
Expand Down Expand Up @@ -183,6 +184,9 @@ Examples:
validateCmd.Flags().Bool("strict", true, "Exit with non-zero status if any problems are found")
cmd.AddCommand(validateCmd)

// Note: The create-project subcommand is defined in pkg/cli/campaign_create_project_command.go
// and added to the campaign command in cmd/gh-aw/main.go to avoid circular dependencies

return cmd
}

Expand Down
Loading