🌐 US-Proxy
class="sans-serif-article-body default-header" data-user-status="logged-out" data-is-root-subforem="false" data-subforem-id="1" data-side-nav-visible="true" data-community-name="DEV Community" data-subscription-icon="https://assets.dev.to/assets/subscription-icon-805dfa7ac7dd660f07ed8d654877270825b07a92a03841aa99a1093bd00431b2.png" data-locale="en" data-honeybadger-key="hbp_nqu4Y66HuEKlD6YRGssZuRQnPOjDm50J8Zkr" data-deployed-at="2026-08-07T14:16:29Z" data-latest-commit-id="66284e4698b4d519eeec085df1866c6ef6569518" data-ga-tracking="UA-71991109-1" data-cookie-banner-user-context="logged_out_only" data-cookie-banner-platform-context="off" data-algolia-id="PRSOBFP46H" data-algolia-search-key="9aa7d31610cba78851c9b1f63776a9dd" data-algolia-display="true" data-dynamic-url-component="bmar11" data-ga4-tracking-id="G-TYEM8Y3JN3" data-global-feature-flags-enabled="data_update_scripts onboarding_newsletter_content schedule_articles moderator_role display_ad_tags replace_unicorn_with_jump_to_comments article_id_adjusted_weight cloudflare_preferred_for_hosted_images multiple_reactions subscriber_icon ab_experiment_feed_strategy use_stories_endpoint digest_subject_testing digest_results_count_testing consistent_rendering discover_and_following_tabs hero_billboard onboarding_drip_emails algolia_frontend gemini_onboarding optimize_article_tag_query onboarding_custom_cta_slide dev_core_user_sync personalized_email_digests">

DEV Community

Cover image for GitHub CLI on Gitpod 🍊
Siddhant Khare
Siddhant Khare

Posted on • Edited on

GitHub CLI on Gitpod 🍊

What is GitHub CLI?

It is GitHub’s official command line tool. It brings pull requests, issues, and other GitHub concepts to the terminal next to where you are already working with git and your code.

So, Recently GitHub CLI made a new update to Run Your GitHub Workflow Files through Command Line.

What is GitPod?

Gitpod is an open-source Kubernetes application for ready-to-code developer environments that spins up fresh, automated dev environments for each task, in the cloud, in seconds. It enables you to describe your dev environment as code and start instant, remote and cloud-based developer environments directly from your browser or your Desktop IDE.

Open Your GitHub Repository in Gitpod:

just add this prefix following to your github repository: https://gitpod.io/#

Example: https://gitpod.io/#https://github.com/GITHUB_USERNAME/REPOSITORY_NAME/

GitHub CLI Setup at Gitpod (official docs):

Run Following Commands:

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
Enter fullscreen mode Exit fullscreen mode
sudo apt update
sudo apt install gh
Enter fullscreen mode Exit fullscreen mode

Output:

Installation of GitHub CLI on Gitpod

Setting up the Workflow:

  • Create a empty file under .github/workflows/ named as github-action-demo.yml

  • File Content:

    name: Demo
    
    on:
    # Triggers the workflow on push or pull request events but only for the main branch
    pull_request:
        branches: [main]
    
    # Allows you to run this workflow manually from the Actions tab
    workflow_dispatch:
    
    jobs:
    cli-gitpod:
        name: CLI and Gitpod Demo
        runs-on: ubuntu-latest
        steps:
        - name: Hello From Gitpod
            run: |
            echo "Hello! From Gitpod 🍊"
    

Login with gh cli

  • Run:

    gh auth login
    
  • Complete whole step and login.

Test & Run GitHub Workflow with gh cli:

  • To View the list of your workflows:

    gh workflow list
    

you Will not see anything, because you first have to enbale that workflow.

  • To Enable the workflow:

    gh workflow enable
    

Workflow Enabled

  • To Run the Workflow:

    gh workflow run demo
    

Here demo was my workflow name, you can replace it with your workflow's name.

Workflow Run

On GitHub Dashboard:

GitHub Dashboard

  • run history list & analysis:

    gh run list --workflow=github-action-demo.yml
    

github-action-demo.yml is the filename, replace it with your workflow's filename.

Run List

  • Specific Result of any run ID:

    gh run view 1703727006
    

1703727006 is ID, replace it with your workflow run ID.

Github workflow run view


Similarly, You Can Run all GitHub CLI Commands in GitPod (gh cli commands)


Contribute in the browser using Gitpod

GitHub logo Siddhant-K-code / github-cli-on-gitpod

Test GitHub CLI on Gitpod

What is GitHub CLI?

It is GitHub’s official command line tool. It brings pull requests, issues, and other GitHub concepts to the terminal next to where you are already working with git and your code.

So, Recently GitHub CLI made a new update to Run Your GitHub Workflow Files through Command Line.

What is GitPod?

Gitpod is an open-source Kubernetes application for ready-to-code developer environments that spins up fresh, automated dev environments for each task, in the cloud, in seconds. It enables you to describe your dev environment as code and start instant, remote and cloud-based developer environments directly from your browser or your Desktop IDE.

Open Your GitHub Repository in Gitpod:

just add this prefix following to your github repository: https://gitpod.io/#

Example: https://gitpod.io/#https://github.com/GITHUB_USERNAME/REPOSITORY_NAME/

GitHub CLI Setup at Gitpod (official docs):

Run Following Commands:

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
Enter fullscreen mode Exit fullscreen mode

Top comments (2)

Collapse
 
siddhantkcode profile image
Siddhant Khare

Thanks, Pauline :)