Copilot/CLI: Difference between revisions
| (7 intermediate revisions by the same user not shown) | |||
| Line 151: | Line 151: | ||
See [[setup-keyring.sh]] | See [[setup-keyring.sh]] | ||
== Update Copilot == | |||
sudo copilot update | |||
== Login == | == Login == | ||
| Line 168: | Line 172: | ||
Common options: | Common options: | ||
* claude-sol | |||
* claude-opus-5.5 | * claude-opus-5.5 | ||
* claude-opus-5 | * claude-opus-5 | ||
| Line 180: | Line 185: | ||
options: none, minimal, low, medium, high, xhigh, max | options: none, minimal, low, medium, high, xhigh, max | ||
Claude Opus 5 supports effort levels, but Claude Sonnet 4.5 and Claude Haiku 4.5 do not | |||
sol-6.1: | |||
<pre> | |||
"model": "gpt-6.1-sol", | |||
"effortLevel": "max", | |||
</pre> | |||
== Multi-Line == | == Multi-Line == | ||
| Line 244: | Line 256: | ||
} | } | ||
</pre> | </pre> | ||
== Skill List == | |||
Run: | |||
copilot skill list | |||
Within: | |||
/skills list | |||
== ask_user tool == | == ask_user tool == | ||
| Line 304: | Line 324: | ||
and say which ones you used. Do not immediately re-ask the same question. | and say which ones you used. Do not immediately re-ask the same question. | ||
</pre> | </pre> | ||
== Test Upgrade == | |||
mkdir /tmp/copilot-install | |||
cd /tmp/copilot-install | |||
wget https://github.com/github/copilot-cli/releases/download/v1.0.92/copilot-linux-x64.tar.gz | |||
tar -zvxf copilot-linux-x64.tar.gz | |||
md5sum copilot | |||
2a39acba8ff9e6db2db78d27dc273331 copilot | |||
./copilot version | |||
GitHub Copilot CLI 1.0.92 | |||
# mv ~/.copilot/ ~/.copilot.bak/ | |||
# mv ~/.cache/copilot/ ~/.cache/.copilot.bak/ | |||
rm -rf ~/.cache/copilot | |||
# sudo rm -rf ~/.copilot | |||
sudo rm -rf ~/.cache/copilot | |||
sudo rm -f /usr/local/bin/copilot | |||
sudo cp copilot /usr/local/bin/copilot | |||
# or: sudo ./copilot -i install | |||
rm -f ~/.local/bin/copilot | |||
cp copilot ~/.local/bin/copilot | |||
# ./copilot -i install | |||
sudo copilot version | |||
GitHub Copilot CLI 1.0.92 | |||
sudo copilot update | |||
sudo ./copilot version | |||
GitHub Copilot CLI 1.0.93 | |||
sudo copilot version | |||
GitHub Copilot CLI 1.0.93 | |||
copilot version | |||
GitHub Copilot CLI 1.0.92 | |||
copilot update | |||
./copilot version | |||
GitHub Copilot CLI 1.0.93 | |||
copilot version | |||
GitHub Copilot CLI 1.0.93 | |||
sudo copilot version | |||
GitHub Copilot CLI 1.0.92 | |||
md5sum copilot | |||
2a39acba8ff9e6db2db78d27dc273331 copilot | |||
md5sum /usr/local/bin/copilot | |||
2a39acba8ff9e6db2db78d27dc273331 copilot | |||
strings copilot | grep -i "Copilot binary version" | |||
..........{process.stdout.write("Copilot binary version: 1.0.92".......... | |||
== Custom Instructions and Skills DIRS == | |||
Adding custom instructions for GitHub Copilot CLI - GitHub Docs | |||
https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-custom-instructions | |||
COPILOT_CUSTOM_INSTRUCTIONS_DIRS | |||
Additional AGENTS.md and *.instructions.md files. Separate multiple directories with commas. | |||
Adding agent skills for GitHub Copilot CLI - GitHub Docs | |||
https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-skills | |||
GitHub Copilot CLI command reference - GitHub Docs | |||
https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference | |||
COPILOT_SKILLS_DIRS | |||
Comma-separated list of additional directories for skills. | |||
== keywords == | == keywords == | ||
Latest revision as of 21:28, 16 October 2026
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
- https://docs.github.com/en/copilot/how-tos/copilot-cli/set-up-copilot-cli/install-copilot-cli
- https://www.linkedin.com/posts/github_have-you-tried-github-copilot-in-the-cli-activity-7179897577172074496-jw4T
- https://www.linkedin.com/posts/juliangoldieseo_new-github-copilot-cli-is-insane-activity-7377931244484964352-mr2Y
- https://itnext.io/getting-started-with-github-copilot-66fb63c88cbe
- https://apito.ai/en/blog/tools/github-copilot-claudeapi-byok-setup/
- https://www.promptfu.com/blog/github-copilot-cli-mastery-guide/
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
Update Copilot
sudo copilot update
Login
First, install keychain, keyring, or credential manager
/login
https://github.com/login/device
/logout
Set Model
Set Model:
/config model claude-opus-5.5
Common options:
- claude-sol
- claude-opus-5.5
- claude-opus-5
- claude-sonnet-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
Claude Opus 5 supports effort levels, but Claude Sonnet 4.5 and Claude Haiku 4.5 do not
sol-6.1:
"model": "gpt-6.1-sol", "effortLevel": "max",
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
/config defaultPermissionMode allow-all
Auto enable options:
- Add defaultPermissionMode: allow-all to ~/.copilot/settings.json (recommended)
- Add alias copilot='copilot --yolo' to ~/.bashrc (also covers resume and -p)
/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}
settings.json file
$ cat ~/.copilot/settings.json
{
"model": "claude-opus-5.5",
"effortLevel": "max",
"footer": {
"showYolo": true,
"showQuota": true,
"showModelEffort": true,
"showAiUsed": true,
"showAgent": true
},
"mouse": false,
"defaultPermissionMode": "allow-all"
}
Skill List
Run:
copilot skill list
Within:
/skills list
ask_user tool
- I'll note to use the ask_user tool for open-ended questions going forward...
- "Can you save to my profile, or user setting to *always* use the 'ask_user tool' when you ask me a question, and to always provide a "open ended" option please
- "Good — I'll wire that in as a standing rule. Let me check where user-level (not repo-level) preferences belong for this CLI. "
- $HOME/.copilot/copilot-instructions.md is the user-level (all-repos) instructions file — it doesn't exist yet, so I'll create it.
profile copilot-instructions.md
$HOME/.copilot/copilot-instructions.md
$HOME/.copilot/copilot-instructions.md
# User Standing Instructions (Kenneth) These are profile-wide preferences. They apply in every repository and every session, and take precedence over default response habits. Repository-specific instructions still govern their own domain (coding standards, branch naming, project workflows). ## Asking Questions **Always use the `ask_user` tool to ask me a question.** Never ask a question in plain response text and then stop, and never end a response with a bare question expecting me to answer in chat. If you need input, a decision, a preference, or a clarification — present it through `ask_user` so it renders as a structured form. This applies to every kind of question, including: - Choosing between implementation approaches - Confirming a destructive or hard-to-reverse action before taking it - Resolving ambiguous requirements or unclear scope - Asking where output should go, or what to do next - Single yes/no confirmations (a one-field form is fine) **Always include an open-ended option.** Every `ask_user` form must give me a way to answer in my own words rather than forcing a pick from your list. Concretely: - Add a final free-text field — typically `other`, titled something like "Something else / in my own words", with a description inviting a freeform answer and making clear it overrides the structured selections above. - For a single-choice field, also include an escape-hatch option in the `enum`/`oneOf` list itself (for example "Something else — I'll explain") so the open-ended path is visible at the point of choosing, not only in a separate field. - Never present a closed set of options as if it were exhaustive. Your options are suggestions, not a menu I am confined to. **Recommend, don't just enumerate.** State which option you'd pick and why, then set it as the `default`. I would rather correct a considered recommendation than arbitrate a neutral list. **Batch related questions.** If several decisions belong to the same topic, put them in one form rather than asking serially. Keep unrelated topics in separate forms. **Respect a declined or cancelled form.** If I decline, proceed with the stated defaults and say which ones you used. Do not immediately re-ask the same question.
Test Upgrade
mkdir /tmp/copilot-install cd /tmp/copilot-install wget https://github.com/github/copilot-cli/releases/download/v1.0.92/copilot-linux-x64.tar.gz tar -zvxf copilot-linux-x64.tar.gz md5sum copilot 2a39acba8ff9e6db2db78d27dc273331 copilot ./copilot version GitHub Copilot CLI 1.0.92 # mv ~/.copilot/ ~/.copilot.bak/ # mv ~/.cache/copilot/ ~/.cache/.copilot.bak/ rm -rf ~/.cache/copilot # sudo rm -rf ~/.copilot sudo rm -rf ~/.cache/copilot
sudo rm -f /usr/local/bin/copilot sudo cp copilot /usr/local/bin/copilot # or: sudo ./copilot -i install
rm -f ~/.local/bin/copilot cp copilot ~/.local/bin/copilot # ./copilot -i install
sudo copilot version GitHub Copilot CLI 1.0.92 sudo copilot update sudo ./copilot version GitHub Copilot CLI 1.0.93 sudo copilot version GitHub Copilot CLI 1.0.93
copilot version GitHub Copilot CLI 1.0.92 copilot update ./copilot version GitHub Copilot CLI 1.0.93 copilot version GitHub Copilot CLI 1.0.93
sudo copilot version GitHub Copilot CLI 1.0.92 md5sum copilot 2a39acba8ff9e6db2db78d27dc273331 copilot md5sum /usr/local/bin/copilot 2a39acba8ff9e6db2db78d27dc273331 copilot
strings copilot | grep -i "Copilot binary version"
..........{process.stdout.write("Copilot binary version: 1.0.92"..........
Custom Instructions and Skills DIRS
Adding custom instructions for GitHub Copilot CLI - GitHub Docs https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-custom-instructions COPILOT_CUSTOM_INSTRUCTIONS_DIRS Additional AGENTS.md and *.instructions.md files. Separate multiple directories with commas.
Adding agent skills for GitHub Copilot CLI - GitHub Docs https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-skills
GitHub Copilot CLI command reference - GitHub Docs https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference COPILOT_SKILLS_DIRS Comma-separated list of additional directories for skills.