feat: project management improvements (last-project removal, init name prompt, update-key)#11
Merged
Merged
Conversation
Replaces the numbered-list interactive pickers in 'project use', 'project remove', and 'switch' with a reusable full-screen Bubble Tea list picker (internal/tui/picker.go). Arrow keys navigate, Enter selects, q/Esc/Ctrl+C cancels (prints "cancelled" to stderr and exits cleanly). The active item is pre-selected so Enter immediately confirms the current active project/session. Gracefully errors when stdin is not a terminal (term.IsTerminal guard) so the tool never hangs in CI/piped contexts. Adds charmbracelet/bubbletea, bubbles, and lipgloss dependencies.
- Allow removing the last remaining project. When the last project is removed, the active project is cleared and a helpful message points the user to 'fireauth init'. - 'fireauth init' without a project name now prompts interactively. The default suggestion is 'default'; if a project named 'default' already exists, it falls back to the Firebase project_id from the service account JSON. - New 'fireauth project update-key [name]' command to update the Web API key for an existing project. Supports --api-key for non-interactive use; falls back to an interactive prompt or the TUI picker when no project name is given. - Adds store.ClearActiveProject helper.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds three feature/behavior improvements on top of the Bubble Tea TUI PR (#10). Depends on #10 — base branch is
feat/tui-bubbletea.Changes
fireauth project removenow works even when removing the only remaining project. The guard that prevented this is removed. After removal, the active project is cleared (via newstore.ClearActiveProjecthelper) and a helpful "No projects remaining. Run 'fireauth init' to add one." message is printed.fireauth initproject name prompt — when no project name is provided via flag or positional arg, the user is now prompted interactively. The default suggestion isdefault; if a project nameddefaultalready exists, it falls back to the Firebaseproject_idfrom the service account JSON. Pressing Enter accepts the suggested default.fireauth project update-keycommand — new subcommand to update the Firebase Web API key for an existing project. Supports--api-keyfor non-interactive/scripted use; falls back to an interactive prompt if no flag is given. When no project name is provided as a positional arg, it defaults to the active project or falls back to the TUI picker.Files
internal/store/store.go(ClearActiveProject)cmd/project.go(remove guard +update-key),cmd/init.go(name prompt)README.md(documentupdate-key)Testing
All pass (store, firebase, updater packages).