LinuxCommandLibrary

gh-project

Manage GitHub Projects

TLDR

List projects owned by the currently authenticated user

$ gh project [[ls|list]]
copy

List projects owned by a specific user or organization
$ gh project [[ls|list]] --owner [owner]
copy

View a project by number
$ gh project view [number] --owner [owner]
copy

Create a new project
$ gh project create --owner [owner] --title [project_title]
copy

Add an item (issue or pull request) to a project
$ gh project item-add [number] --owner [owner] --url [issue_or_pr_url]
copy

List items in a project
$ gh project item-list [number] --owner [owner]
copy

Close a project
$ gh project close [number] --owner [owner]
copy

SYNOPSIS

gh project <command> [<flags>]

PARAMETERS

create
    Create a new project from scratch or a template

delete
    Permanently delete a project

edit
    Edit project name, description, or settings

field
    Create, edit, delete, or list project fields

item
    Add, edit, remove, or list project items (issues/PRs)

list
    List projects for repository or owner

view
    View project details and layout

DESCRIPTION

gh project is a powerful subcommand of the official GitHub CLI (gh) tool, designed for Linux users to handle GitHub Projects (primarily v2) directly from the terminal.

GitHub Projects offer kanban-style boards to organize issues, pull requests, and custom data across repositories or organizations. This command streamlines workflows by allowing you to list, view, create, edit, and delete projects without the web interface.

Key capabilities include managing project fields (e.g., text, number, single-select, iteration, repo), adding/removing items (issues/PRs/drafts), and viewing interactive board layouts. It uses GitHub's GraphQL API for fast, precise operations, making it ideal for scripting, CI/CD integration, and terminal-centric development.

For example, list projects with gh project list, create one via gh project create, or add an item using gh project item-add. Supports both user (@me) and organization owners.

Enhances productivity for GitHub power users, replacing manual browser navigation with efficient CLI interactions.

CAVEATS

Requires GitHub CLI installed and gh auth login. Limited to accessible repos/projects; needs 'project' scope. Primarily supports Projects v2; classic projects deprecated.

COMMON FLAGS

--repo OWNER/REPO
--owner OWNER
--limit N
--help
--version

EXAMPLES

gh project list --owner @me
gh project create new-board --template
gh project view 123
gh project item-add 123 --field iteration --value "Next"

INSTALLATION

curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list >/dev/null
sudo apt update
sudo apt install gh

HISTORY

Introduced in GitHub CLI v2.14.0 (May 2023) with Projects v2 support. Evolved from earlier beta features; regular updates add field types, bulk ops, and GraphQL optimizations.

SEE ALSO

gh(1), gh-issue(1), gh-repo(1), git(1)

Copied to clipboard