Skip to content

Add CLI command for campaign project creation with views and custom fields#11745

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/add-campaign-project-creation
Closed

Add CLI command for campaign project creation with views and custom fields#11745
Copilot wants to merge 3 commits intomainfrom
copilot/add-campaign-project-creation

Conversation

Copy link
Contributor

Copilot AI commented Jan 25, 2026

Campaign project creation was only accessible through the automated workflow (applying create-agentic-campaign label). This adds direct CLI access.

Changes

New command: gh aw campaign create-project

  • Creates GitHub Projects V2 via GraphQL API
  • Configures views (board/table/roadmap) via REST API
  • Defines custom fields (TEXT, DATE, SINGLE_SELECT, NUMBER)
  • Returns project URL for campaign spec integration

Implementation:

  • pkg/cli/campaign_create_project_command.go - Command with GraphQL/REST client integration
  • View spec parser: name:layout[:filter] with proper colon handling in filters
  • Field spec parser: name:type[:options] with option parsing for SINGLE_SELECT

Files modified:

  • cmd/gh-aw/main.go - Registered subcommand
  • pkg/campaign/command.go - Updated help text
  • docs/src/content/docs/guides/campaigns/cli-commands.md - Added usage documentation

Usage

# Create project with views and fields
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 "Campaign Id:TEXT" \
  --field "Start Date:DATE"

Technical notes

  • Uses github.com/cli/go-gh/v2 for API access with gh CLI credentials
  • Views require REST API (GraphQL doesn't support view creation)
  • Field option creation for SINGLE_SELECT has API limitations (fields created, options require manual setup)
Original prompt

Make campaign project creation with view and custom field creation, etc. also accessiable via the cmd line.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 25, 2026 10:34
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Add campaign project creation with CLI access Add CLI command for campaign project creation with views and custom fields Jan 25, 2026
Copilot AI requested a review from mnkiefer January 25, 2026 10:43
@mnkiefer
Copy link
Contributor

@copilot How does this align with the create project from 'create-agentic-campaign' labelled issue trigger?

Copy link
Contributor Author

Copilot AI commented Jan 25, 2026

@copilot How does this align with the create project from 'create-agentic-campaign' labelled issue trigger?

The CLI command aligns with the automated workflow in several key ways:

Shared Implementation:

  • Both use the same ProjectView and ProjectFieldDefinition types from pkg/workflow/update_project.go
  • Both support identical field types (TEXT, DATE, SINGLE_SELECT, NUMBER) and view layouts (board, table, roadmap)
  • Both use the same GraphQL mutations for project creation and field definitions

Key Differences:

  1. Execution Context:

    • Automated workflow: AI agent-driven via JavaScript in actions/setup/js/create_project.cjs within GitHub Actions
    • CLI command: Direct user-driven via Go in pkg/cli/campaign_create_project_command.go from local machine
  2. Authentication:

    • Automated workflow: Uses GH_AW_PROJECT_GITHUB_TOKEN secret configured in repository
    • CLI command: Uses authenticated gh CLI session from user's environment
  3. Configuration Format:

    • Automated workflow: YAML frontmatter in campaign generator (pkg/campaign/generator.go lines 72-116)
    • CLI command: Command-line flags with colon-separated syntax

Use Cases:

  • Automated workflow: Complete campaign setup (project + spec files + orchestrator) triggered by issue label
  • CLI command: Manual project creation for advanced users who want to set up projects separately before campaign spec creation

Both produce identical GitHub Projects V2 with the same views and custom fields. The CLI command provides the same project creation capability but as a standalone tool for users who prefer manual workflows.

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.

2 participants