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.1.tar.gz (23.6 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.1-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kiro_switcher-2.0.1.tar.gz
  • Upload date:
  • Size: 23.6 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.1.tar.gz
Algorithm Hash digest
SHA256 42aae7e344fff431bc6b09d85d3c9f4e04b27f3c0cba6e920a6963175cc9910a
MD5 063977a6b78fd51fbd39bf9158fbd295
BLAKE2b-256 4fa436eaa47d2ff12d71ab309b9167cdb97a3cbbfa3dacb23a96fdf71217f4f5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kiro_switcher-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 22.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 627100dec175b869657a1db300d1b2df9daed3fa826c7f533fe9e8eacb4f78a0
MD5 401519413f6f5eb7fd71e061ade3fae5
BLAKE2b-256 c86369d450c009106329a80888d6779c1f677882c0af8adb804330c4c0863732

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