2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【GitHub CLI】gh skill installでAgent Skillsをインストールする方法

2
Posted at

はじめに

GitHub CLIには、GitHubリポジトリからAgent Skillsをインストールするためのgh skill installコマンドがあります。

なお、gh skillは現在Preview機能のため、今後仕様が変更される可能性があります。

基本構文

gh skill install <repository> [<skill[@version]>] [flags]

repositoryにはOWNER/REPO形式でGitHubリポジトリを指定します。

例えば、github/awesome-copilotからgit-commitというSkillをインストールする場合は次のように実行します。

gh skill install github/awesome-copilot git-commit

Skill名を省略すると、リポジトリ内で見つかったSkillから選択できます。

gh skill install github/awesome-copilot

インストール先を指定する

デフォルトでは、Skillは現在のGitリポジトリに対するprojectスコープでインストールされます。

Claude Code向けにユーザースコープでインストールする場合は、次のように指定します。

gh skill install github/awesome-copilot git-commit \
  --agent claude-code \
  --scope user

--scopeには次の値を指定できます。

  • project: 現在のGitリポジトリで使用する
  • user: ユーザー全体で使用する

--agentでは、Claude CodeやCodexなどインストール対象のAIエージェントを指定できます。

例えばCodexの場合は次のようにします。

gh skill install github/awesome-copilot git-commit \
  --agent codex

リポジトリ内のすべてのSkillをインストールする

--allを指定すると、検出されたSkillをすべてインストールできます。

gh skill install github/awesome-copilot --all

バージョンを固定する

Skill名の末尾に@VERSIONを指定すると、特定のバージョンをインストールできます。

gh skill install github/awesome-copilot git-commit@v1.2.0

また、--pinでGitタグまたはコミットSHAを指定することもできます。

gh skill install github/awesome-copilot git-commit --pin v2.0.0

バージョンを指定しない場合は、原則としてリポジトリの最新タグ付きリリースが使用され、存在しない場合はデフォルトブランチのHEADが使用されます。

ローカルディレクトリからインストールする

GitHub上ではなく、ローカルにあるSkillをインストールする場合は--from-localを使用します。

gh skill install ./my-skills-repo --from-local

特定のSkillだけを指定することもできます。

gh skill install ./my-skills-repo git-commit --from-local

インストール済みSkillを確認する

インストールしたSkillはgh skill listで確認できます。

gh skill list

Skillをインストールする前に内容を確認したい場合は、gh skill previewも利用できます。

gh skill preview github/awesome-copilot git-commit

参考

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?