Skip to content

Getting started

Once set up, this is your whole day: switch the terminal to an account and type the aws commands you already know.

❯ cloudhop use acme-dev
[ aws acme-dev (us-east-1) ]
❯ aws ecs list-clusters
❯ cloudhop use acme-prod
[ aws acme-prod (us-east-1) PROD ]
❯ aws s3 ls

No profile names, no --profile, no aws sso login. Three commands get you there.

  • Node.js 20 or newer, to install cloudhop.
  • AWS CLI v2. Don’t have it? cloudhop doctor offers to install it.
  • An AWS IAM Identity Center portal (a URL like https://acme.awsapps.com/start) or a personal AWS account.
  1. Install cloudhop

    Terminal window
    npm install --global cloudhop

    You get two commands: cloudhop and its short form hop.

  2. Add your accounts: cloudhop add

    Terminal window
    cloudhop add

    Choose IAM Identity Center (SSO portal), paste your portal’s start URL (for example https://acme.awsapps.com/start) and its region, and give it a short name such as acme.

    Your browser opens: sign in as always and approve. cloudhop then lists every account and role you can use. Tick the ones you want and give each an alias, a short name with its own region:

    ◇ acme-production / AdministratorAccess
    ◆ Alias (what you will type) acme-prod
    ◆ Region for acme-prod us-east-1

    Have several portals? Run cloudhop add once per portal.

  3. Set up your terminal: cloudhop shell

    Terminal window
    cloudhop shell

    It asks, then adds one line to your shell’s startup file (~/.zshrc, ~/.bashrc, fish’s config.fish or your PowerShell profile). Open a new terminal afterwards. From then on, your terminal can:

    • switch accounts with cloudhop use <alias>, and you type plain aws after that;
    • sign you in by itself: an expired session opens the browser and your aws command carries on;
    • protect production: on a production alias, aws asks before anything that may change resources;
    • follow your projects: a folder with a .cloudhoprc switches to its alias when you cd into it;
    • show the alias in your prompt, Starship included, so you always know which account you are in;
    • complete aliases with Tab.
Terminal window
cloudhop use acme-dev # this terminal is now acme-dev (or just `cloudhop use` to pick)
aws sts get-caller-identity # who am I? acme-dev
aws ecs list-clusters # any aws command you know, unchanged
terraform plan # Terraform, CDK and SDKs see it too
cloudhop use acme-prod # switch accounts
aws s3 ls # now as acme-prod
cloudhop use --off # back to no account

cloudhop use is the switch between accounts: it sets the alias’ account, role and region in this terminal only. Other terminals keep theirs, so you can have acme-dev in one tab and acme-prod in another. A new terminal starts with no alias; to start every new one with the account you use most, run cloudhop use acme-dev --default.

Nothing to do. The next aws command renews the session silently or opens your browser to sign in, then runs. Nothing checks your sessions in the background.

  • Pin an account to each project with a .cloudhoprc, so cd switches for you: Use an alias in your terminal.
  • Show the alias in your prompt (Starship included): See the alias in your prompt.
  • One-off commands in another account without switching: hop acme-qa s3 ls. See Use hop like the aws command.
  • Open the AWS console already signed in: cloudhop console acme-dev s3.
  • Mark production aliases: cloudhop prod acme-prod.
  • Teach your AI assistant: cloudhop agent install.
  • Prefer a web page? cloudhop ui.