Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate gh copilot alias #3

Open
wasertech opened this issue Jul 15, 2024 · 0 comments
Open

Integrate gh copilot alias #3

wasertech opened this issue Jul 15, 2024 · 0 comments

Comments

@wasertech
Copy link
Owner

Copilot added a shell-specific aliases generator function.

❯ gh copilot alias --help
Generate optional shell-specific aliases and functions for invoking gh copilot commands.

These aliases and functions are not required to use gh copilot, but they can be useful for convenience as they require fewer keystrokes and aid in executing suggested commands:

- `ghce`: wraps `gh copilot explain`
- `ghcs`: wraps `gh copilot suggest`, adding support for executing suggestions

Usage:
  copilot alias <shell> [flags]

Examples:

# Add aliases to Bash configuration
$ echo 'eval "$(gh copilot alias -- bash)"' >> ~/.bashrc

# Add aliases to PowerShell profile
$ $GH_COPILOT_PROFILE = Join-Path -Path $(Split-Path -Path $PROFILE -Parent) -ChildPath "gh-copilot.ps1"
$ gh copilot alias -- pwsh | Out-File ( New-Item -Path $GH_COPILOT_PROFILE -Force )
$ echo ". `"$GH_COPILOT_PROFILE`"" >> $PROFILE

# Add aliases to Zsh configuration
$ echo 'eval "$(gh copilot alias -- zsh)"' >> ~/.zshrc


Flags:
  -h, --help   help for alias

Global Flags:
      --hostname string   The GitHub host to use for authentication

Could be added into CodePilot first initialization.

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

No branches or pull requests

1 participant