-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
info: good first issueGood for newcomersGood for newcomersinfo: help wantedExtra attention is neededExtra attention is neededpriority: lowNice to haveNice to havetype: featureNew functionalityNew functionality
Description
Add profile switcher for multi-environment management
Summary
Implement a profile system allowing users to quickly switch between different Azure Service Bus environments (dev/test/prod) or projects using Ctrl+P hotkey.
Why
Users managing multiple environments need to:
- Switch between dev/test/prod Service Bus namespaces quickly
- Maintain separate configurations for different projects
- Avoid manually editing config files when changing contexts
- Keep credentials separate and secure per environment
Implementation
-
Add profile management system with configuration hierarchy:
# Embedded in binary (defaults) config.toml # Default configuration keys.toml # Default key bindings # User configuration directory ~/.config/quetty/ ├── config.toml # Override embedded defaults (optional) ├── keys.toml # Override embedded defaults (optional) └── profiles/ ├── dev/ │ ├── config.toml # Override for dev profile │ ├── keys.toml # Override keys for dev profile │ └── .env # Secret data (ignored by git) ├── test/ │ ├── config.toml │ └── .env └── prod/ ├── config.toml └── .env -
Configuration loading hierarchy (each level overrides previous):
- Embedded defaults (from binary)
- User
~/.config/quetty/config.toml(if exists) - User
~/.config/quetty/keys.toml(if exists) - Profile-specific
config.toml - Profile-specific
keys.toml - Profile-specific
.env
-
Add profile switcher UI:
Ctrl+Popens profile selector popup- Shows list of available profiles
- Displays current profile in status bar
- Returns to start screen after switching
-
Profile management commands:
quetty --profile dev # Start with specific profile quetty --create-profile staging # Create new profile quetty --list-profiles # List available profiles
Success Criteria
- Can switch profiles instantly with
Ctrl+P - Each profile maintains separate Azure connections
- Secrets stay in
.envfiles (never in config.toml) - Configuration inheritance works correctly
- Current profile visible in UI
Technical Notes
// Embedded in binary
const DEFAULT_CONFIG: &str = include_str!("../config.toml");
const DEFAULT_KEYS: &str = include_str!("../keys.toml");# Example embedded config.toml (in binary)
[ui]
theme = "catppuccin"
refresh_interval = 5
[azure]
# No secrets here, just structure
# Example ~/.config/quetty/config.toml (user override)
[ui]
theme = "nightfox" # User prefers different theme
# Example profiles/dev/config.toml
[azure]
subscription_id = "dev-subscription-id"
resource_group = "dev-rg"
namespace = "dev-servicebus"
# Example profiles/dev/.env
AZURE_CLIENT_ID=xxx
AZURE_CLIENT_SECRET=yyy
AZURE_TENANT_ID=zzzProfile struct:
struct Profile {
name: String,
config: Config,
is_active: bool,
}
struct ProfileManager {
profiles: Vec<Profile>,
current: Option<String>,
}Related
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
info: good first issueGood for newcomersGood for newcomersinfo: help wantedExtra attention is neededExtra attention is neededpriority: lowNice to haveNice to havetype: featureNew functionalityNew functionality