Skip to content

feat: project management improvements (last-project removal, init name prompt, update-key)#11

Merged
andrespd99 merged 3 commits into
mainfrom
feat/project-improvements
Jul 11, 2026
Merged

feat: project management improvements (last-project removal, init name prompt, update-key)#11
andrespd99 merged 3 commits into
mainfrom
feat/project-improvements

Conversation

@andrespd99

Copy link
Copy Markdown
Owner

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

  • Allow removing the last projectfireauth project remove now works even when removing the only remaining project. The guard that prevented this is removed. After removal, the active project is cleared (via new store.ClearActiveProject helper) and a helpful "No projects remaining. Run 'fireauth init' to add one." message is printed.
  • fireauth init project name prompt — when no project name is provided via flag or positional arg, the user is now prompted 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. Pressing Enter accepts the suggested default.
  • fireauth project update-key command — new subcommand to update the Firebase Web API key for an existing project. Supports --api-key for 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

Area Files
Store internal/store/store.go (ClearActiveProject)
Commands cmd/project.go (remove guard + update-key), cmd/init.go (name prompt)
Docs README.md (document update-key)

Testing

go vet ./...
go build ./...
go test ./...

All pass (store, firebase, updater packages).

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.
Base automatically changed from feat/tui-bubbletea to main July 11, 2026 20:06
@andrespd99
andrespd99 merged commit b6dd060 into main Jul 11, 2026
2 checks passed
@andrespd99
andrespd99 deleted the feat/project-improvements branch July 11, 2026 20:14
@andrespd99
andrespd99 restored the feat/project-improvements branch July 11, 2026 20:28
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.

1 participant