GitHub Next์์ ๊ณต๊ฐํ Copilot for CLI๋ฅผ ์ฒดํํด๋ณด์์ต๋๋ค.
์จ๋ณด๊ธฐ ์ ์ ๐ถโ
GitHub Copilot์ด๋?โ
Copilot for CLI๋ GitHub์์ ๋ง๋ ์คํ์์ค ํ๋ก์ ํธ๋ก, GitHub Copilot์ CLI์์ ์ฌ์ฉํ ์ ์๊ฒ ํด์ค๋๋ค. ์์ ๋งํฌ์์ Sign up for the waitlist๋ฅผ ํด๋ฆญํ๋ฉด, GitHub Copilot์ ์ฌ์ฉํ ์ ์๋ ๊ธฐํ๋ฅผ ์ป์ ์ ์์ต๋๋ค.
์ผ๋ง๋ ๊ธฐ๋ค๋ ค์ผ ํ๋์?โ
์ธ์ ์ ์ฒญํ๋์ง ์ ํํ ๊ธฐ์ต์ด ๋์ง ์์ง๋ง, 1๋ฌ์ด ์ฑ ์ง๋์ง ์์ ์๋ ์ด๋ฉ์ผ์ด ๋์ฐฉํ์ต๋๋ค!
Copilot for CLI ์ค์นํ๊ธฐ ๐ โ
์ค์นโ
npm์ ์ฌ์ฉํ์ฌ ์ ์ญ ์ค์น๋ฅผ ์งํํฉ๋๋ค.
npm install -g @githubnext/github-copilot-cli
์ธ์ฆโ
Copilot for CLI๋ฅผ ์ฌ์ฉํ๊ธฐ ์ํด์๋ GitHub Copilot์ ์ธ์ฆ์ด ํ์ํฉ๋๋ค. ์ธ์ฆ์ ์ํด์๋ GitHub Copilot์ ๋ก๊ทธ์ธํ ํ, ์๋ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
github-copilot-cli auth
์๋ ์ด๋ฏธ์ง์ ๊ฐ์ด ์ง์์ฌํญ์ ๋ฐ๋ผ์ ๋ก๊ทธ์ธํ๋ฉด, ์ธ์ฆ์ด ์๋ฃ๋ฉ๋๋ค.
Copilot for CLI ์ฌ์ฉํด๋ณด๊ธฐ ๐คโ
์คํํ๊ฒฝ : WSL Ubuntu 22.04
์ฐ์ github-copilot-cli -h
๋ก ๋ช
๋ น์ด๋ฅผ ํ์ธํด๋ด
๋๋ค.
Usage: Copilot CLI [options] [command]
A CLI experience for letting GitHub Copilot help you on the command line.
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
auth Retrieve and store a GitHub Access Token.
alias <shell path> Add convenient GitHub Copilot CLI aliases to your shell.
what-the-shell [options] <query...> Use GitHub Copilot to get shell commands from natural
language descriptions.
git-assist [options] <query...> Translate a natural language description of a git command to
an actual git command.
gh-assist [options] <query...> Convert plain english to GitHub CLI commands.
help [command] display help for command
alias ์ถ๊ฐํ๊ธฐโ
alias
๋ช
๋ น์ด๋ฅผ ์ฌ์ฉํ๋ฉด, Copilot for CLI๋ฅผ ์ฌ์ฉํ๊ธฐ ํธ๋ฆฌํ๊ฒ alias๋ฅผ ์ถ๊ฐํ ์ ์์ต๋๋ค.
eval "$(github-copilot-cli alias -- "$0")"
1. what-the-shell
(??
)โ
what-the-shell
๋ช
๋ น์ด๋ฅผ ์ฌ์ฉํ๋ฉด, GitHub Copilot์ ํตํด ์์ฐ์ด๋ก Shell ๋ช
๋ น์ด๋ฅผ ์์ฑํ ์ ์์ต๋๋ค.
recursiveํ๊ฒ ์ํ๋ ๋๋ ํ ๋ฆฌ(docs, blog, src)๋ง tree๋ก ์ถ๋ ฅํ๋ ๋ช ๋ น์ด๋ฅผ ์์ฑํด๋ณด๊ฒ ์ต๋๋ค.
github-copilot-cli what-the-shell "directory tree"
์์ alias ์ถ๊ฐํ๊ธฐ์์ ์ถ๊ฐํ alias๋ฅผ ์ฌ์ฉํ๋ฉด, ์๋์ ๊ฐ์ด ์ฌ์ฉํ ์ ์์ต๋๋ค.
?? "directory tree"
tree -R docs blog src
์ํ๋ ๋ช ๋ น์ด๊ฐ ๋์์ต๋๋ค! ๐
2. git-assist
(git?
)โ
git ๋ช ๋ น์ด๋ฅผ ์์ฐ์ด๋ก ์์ฑํ ์ ์์ต๋๋ค.
branch๋ฅผ ์ญ์ ํด๋ณด๊ฒ ์ต๋๋ค.
git-assist "delete branch" # git? "delete branch"
๊น๋จน๊ณ ์ ์ง์ด feature/giscus
branch๋ฅผ ์ญ์ ํ์ต๋๋ค ๐
3. gh-assist
(gh?
)โ
GitHub CLI๋ฅผ ์ฌ์ฉํด๋ณด์ง ์์๋ค๋ฉด, GitHub CLI๋ฅผ ๋จผ์ ์ค์นํด์ฃผ์ธ์. Windows๋ฅผ ์ ์ธํ OS์์๋ ๊ณต์ ๊ฐ์ด๋๋ฅผ ๋ฐ๋ผ์ ์ค์นํ์๋ฉด ๋ฉ๋๋ค.
GitHub CLI ๋ช ๋ น ๋ฐ ์ฟผ๋ฆฌ ์ธํฐํ์ด์ค์ ๊ฐ๋ ฅํ ๊ธฐ๋ฅ๊ณผ ๋ณต์กํ ํ๋๊ทธ์ jq ํํ์์ ๋์ ์์ฑํด์ค๋๋ค.
์๋ก์ด ์ด์๋ฅผ ์์ฑํด๋ณด๊ฒ ์ต๋๋ค.
gh-assist "open new issue" # gh? open new issue
์๋ก์ด ์ด์๋ฅผ ์์ฑํ์ต๋๋ค!
์ด์ ์๋ก์ด PR์ ์์ฑํด๋ณด๊ฒ ์ต๋๋ค.
gh-assist "open new pull request" # gh? open new pull request
์ถ๊ฐ์ ์ผ๋ก ์๋ 4๊ฐ์ง ์ง์์ฌํญ์ ์ถ๊ฐํ๊ฒ ์ต๋๋ค.
- title "Copilot for CLI ์ฒดํ๊ธฐ ๐ค"
- content "Close #27"
- assign to me
- label documentation
๊ทธ๋์ ์์ผ๋ก ์์ฑํ๋ PR์ github cli๋ก ์๋์ผ๋ก ์์ฑํ ์ ์๊ฒ ๋์์ต๋๋ค!
๋ง์น๋ฉฐ ๐โ
์ฐ์ ์๊ฐํ๋ ๊ฒ๋ณด๋ค ์ดํด๋ ฅ์ด ์ข์์ ๋๋์ต๋๋ค.
๊ทธ๋์ GUI ํ๊ฒฝ์ ์ต์ํด์ ธ์ CLI๋ฅผ ์ฌ์ฉํ ๋๋ ๋ฌด์ธ๊ฐ ๋ถํธํจ์ด ์์๋๋ฐ, Copilot for CLI๋ฅผ ์ฌ์ฉํ๋ฉด์ CLI๋ฅผ ์ฌ์ฉํ๋ ๋ฐ์๋ ์ต์ํด์ง ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค.
ํนํ gh-assist
๋ GitHub CLI๋ฅผ ์ฌ์ฉํ๋ ๋ฐ์๋ ๋์์ด ๋ ๊ฒ ๊ฐ์ต๋๋ค.