Skip to content

feat: add --profile-env flag to exec command#340

Open
tthayer wants to merge 1 commit intoByteNess:mainfrom
tthayer:add_profile-env_flag-to-exec
Open

feat: add --profile-env flag to exec command#340
tthayer wants to merge 1 commit intoByteNess:mainfrom
tthayer:add_profile-env_flag-to-exec

Conversation

@tthayer
Copy link
Copy Markdown

@tthayer tthayer commented Apr 9, 2026

This change adds a --profile-env flag to the exec command in order to allow profile-based SDK calls to authenticate. Setting --profile-env will cause a token file to be created (default is ~/.aws/sso/cache) with a filename that matches the sha1 of the start URL. My startURL value has a hash symbol in it so the IgnoreInlineComment option needs to be passed so it won't strip it out of the string value. This is needed in order to generate the correct SHA1. When --profile-env is set, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are not set in the environment and instead AWS_PROFILE is set to a value that matches the profile that was passed in at the CLI. If the tokenfile is being used for auth, it is checked for expiration and it is refreshed if needed.

  • co-written by claude code
  • Tested both with and without --profile-env flag being set

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant