Skip to content

lvlcn-t/azctx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

azctx

Last Commit Open Issues

A CLI tool for managing Azure CLI contexts, modelled after kubectx. It maintains a composable config file that maps named contexts to a tenant, credential, and optional subscription. azctx use <name> switches the active context and syncs your Azure CLI session instantly:

azctx demo

Installation

Homebrew

brew install lvlcn-t/tap/azctx

go install

Requires Go 1.26+ and the GOEXPERIMENT=jsonv2 flag:

GOEXPERIMENT=jsonv2 go install github.com/lvlcn-t/azctx@latest

Manual

Download the archive for your platform from the releases page, extract the binary, and place it on your PATH.

Linux / macOS:

OS=$(uname -s)
ARCH=$(uname -m | sed 's/aarch64/arm64/')
curl -sL "https://github.com/lvlcn-t/azctx/releases/latest/download/azctx_${OS}_${ARCH}.tar.gz" \
  | tar -xz -C ~/.local/bin azctx
chmod +x ~/.local/bin/azctx

Windows (PowerShell):

$arch = if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64") { "x86_64" } else { "arm64" }
$url = "https://github.com/lvlcn-t/azctx/releases/latest/download/azctx_Windows_$arch.zip"
Invoke-WebRequest $url -OutFile azctx.zip
Expand-Archive azctx.zip -DestinationPath .
Move-Item azctx.exe "$env:LOCALAPPDATA\Microsoft\WindowsApps\azctx.exe"

Container Image

Pre-built images are published to GitHub Container Registry:

docker pull ghcr.io/lvlcn-t/azctx:latest
docker run --rm \
  -v ~/.config/azctx:/home/nonroot/.config/azctx \
  -v ~/.azure:/home/nonroot/.azure \
  ghcr.io/lvlcn-t/azctx:latest use dev-west

Available tags: latest, vMAJOR, vMAJOR.MINOR, and full semver.

Quick start

Create a minimal config at ~/.config/azctx/config.yaml:

apiVersion: azctx.lvlcn-t.dev/v1alpha1
kind: Config

tenants:
  - name: dev
    id: 00000000-0000-0000-0000-000000000000

credentials:
  - name: personal
    credential:
      type: user

contexts:
  - name: dev
    context:
      tenant: dev
      credential: personal

Then switch to it:

azctx use dev        # opens browser for login, sets subscription
azctx current        # prints "dev"
azctx list -o table  # show all contexts

For a more detailed guide, see the Usage documentation and the example config.

Documentation

Guide Description
Configuration Config file format, credential types, Key Vault references
Workload Identity OIDC federation — OAuth2 PKCE and file-based tokens
Usage All commands, output formats, typical workflows
CLI Reference Auto-generated command documentation
Contributing Development setup, testing, PR guidelines

License

Copyright (c) 2026 lvlcn-t. Licensed under the MIT License.

Code of Conduct

This project has adopted the Contributor Covenant v2.1. All contributors must abide by the code of conduct.

About

Faster way to switch between tenants and subscriptions with az

Topics

Resources

License

Code of conduct

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages

Generated from lvlcn-t/templates-golang