7
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Amazon Q Developer CLIをWindows向けにビルドする方法

7
Posted at

みんな大好きAmazon Q DeveloperのCLI版ですが、公式に対応しているのはmacOSとLinuxのみで、残念ながらWindowsには対応していません😭

ただ、Amazon Q Developer CLIはオープンソースで開発されていて、GitHubでソースコードが公開されています。

コミットの履歴の中で、なにやらWindows向けの対応がちらほら入っているようでして、もしかしたらビルドしたらWindowsでも動くかもと思い、調整してみました!!

AWSが公式にリリースしているわけではないので、サポート外の使い方かもしれませんので、ご注意ください。

環境構築

Windows 11 Proにビルドする環境を構築しました。

  • Git for Windows

    Git for Windowsをダウンロードして、インストールします。

    https://gitforwindows.org/

    image.png

  • Build Tools for Visual Studio 2022

    Visual Studioのダウンロードサイトにアクセスし、「Tools for Visual Studio」にある「Build Tools for Visual Studio 2022」をダウンロードします。

    https://visualstudio.microsoft.com/ja/downloads/

    image.png

    インストーラーを起動し、「C++によるデスクトップ開発」を選択します。

    image.png

    「言語パック」タブで「英語」にチェックを入れ、インストールを開始してください。

    image.png

  • CMake

    CMakeをダウンロードして、インストールします。

    https://cmake.org/download/

    image.png

  • Rust

    Rustをダウンロードして、インストールします。

    https://www.rust-lang.org/tools/install

    image.png

ビルド

ソースを取得します。

コマンドプロンプト
git clone https://github.com/aws/amazon-q-developer-cli.git
Cloning into 'amazon-q-developer-cli'...
remote: Enumerating objects: 21530, done.
remote: Counting objects: 100% (1164/1164), done.
remote: Compressing objects: 100% (368/368), done.
remote: Total 21530 (delta 1009), reused 819 (delta 795), pack-reused 20366 (from 2)
Receiving objects: 100% (21530/21530), 21.18 MiB | 8.99 MiB/s, done.
Resolving deltas: 100% (15501/15501), done.
コマンドプロンプト
cd amazon-q-developer-cli
  • デバッグビルド

    target\debug\chat_cli.exeに出力されます。

    コマンドプロンプト
    cargo build --bin chat_cli
    
  • リリースビルド

    target\release\chat_cli.exeに出力されます。

    コマンドプロンプト
    cargo build --release --bin chat_cli
    

    メモリが不足する場合は、-j 1オプションを追加します。

    コマンドプロンプト
    cargo build --release --bin chat_cli -j 1
    

ビルドできました!

使ってみる

まずログインします。

作成されたexeファイルの名称が「chat_cli.exe」なので、コマンドがqではないです
(ファイル名変えればいいだけですが)

コマンドプロンプト
.\chat_cli.exe login

ブラウザが自動で起動するのでログインします。
ログインできたら、チャットを起動します。

コマンドプロンプト
.\chat_cli.exe chat

image.png

起動しました!

改行の位置がちょっと変な気がしますが、チャットの回答自体は自然です。

image.png

そして、衝撃的な事実が!

/toolsコマンドを実行してみると5つのツールが用意されています。

image.png

あれ、ちょっと違和感あるよね?

これがLinux環境で実行した場合です。

image.png

気づきました?

Windows版は「execute_cmd」で、Linux版は「execute_bash」です。

Windows向けの実装がちゃんと入ってそうです!

もしかしたらWindows版で使ってみて、問題点をIssueとして起票すると、Windows版リリースに貢献できるかもしれません!

7
2
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
7
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?