azsh is a CLI client for Azure Cloud Shell that lets you access a fully preconfigured environment with tools like az, kubectl, and docker directly from your local terminal. No browser or Azure CLI installation needed.
Note: This tool is for Linux and macOS. On Windows, Azure Cloud Shell is available natively through Windows Terminal.
- Interactive Cloud Shell — full terminal session with bash or PowerShell
- One-shot commands — run
az,kubectl, or any command and get the output - File upload — push local files into your Cloud Shell environment
- Azure auth via MSAL — OAuth2 device code flow with token caching
- Settings & console caching — stored locally in
~/.azsh/ - Automatic terminal resize — SIGWINCH signals forwarded to the Cloud Shell terminal
- An Azure account with an active subscription
- The Cloud Shell resource provider may need to be registered —
azsh registerhandles this
go install github.com/ayanrajpoot10/azsh@latestDownload the latest archive from GitHub Releases.
Install from the AUR:
yay -S azsh-bingit clone https://github.com/ayanrajpoot10/azsh.git
cd azsh
go buildazshAfter the first run, subsequent sessions reuse cached tokens and settings.
Start an interactive Cloud Shell session.
azsh # default: bash
azsh connect --shell pwsh # PowerShell
azsh connect --shell bash # bash (explicit)Once connected, type commands normally. Exit with exit or Ctrl-D.
Authenticate with Azure using OAuth2 device code flow. Opens your browser for sign-in.
azsh loginTokens are cached to ~/.azsh/token.json.
Remove the cached authentication token.
azsh logoutOne-time setup to configure Cloud Shell for your Azure account.
azsh registerWalks you through:
- Subscription selection (if you have multiple)
- Cloud Shell type — ephemeral (no storage) or with mounted storage
- Storage configuration — existing storage account, auto-setup, or manual
Run a command non-interactively and print the output.
azsh exec "az account show"
azsh exec "df -h"Useful for scripting, automation, or one-off queries without entering an interactive session.
Upload a local file to your Cloud Shell home directory.
azsh upload ./script.sh
azsh upload /path/to/config.yamlThe file lands in $HOME/ in the Cloud Shell environment.
Delete the Cloud Shell console, user settings, and clear all local caches.
azsh resetUse this if you hit provisioning limits or want to start fresh.
Why this tool instead of installing the Azure CLI locally or using Cloud Shell in a browser?
I used the Azure CLI locally, but its installed size is around 800 MB. I prefer a clean system without bloated packages. Cloud Shell provides a preconfigured environment with tools like az already installed, so there's no need to install anything locally. However, using Cloud Shell in a browser is a poor user experience. azsh brings that environment to your local terminal.
MIT — see LICENSE.
Copyright (c) 2026 Ayan Rajpoot.
