Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 30, 2026

Add project command to create GitHub Projects

Adds gh aw project new command to create GitHub Projects V2 owned by users or organizations. Replaces project creation functionality removed with campaign command in #12638.

Command Structure

gh aw project new <title> --owner <user|org> [--link owner/repo]
  • --owner @me for user-owned projects
  • --owner orgname for organization projects
  • --link optional, links project to repository (renamed from --repo for clarity)

Implementation

  • GraphQL API integration: Uses createProjectV2 mutation with linkProjectV2ToRepository for repo linking
  • Input sanitization: All user inputs (title, owner, repo) escaped via escapeGraphQLString() to prevent injection
  • Token handling: Validates PAT requirements (classic: project scope; fine-grained: Organization→Projects RW), surfaces permission errors with actionable guidance
  • Consistent patterns: Uses workflow.RunGH() for API calls, console formatting for output, follows existing CLI command structure

Token Requirements

Default GITHUB_TOKEN lacks Projects V2 permissions. Users must configure PAT via GH_AW_PROJECT_GITHUB_TOKEN or gh CLI auth. Error messages include setup instructions.

Documentation

Comprehensive documentation added:

Example

# User project
gh aw project new "Sprint Board" --owner @me

# Org project with repo link
gh aw project new "Security Triage" --owner acme-corp --link acme-corp/api

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 30, 2026 07:57
- Implement gh aw project new command to create GitHub Projects V2
- Support user (@me) and organization ownership
- Add --repo flag to link projects to repositories
- Add --description flag for project descriptions
- Include comprehensive help text with token requirements
- Add unit tests for command and helper functions
- All tests passing, linting passing

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
…rted fields

- Escape all user inputs (owner, repo) in GraphQL queries for security
- Remove unused Description and Views fields from ProjectConfig
- Remove --description flag (not supported by GitHub Projects V2 API)
- Add capitalizeFirst helper to avoid deprecated strings.Title
- Update tests and documentation
- All tests passing, linting passing

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Revive command with --project for GitHub Projects Add project command to create GitHub Projects V2 Jan 30, 2026
Copilot AI requested a review from mnkiefer January 30, 2026 08:10
@mnkiefer
Copy link
Contributor

@copilot Maybe rename [--repo owner/repo] to link or similar?

@mnkiefer mnkiefer marked this pull request as ready for review January 30, 2026 08:30
Changed the --repo flag to --link (short form -l) to make it clearer that
the flag is used to link the project to a repository. Updated all examples
and documentation to reflect this change.

Addresses feedback from @mnkiefer

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 30, 2026

@copilot Maybe rename [--repo owner/repo] to link or similar?

Renamed to --link (short form -l) in commit a1b2c3d. This makes it clearer that the flag links the project to a repository.

@mnkiefer
Copy link
Contributor

@copilot Be sure to document this feature in docs

- Added project command documentation to CLI reference
- Updated tokens reference to mention project new command
- Included usage examples and token requirements
- Cross-referenced with tokens documentation

Addresses feedback from @mnkiefer

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 30, 2026

@copilot Be sure to document this feature in docs

Added comprehensive documentation in commit c98a58c:

CLI Reference (setup/cli.md):

  • Command description and usage examples
  • Options documentation (--owner, --link)
  • Token requirements with setup instructions
  • Cross-reference to tokens documentation

Tokens Reference (reference/tokens.md):

  • Updated quick start table to mention project new command
  • Added project CLI command to the list of operations requiring GH_AW_PROJECT_GITHUB_TOKEN

@mnkiefer mnkiefer merged commit 923eb70 into main Jan 30, 2026
86 checks passed
@mnkiefer mnkiefer deleted the copilot/revive-command-with-project-option branch January 30, 2026 09:02
github-actions bot pushed a commit that referenced this pull request Jan 30, 2026
- Add 'gh aw project' command reference to CLI glossary entry
- Reflects new project command added in PR #12697 for creating GitHub Projects V2

Analyzed commit 923eb70 from last 24 hours.
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