Amazon Q Developer CLI使うまで

公式
https://github.com/aws/amazon-q-developer-cli

debパッケージで入れる方法もあるが、upgradeしやすいzipファイルからのインストールがお勧め
ユーザー権限でOK

curl "https://desktop-release.q.us-east-1.amazonaws.com/latest/q-x86_64-linux.zip" -o "q.zip"

解凍して./install.sh叩けばOK
シェル設定を変更しても良いか聞かれるのでyを押すと ~/.bashrc の先頭と最後に以下のような設定が追加される

# Amazon Q pre block. Keep at the top of this file.
[[ -f "${HOME}/.local/share/amazon-q/shell/bashrc.pre.bash" ]] && builtin source "${HOME}/.local/share/amazon-q/shell/bashrc.pre.bash"

# 元々.bashrcに書かれていた内容

# Amazon Q post block. Keep at the bottom of this file.
[[ -f "${HOME}/.local/share/amazon-q/shell/bashrc.post.bash" ]] && builtin source "${HOME}/.local/share/amazon-q/shell/bashrc.post.bash"

以下のコマンドでログイン処理

q login

agentって単位で設定を分割できるので作っておく
下記コマンドで~/.aws/amazonq/cli-agents/aws.json に設定ファイルが作成される

/agent create -n aws

デフォルトのagent設定

q settings chat.defaultAgent my

こんな感じでaws用とazure用で分けるなんてことも出来る

起動するときにagentを指定できる

q chat --agent aws
q chat --agent azure