Copilot/CLI

From Omnia
Jump to navigation Jump to search

Copilot CLI

Copilot CLI Installation

Scripted Install

See https://github.com/github/copilot-cli

User Install: (installs to: $HOME/.local/bin/copilot)

curl -fsSL https://gh.io/copilot-install | bash
wget -qO- https://gh.io/copilot-install | bash

Global Install: (installs to: /usr/local/bin/copilot)

curl -fsSL https://gh.io/copilot-install | sudo bash
wget -qO- https://gh.io/copilot-install | sudo bash

Install in GitHub CLI

Install GitHub CLI

1. Install GitHub CLI

Choose the command for your operating system:

macOS:

brew install gh

Windows (Winget):

winget install GitHub.cli

Windows (Scoop):

scoop install gh

Linux (Ubuntu/Debian):

sudo apt install gh

Linux (Fedora/RHEL):

sudo dnf install gh

GH Authenticate

2. Authenticate:

gh auth login

Install GH Copilot Extension

3. Install the Copilot Extension:

gh extension install github/gh-copilot

Update GH Copilot Extension

4. Update the Extension (Optional)

gh extension upgrade gh-copilot

Use GH Copilot CLI

5. Use the CLI

gh copilot explain "command"
gh copilot suggest "what you want to do"

If you want, I can help you set up aliases (like ?? or git?) to make triggering Copilot suggestions much faster in your shell. Let me know if you use Bash, Zsh, or PowerShell.

References to GH Copilot CLI

References

Install keyring dependency

If you do not have the credential manager setup you will get this warning when you try to "/login":

 ! System vault not available

 The recommended secure storage (keychain, keyring, or credential manager) could not be found or accessed.
 You may need to install or configure one.

 Storing the token in the config file saves it as plain text, which is insecure. If you decline, sign-in
 will be cancelled and no account state will be changed.

 Store token in plain text config file?

To fix:

sudo apt update
sudo apt install -y gnome-keyring libsecret-1-0 libsecret-tools seahorse

Verify secret-tool is accessible:

command -v secret-tool

Login:

copilot -i /login


Sigh - actually CLI can't handle being headless... just accept it!

Write it plain text...

 ~/.copilot/config.json

Alt:

gh auth token
export COPILOT_GITHUB_TOKEN="your_github_pat_here"

Actually -- virtual dbus should work?

sudo apt update && sudo apt install -y libsecret-1-0 libsecret-tools gnome-keyring

launch mock dbus:

dbus-run-session -- bash

Inside the virtual session, try run copilot login there?


# Interesting packages also installed by gnome-keyring:
#   libpam-gnome-keyring  libsecret-1-0  libsecret-common  pinentry-gnome3
# Additional packages that might be useful (recommended)
#   ssh-askpass  libsecret-tools  keychain
# Another keyring db for other usage
#   sudo apt install python3-keyring python3-keyrings.alt
#     # which also installs:  python3-pycryptodome  python3-secretstorage
#   # or
#   python3 -m pip install keyring keyrings.alt keyrings.cryptfile
#    ~/.config/python_keyring
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
   gnome-keyring libsecret-1-0 libsecret-tools
sudo loginctl enable-linger "$USER"

Once per reboot:

printf '%s' "$PASSWORD" | gnome-keyring-daemon --daemonize --unlock --components=secrets

Verify:

printf 'x' | secret-tool store --label=test service probe account me
secret-tool lookup service probe account me   # -> x

info:

gnome-keyring	The daemon that owns org.freedesktop.secrets
libsecret-1-0	Client library Copilot CLI links against
libsecret-tools	secret-tool, for verifying the store works

setup-keyring

See setup-keyring.sh

Login

First, install keychain, keyring, or credential manager

/login
https://github.com/login/device
/logout

Set Model

Set Model:

/config model claude-opus-5

Common options:

  • claude-opus-5
  • claude-sonnet-4.5
  • claude-haiku-4.5


Set effort level: ("Reasoning effort for models that support it")

/config effortLevel max
/config effortLevel xhigh
  options: none, minimal, low, medium, high, xhigh, max

Calude Opus 5 supports effort levels, but Claude Sonnet 4.5 and Claude Haiku 4.5 do not

Multi-Line

Use: Ctrl+g to bring up vim

Or alt+enter

Note: shift+enter does not work

Disable Mouse Control

/config mouse off

YOLO

All permissions are enabled. Tool, path, and URL requests are automatically approved.

/yolo on
/yolo off
/yolo show
/config footer.showYolo on

Footer Status

/config footer.showAgent on
/config footer.showAiUsed on
/config footer.showModelEffort on
/config footer.showQuota on
/config footer.showYolo on


footer = {"showModelEffort":true,"showQuota":true,"showAiUsed":true,"showAgent":true,"showYolo":true}

keywords