Skip to main content

Interactive TUI for hot-swapping between multiple Kiro IDE accounts

Project description

Kiro IDE Account Switcher

Interactive terminal UI for hot-swapping between multiple Kiro IDE accounts without re-login.

Version Python License

Features

  • Visual Dashboard: See all accounts at a glance with color-coded status
  • One-Key Switching: Press number to switch instantly
  • Token Expiry Warnings: Know which accounts need re-login
  • Custom Labels: Friendly names like "Production AWS" instead of "prod"
  • Progress Spinners: Visual feedback during token wait
  • Cross-Platform: Works on macOS, Linux, Windows
  • Safe Operations: Automatic backups on every switch
  • Modular Architecture: Clean, maintainable codebase

Quick Start

# Install
pip3 install kiro-switcher

# Run
kiro-switcher

Installation

From PyPI (Recommended)

pip3 install kiro-switcher

From Source

git clone https://github.com/yerisrifan/kiro-account-switcher.git
cd kiro-account-switcher
pip3 install -e .

Requirements

  • Python 3.6+
  • Kiro IDE installed
  • rich library (auto-installed)

Usage

First Time Setup

  1. Run the tool:

    kiro-switcher
    
  2. Press n to setup new account

  3. Name the account (e.g., "prod", "main", "personal")

  4. Add label (optional, e.g., "Production AWS")

  5. Login in Kiro IDE when it opens

Switching Accounts

  1. Press number key (1-9) for the account
  2. Restart Kiro IDE to apply changes

Other Actions

  • n - Setup new account
  • r - Rename account label
  • d - Delete account (with confirmation)
  • q - Quit

Screenshot

╔══════════════════════════════════════════════════════════════════════════════╗
║                        KIRO IDE ACCOUNT SWITCHER                             ║
╚══════════════════════════════════════════════════════════════════════════════╝

╭─────────────────────────────────── Status ───────────────────────────────────╮
│ Active:  Production AWS  (3 accounts)                                        │
╰──────────────────────────────────────────────────────────────────────────────╯

                          Kiro IDE Accounts                          
╭──────┬──────────────────┬──────────┬──────────────────┬──────────╮
│ #    │ Account          │ Provider │ Expires          │  Status  │
├──────┼──────────────────┼──────────┼──────────────────┼──────────┤
│ 1    │ Production AWS   │ Github   │ 2026-05-12 19:52 │ ✓ ACTIVE │
│ 2    │ Development      │ Google   │ 2026-05-12 19:36 │          │
│ 3    │ Staging          │ Github   │ 2026-05-11 10:00 │ ⚠ EXPIRED│
╰──────┴──────────────────┴──────────┴──────────────────┴──────────╯

Actions:
  1-9     Switch to account
  n       Setup new account
  r       Rename account label
  d       Delete account
  q       Quit

Choice (q): 

How It Works

Architecture

kiro_switcher/
├── __init__.py       # Package metadata
├── config.py         # Configuration and paths
├── core.py           # Account and token management
├── ui.py             # Terminal UI rendering
└── app.py            # Main application logic

File Structure

~/.aws/sso/cache/
├── kiro-auth-token.json              # Active token (regular file)
├── prod-kiro-auth-token.json         # Production account
├── dev-kiro-auth-token.json          # Development account
└── staging-kiro-auth-token.json      # Staging account

~/.local/share/kiro-ide-switcher/
├── accounts.json                     # Account metadata (labels, dates)
└── active                            # Currently active account name

Security Note

Why file copy instead of symlinks?

Kiro IDE security policy rejects symbolic links:

Error: symbolic link detected at token storage path

This tool uses file copy strategy to comply with security requirements. Each switch:

  1. Backs up current token (timestamped)
  2. Copies target account token to kiro-auth-token.json
  3. Updates active account tracking

Development

Project Structure

  • config.py: Cross-platform path detection and IDE launch commands
  • core.py: TokenHandler and AccountManager classes for business logic
  • ui.py: TUIRenderer class for all Rich-based UI rendering
  • app.py: KiroSwitcher main application orchestration

Running from Source

# Install in development mode
pip3 install -e .

# Run
kiro-switcher

# Or run directly
./kiro-switcher

Testing

# Install dev dependencies
pip3 install pytest

# Run tests (coming soon)
pytest

Troubleshooting

"No accounts found"

  • Press n to setup your first account
  • Make sure you've logged into Kiro IDE at least once

"Token expired"

  • Press n to re-login with expired account
  • Or switch to an account with valid token

Kiro IDE shows loading/error after switch

  • Restart Kiro IDE (required after every switch)
  • Check token expiry in the accounts table
  • Verify token file: ls ~/.aws/sso/cache/kiro-auth-token.json

"rich library not installed"

pip3 install rich

Keyboard Shortcuts

Key Action
1-9 Switch to account
n Setup new account
r Rename account label
d Delete account
q Quit

Contributing

Issues and PRs welcome at GitHub.

License

MIT

Changelog

v2.0.0 (2026-05-12)

  • Complete refactor to modular architecture
  • Cross-platform support (macOS, Linux, Windows)
  • Progress spinners for better UX
  • Class-based design for maintainability
  • PyPI package support

v1.0.0 (2026-05-12)

  • Initial release with standalone TUI
  • Basic account switching functionality

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kiro_switcher-2.0.0.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kiro_switcher-2.0.0-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file kiro_switcher-2.0.0.tar.gz.

File metadata

  • Download URL: kiro_switcher-2.0.0.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for kiro_switcher-2.0.0.tar.gz
Algorithm Hash digest
SHA256 5aed9a87938637e8e31f0d36795da3140cb50ebd552a60c5ac43fb758b42ea8e
MD5 192320ea3527f7d0b80320bb4414437f
BLAKE2b-256 1c7f451ec45d7f9c2dc7526bee7332be37707515690018435f52c426a4bb4fe6

See more details on using hashes here.

File details

Details for the file kiro_switcher-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: kiro_switcher-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for kiro_switcher-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e2d1694e69c17ec1b597fbf9cc2970cddf1813801c5ce2f16eee5af77b8dbb9
MD5 b549b5cd8f37c5af54b14df2bf84e501
BLAKE2b-256 803108c5bd98a3bec88679dbe85e98dd5368fd226175489fc0f793f57b48cd6e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page