Skip to content

Commit 6eba57b

Browse files
committed
feat: add ghcs and ghce abbrs
0 parents  commit 6eba57b

File tree

7 files changed

+114
-0
lines changed

7 files changed

+114
-0
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
charset = utf-8
4+
end_of_line = lf
5+
tab_width = 1
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2025 Asim Tahir
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<img src="https://cdn.rawgit.com/oh-my-fish/oh-my-fish/e4f1c2e0219a17e2c748b824004c8d0b38055c16/docs/logo.svg" align="left" width="192px" height="192px"/>
2+
<img align="left" width="0" height="192px" hspace="10"/>
3+
4+
### `github-copilot-cli.fish`
5+
6+
> `GitHub Copilot CLI` plugin for [Oh My Fish][omf] and [Fisher][fisher],
7+
8+
[![MIT License](https://img.shields.io/badge/license-MIT-007EC7.svg?style=flat-square)](/LICENSE)
9+
[![Fish Shell v3.6.0](https://img.shields.io/badge/fish-v3.6.0-007EC7.svg?style=flat-square)](https://fishshell.com)
10+
[![Oh My Fish Framework](https://img.shields.io/badge/Oh%20My%20Fish-Framework-007EC7.svg?style=flat-square)][omf]
11+
12+
<br/>
13+
14+
## Prerequisites
15+
16+
- [GitHub CLI](https://cli.github.com/) installed and authenticated.
17+
- [GitHub Copilot CLI extension](https://docs.github.com/en/copilot/managing-copilot/configure-personal-settings/installing-github-copilot-in-the-cli) installed.
18+
19+
## Install
20+
21+
[Oh My Fish][omf]:
22+
23+
```fish
24+
omf install https://github.com/Asim-Tahir/github-copilot-cli.fish
25+
```
26+
27+
[Fisher][fisher]:
28+
29+
```fish
30+
fisher install Asim-Tahir/github-copilot-cli.fish
31+
```
32+
33+
## Abbreviations Usage
34+
35+
After installing the [`github-copilot-cli.fish`][repo] plugin, can inspect the abbreviations with the following command:
36+
37+
```fish
38+
abbr --show | grep ghcs
39+
```
40+
41+
| Abbreviation | Command |
42+
| ------------ | -------------------- |
43+
| `ghcs` | `gh copilot suggest` |
44+
| `ghce` | `gh copilot explain` |
45+
46+
# Credit
47+
48+
Base structure heavily inspired from [`jhillyerd/plugin-git`](https://github.com/jhillyerd/plugin-git). Thanks for the amazing plugin.
49+
50+
# License
51+
52+
[MIT][license] © [Asim Tahir][author]
53+
54+
[author]: https://github.com/Asim-Tahir
55+
[repo]: https://github.com/Asim-Tahir/github-copilot-cli.fish
56+
[license]: https://opensource.org/licenses/MIT
57+
[omf]: https://github.com/oh-my-fish/oh-my-fish
58+
[fisher]: https://github.com/jorgebucaran/fisher
59+
[license-badge]: https://img.shields.io/badge/license-MIT-007EC7.svg?style=flat-square

conf.d/github-copilot-cli.fish

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Fisher initialization
2+
# protected as omf also tries to run it.
3+
set -q fisher_path; or set -l fisher_path $__fish_config_dir
4+
if test -f $fisher_path/functions/_github-copilot-cli.init.fish
5+
source $fisher_path/functions/_github-copilot-cli.init.fish
6+
_github-copilot-cli.init
7+
end
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
function _github-copilot-cli.abbrs -d "Initialize GitHub Copilot Command Line Interface(CLI) abbreviations"
2+
abbr -a -g ghcs gh copilot suggest
3+
abbr -a -g ghce gh copilot explain
4+
end
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
function _github-copilot-cli.init -d "Initialize GitHub Copilot Command Line Interface(CLI) plugin"
2+
# Initialize GitHub Copilot CLI abbreviations
3+
_github-copilot-cli.abbrs
4+
end

init.fish

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Oh My Fish initialization
2+
# $path is only defined for oh-my-fish. home-manager activates this plugin by
3+
# adding the full path of functions/ to fish_function_path, and then sourcing
4+
# init.fish, so let's skip sourcing _github-copilot-cli.init.fish before calling _github-copilot-cli.init.
5+
set -l _github_copilot_cli_init_path "$path/functions/_github-copilot-cli.init.fish"
6+
if [ -f "$_github_copilot_cli_init_path" ];
7+
source "$_github_copilot_cli_init_path"
8+
end
9+
10+
_github-copilot-cli.init

0 commit comments

Comments
 (0)