Skip to content

Conversation

@l2D
Copy link
Owner

@l2D l2D commented Jan 28, 2026

This PR introduces azswitch, a Terminal User Interface (TUI) application for managing Azure tenants, directories, and subscriptions.

Features

  • Interactive TUI - Navigate with keyboard (vim-style j/k or arrows)
  • View Current Account - See active user, tenant, and subscription
  • Switch Subscriptions - Quick selection from available subscriptions
  • Switch Directories - Re-authenticate to a different Azure AD directory
  • CLI Mode - Non-interactive flags for scripting (--current, --list, --subscription, --tenant)

Technical Stack

  • Go with Bubble Tea (TUI framework) and Cobra (CLI framework)
  • Azure CLI wrapper for account operations
  • Comprehensive test coverage with mocks

DevOps & Tooling

  • GitHub Actions CI/CD pipeline
  • GoReleaser for multi-platform releases
  • Docker support with non-root user security
  • Pre-commit hooks and golangci-lint configuration
  • Makefile for common development tasks

l2D added 15 commits January 28, 2026 22:41
- add Go module (github.com/l2D/azswitch)
- add README.md
- add Makefile with build, test, lint targets
- add golangci-lint configuration
- add .gitignore for Go project
- add .mise.toml for tools

Signed-off-by: l2D <20911264+l2D@users.noreply.github.com>
- define Client interface for Azure operations
- implement CLIClient using os/exec to wrap Azure CLI
- add types: Account, Subscription, Tenant
- add MockClient for testing
- add unit tests for client operations

Signed-off-by: l2D <20911264+l2D@users.noreply.github.com>
- add Lip Gloss styles with Azure blue color theme
- add key bindings (vim-style j/k, arrows, tab, enter, q)
- implement Model with Init, Update, View methods
- add subscription and tenant list views
- add loading spinner and error states
- add unit tests for model updates

Signed-off-by: l2D <20911264+l2D@users.noreply.github.com>
- add main entry point with Cobra commands
- support --list, --current, --subscription, --tenant flags
- add version package for build info via ldflags
- run TUI in interactive mode by default

Signed-off-by: l2D <20911264+l2D@users.noreply.github.com>
- add multi-stage Dockerfile with Azure CLI base image
- add CONTRIBUTING.md with development guidelines

Signed-off-by: l2D <20911264+l2D@users.noreply.github.com>
- add ci.yml for lint, test, and multi-platform build
- add release.yml with GoReleaser on tag push
- add goreleaser config for binary and Docker releases
- support linux, darwin, windows (amd64, arm64)

Signed-off-by: l2D <20911264+l2D@users.noreply.github.com>
- create azswitch user/group with uid/gid 1000
- set proper ownership for azure cli cache directory
- switch to non-root user before entrypoint

Fixes Trivy AVD-DS-0002 HIGH severity finding

Signed-off-by: l2D <20911264+l2D@users.noreply.github.com>
- add go-fmt for code formatting
- add golangci-lint v2 for linting with auto-fix
- add gitleaks for secret scanning
- add trivy for security vulnerability scanning
- add make setup and make pre-commit targets

Signed-off-by: l2D <20911264+l2D@users.noreply.github.com>
- add version: "2" declaration
- move formatters (gofmt, goimports) to formatters section
- restructure linters settings under linters.settings
- update exclusions to use new linters.exclusions structure
- remove deprecated exportloopref linter

Signed-off-by: l2D <20911264+l2D@users.noreply.github.com>
- Adjusts code formatting in mock.go and keys.go to comply with linting rules
Adds:
- gitleaks for security
- pre-commit for code styling
- trivy for vulnerability scanning
- updates the contributing file with clearer instructions
- adds docker instructions to the readme file
…main are empty

- Title() now returns TenantID as last resort instead of empty string
- FilterValue() updated with same fallback logic for filtering

Signed-off-by: l2D <20911264+l2D@users.noreply.github.com>
…tions per directory

- rename ViewTenants to ViewDirectories constant
- rename renderTenants to renderDirectories
- group and display subscriptions under each directory
- update tab label from "Tenants" to "Directories"
- add WarningStyle for warning messages
- display warning that switching directories opens browser for re-authentication

Signed-off-by: l2D <20911264+l2D@users.noreply.github.com>
- use tea.ExecProcess for interactive az login command
- add WarningStyle for warning messages
- display warning that switching directories opens browser for re-authentication
@l2D l2D self-assigned this Jan 28, 2026
l2D added 2 commits January 29, 2026 00:19
- use index-based iteration with pointers to avoid copying large structs
- convert if-else chains to switch statements
- output binaries to bin/ instead of root
- output coverage reports to coverage/
- add cmd/azswitch package (previously gitignored by mistake)
@l2D l2D merged commit 5a9292a into main Jan 28, 2026
8 checks passed
@l2D l2D deleted the feat/init-azswitch-tui branch January 28, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants