Skip to content

Feature request: set AWS_PROFILE directly from Go to remove Bash/PowerShell wrapper dependency #53

Description

@arush-sal

Summary

Would it be possible to set AWS_PROFILE directly from the Go code, so users could drop the Bash/PowerShell wrapper (alias awsd="source _awsd") dependency entirely?

Motivation

Today awsd relies on being sourced into the calling shell so the export reaches the parent process. This means:

  • Every user must add a shell-specific alias (source _awsd for bash/zsh, a separate function for PowerShell).
  • Onboarding/installation has an extra manual step that's easy to get wrong.
  • Cross-shell support means maintaining parallel wrapper logic.

Removing the wrapper would simplify install to a single binary and reduce per-shell maintenance.

What I'm asking for

Set AWS_PROFILE (and AWS_REGION/AWS_DEFAULT_REGION) directly via the Go code instead of relying on the shell wrapper to export them.

Note on the constraint (for discussion)

I recognize a child process can't mutate its parent shell's environment directly — which is presumably why the source _awsd approach exists today. Possible directions the author might consider:

  • Spawn a child shell from Go with the env vars set (os/exec + Env), so awsd drops the user into a configured subshell.
  • Emit shell-eval output and document a thin awsd() { eval "$(awsd-bin "$@")" } shim — still a wrapper, but generated/managed by the tool rather than hand-added.
  • Write to ~/.awsd (already done) and lean on a generated shellenv-style hook (like Homebrew's eval "$(brew shellenv)").

Any of these would still touch the shell, but could centralize/standardize the integration rather than requiring users to hand-write per-shell aliases. Curious whether a fully wrapper-free approach is feasible. Thanks for the tool!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions