{"id":13942351,"url":"https://github.com/github/gh-copilot","last_synced_at":"2025-05-15T04:06:32.977Z","repository":{"id":206266174,"uuid":"710311348","full_name":"github/gh-copilot","owner":"github","description":"Ask for assistance right in your terminal.","archived":false,"fork":false,"pushed_at":"2025-02-10T23:07:50.000Z","size":16,"stargazers_count":932,"open_issues_count":56,"forks_count":52,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-04-14T05:58:27.570Z","etag":null,"topics":["gh-extension"],"latest_commit_sha":null,"homepage":"https://docs.github.com/en/copilot/github-copilot-in-the-cli","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/github.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-10-26T12:52:26.000Z","updated_at":"2025-04-13T10:36:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"6568e6db-642f-4b94-b865-524e5f89b8bc","html_url":"https://github.com/github/gh-copilot","commit_stats":{"total_commits":15,"total_committers":3,"mean_commits":5.0,"dds":0.4,"last_synced_commit":"33cfb91fb501197ae87bcd5e95cbdea4e609e361"},"previous_names":["github/gh-copilot"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fgh-copilot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fgh-copilot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fgh-copilot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fgh-copilot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/github","download_url":"https://codeload.github.com/github/gh-copilot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270646,"owners_count":22042859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gh-extension"],"created_at":"2024-08-08T02:01:49.435Z","updated_at":"2025-05-15T04:06:27.967Z","avatar_url":"https://github.com/github.png","language":null,"readme":"# GitHub Copilot in the CLI\n\nGitHub Copilot in the CLI is an extension for [GitHub CLI](https://cli.github.com/) which provides a chat-like interface in the terminal that allows you to ask questions about the command line. You can ask Copilot in the CLI to suggest a command for your use case with `gh copilot suggest`, or to explain a command you're curious about with `gh copilot explain`.\n\nFor use cases, enabling, and limitations, see \"[GitHub Copilot in the CLI](https://docs.github.com/en/copilot/github-copilot-in-the-cli)\".\n\nFor what data is collected, used, and shared, see \"[Privacy Policies](https://docs.github.com/en/site-policy/privacy-policies/)\".\n\nFor help troubleshooting connectivity, see \"[Troubleshooting network errors for GitHub Copilot](https://docs.github.com/en/copilot/troubleshooting-github-copilot/troubleshooting-network-errors-for-github-copilot)\".\n\n## Quickstart\n\n\u003e [!NOTE]\n\u003e To use and install GitHub Copilot in the CLI, you must have an active [GitHub Copilot](https://github.com/features/copilot) subscription, have [GitHub CLI](https://cli.github.com/) installed, and authenticate using the GitHub CLI OAuth app.\n\u003e\n\u003e Classic and fine-grained PATs are currently unsupported and might require clearing the `GITHUB_TOKEN` and `GH_TOKEN` environment variables.\n\n\u003e [!IMPORTANT]\n\u003e GitHub Copilot in the CLI does not currently have plans to support 32-bit Android distributions.\n\u003e\n\u003e For more information, see https://github.com/github/gh-copilot/issues/122.\n\n1. Authenticate with GitHub CLI OAuth app\n   ```shell\n   gh auth login --web\n   ```\n1. Install / upgrade extension\n   ```shell\n   gh extension install github/gh-copilot --force\n   ```\n1. Suggest a command\n   ```shell\n   gh copilot suggest \"Install and configure git lfs\"\n   ```\n1. Explain a command\n   ```shell\n   gh copilot explain 'git lfs migrate import --everything --include=\"*.gz,*.png,*.jar\"'\n   ```\n\n## Usage\n\n```shell\n$ gh copilot --help\nYour AI command line copilot.\n\nUsage:\n  copilot [command]\n\nExamples:\n\n$ gh copilot suggest \"Install git\"\n$ gh copilot explain \"traceroute github.com\"\n\n\nAvailable Commands:\n  alias       Generate shell-specific aliases for convenience\n  config      Configure options\n  explain     Explain a command\n  suggest     Suggest a command\n\nFlags:\n  -h, --help              help for copilot\n      --hostname string   The GitHub host to use for authentication\n  -v, --version           version for copilot\n\nUse \"copilot [command] --help\" for more information about a command.\n```\n\n### Multi-account notes\n\nMulti-account users can use `--hostname` flag or `GH_HOST` environment variable to specify the GitHub hostname for commands that would otherwise assume the `github.com` host.\n\n## Set up optional helpers\n\n**Is `gh copilot suggest ...` too many keystrokes?  Do you want support for executing suggestions and keeping them in history?**\n\n[`v1.0.0`](https://github.com/github/gh-copilot/releases/tag/v1.0.0) introduces `gh copilot alias`, which generates shell configuration for `ghcs` and `ghce` aliases that wrap `gh copilot suggest` and `gh copilot explain`.  These aliases provide faster invocation and support executing suggested commands if applicable.  Executed suggestions are added to your shell history for reuse later.\n\n```shell\n$ ghcs print \"Hello world\"\n\nWelcome to GitHub Copilot in the CLI!\nversion 1.0.0 (2024-03-21)\n\nI'm powered by AI, so surprises and mistakes are possible. Make sure to verify any generated code or suggestions, and share feedback so that we can learn and improve. For more information, see https://gh.io/gh-copilot-transparency\n\nSuggestion:\n\n  echo \"Hello world\"\n\n? Select an option\n\u003e Execute command\n\n? Are you sure you want to execute the suggested command?\n\u003e Yes\n\nHello world\n```\n\nTo setup these optional helpers, see below for setup instructions for supported shells:\n\n- [bash](#bash)\n- [powershell](#powershell)\n- [zsh](#zsh)\n\nFor more information, run `gh copilot alias --help`.\n\nFor changing the execute command confirmation behavior, run `gh copilot config` to change `Default value for confirming command execution`.\n\n### Bash\n\n```bash\necho 'eval \"$(gh copilot alias -- bash)\"' \u003e\u003e ~/.bashrc\n```\n\n### PowerShell\n\n\u003e [!NOTE]\n\u003e PowerShell users might need to update the file containing `gh-copilot` helpers after updating the extension.\n\n```pwsh\n$GH_COPILOT_PROFILE = Join-Path -Path $(Split-Path -Path $PROFILE -Parent) -ChildPath \"gh-copilot.ps1\"\ngh copilot alias -- pwsh | Out-File ( New-Item -Path $GH_COPILOT_PROFILE -Force )\necho \". `\"$GH_COPILOT_PROFILE`\"\" \u003e\u003e $PROFILE\n```\n\n### Zsh\n\n```zsh\necho 'eval \"$(gh copilot alias -- zsh)\"' \u003e\u003e ~/.zshrc\n```\n\n## Metrics sent to GitHub\n\nGitHub Copilot in the CLI sends certain metrics to our analytics system. We want you to understand what is being\nsent and why it's important to our ability to continue to improve the product and provide you with a better experience\nover time.\n\n### Why do we need usage stats?\n\nOur team uses metrics to prioritize our work and evaluate whether we are successful in solving real user problems after\nwe've released something. For example, when we release a new version and see a spike in exceptions and response ratings,\nwe want to understand if there is a regression or a platform issue causing problems.\n\nThe more people who opt in to send usage stats, the more information we have to base our decision-making on. And if you\nwant us to take your use cases into consideration, we hope you'll opt in so we get a better idea of how you use the app\nand whether or not it's meeting your needs. GitHub Copilot in the CLI will send a payload in the format below to our\nanalytics system unless you've opted out. We are very sensitive to the privacy of our users and we never look at the data\nof specific individuals, but rather only examine aggregate data and trends to inform our product decisions.\n\nYou can change your opt-in setting at any time in `gh copilot config`:\n\n```\n$ gh copilot config\n\nWelcome to GitHub Copilot CLI!\nversion 0.3.0-beta (2023-10-31)\n\nI'm powered by AI, so surprises and mistakes are possible. Make sure to verify any generated code or suggestions, and share feedback so that we can learn and improve.\n\n? What would you like to configure?\n\u003e Optional Usage Analytics\n\n? Allow GitHub to collect optional usage data to help us improve? This data does not include your queries.  [Use arrows to move, type to filter]\n\u003e Yes\n  No\n```\n\n### Example usage stats\n\n```json\n{\n\t\"platform\": \"darwin\",\n\t\"architecture\": \"arm64\",\n\t\"version\": \"1.1.0\",\n\t\"custom_event\": \"true\",\n\t\"event_parent_command\": \"explain\",\n\t\"event_name\": \"Explain\",\n\t\"sha\": \"089a53215fc4383179869f7f6132ce9d6e58754a\",\n\t\"thread_id\": \"e61d0d08-f6ba-465b-81cf-c30fd9127d70\",\n\t\"host\": \"github.com\"\n}\n```\n","funding_links":[],"categories":["Others","Misc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fgh-copilot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithub%2Fgh-copilot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fgh-copilot/lists"}