LoginSignup
0
0

More than 1 year has passed since last update.

ARM版homebrewでインストールしたaws cliのコマンド補完を有効にする方法

Posted at

aws公式の手順が分かりづらかったのでまとめました。

環境

- M1 mac
- zsh
- ARM版homebrew
- aws cli v2

手順

  1. aws_completerのパスを確認する。

    $ which aws_completer
    > /opt/homebrew/bin/aws_completer
    
  2. /usr/local/binにシンボリックリンクを作成する

    $ cd /usr/local/bin
    $ ln -s /opt/homebrew/bin/aws_completer
    
  3. .zshrcに設定を追加する

    $ vim ~/.zshrc
    > autoload bashcompinit && bashcompinit
    > autoload -Uz compinit && compinit
    > compinit
    > complete -C '/usr/local/bin/aws_completer' aws
    
  4. 確認する

$ source ~/.zshrc
$ aws dynamodb [TAB]
batch-execute-statement                 describe-table                          restore-table-to-point-in-time
batch-get-item                          describe-table-replica-auto-scaling     scan
batch-write-item                        describe-time-to-live                   tag-resource
create-backup                           disable-kinesis-streaming-destination   transact-get-items
create-global-table                     enable-kinesis-streaming-destination    transact-write-items
create-table                            execute-statement                       untag-resource
delete-backup                           execute-transaction                     update-continuous-backups
delete-item                             export-table-to-point-in-time           update-contributor-insights
delete-table                            get-item                                update-global-table
describe-backup                         list-backups                            update-global-table-settings
describe-continuous-backups             list-contributor-insights               update-item
describe-contributor-insights           list-exports                            update-table
describe-endpoints                      list-global-tables                      update-table-replica-auto-scaling

参考

公式ドキュメント
AWS CLI v2のコマンド補完を有効にする

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