aws-cli-account-info

Crates.ioaws-cli-account-info
lib.rsaws-cli-account-info
version0.1.2
created_at2025-11-03 17:50:20.998794+00
updated_at2025-11-07 12:43:52.790447+00
descriptionAWS CLI prompt info
homepage
repository
max_upload_size
id1915061
size12,568
Juraj Paluba (revolko)

documentation

README

aws-cli-account-info

Rust CLI tool for Command Prompt integration.

There is no magic. The tool simply reads AWS_ACCOUNT_ID environment variable. Thus, you need to set the variable yourself. If compatible with your AWS account, you can use my other tool adfs-rs.

Installation

cargo install aws-cli-account-info

ZSH example

PROMPT='%(!.%{$fg[red]%}.%{$fg[green]%})%~$(git_prompt_info)%{$reset_color%} %{$fg_bold[yellow]%}$(aws-cli-account-info)%{$reset_color%}'

ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg_bold[blue]%}("
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg_bold[blue]%})"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔"

Alternative names

It is possible to define custom alternative names for accounts ids.

Create a file at $XDG_CONFIG_HOME/aws_cli_account_info/accounts.yaml. Note, if not set, the default value for $XDG_CONFIG_HOME is $HOME/.config.

The accounts.yaml file expects the following structure:

accounts:
  123456789: my-prod

If account id matches the key in accounts map, it will print the alternative name instead.

Commit count: 0

cargo fmt