{"id":15355486,"url":"https://github.com/ittus/firebase-prompt","last_synced_at":"2026-03-16T10:37:03.968Z","repository":{"id":90076773,"uuid":"144246208","full_name":"ittus/firebase-prompt","owner":"ittus","description":"Show current firebase project on shell prompt","archived":false,"fork":false,"pushed_at":"2020-01-29T09:10:33.000Z","size":152,"stargazers_count":8,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T17:05:36.945Z","etag":null,"topics":["bash","bash-script","console","firebase","firebase-cli","firebase-console","zsh"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ittus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-10T06:30:45.000Z","updated_at":"2021-12-17T15:35:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"164d8831-40c1-49e5-ab73-123570d06c73","html_url":"https://github.com/ittus/firebase-prompt","commit_stats":{"total_commits":4,"total_committers":2,"mean_commits":2.0,"dds":0.25,"last_synced_commit":"402a8552dc48343370d60701442125f885446275"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ittus%2Ffirebase-prompt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ittus%2Ffirebase-prompt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ittus%2Ffirebase-prompt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ittus%2Ffirebase-prompt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ittus","download_url":"https://codeload.github.com/ittus/firebase-prompt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249020039,"owners_count":21199477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","bash-script","console","firebase","firebase-cli","firebase-console","zsh"],"created_at":"2024-10-01T12:24:33.848Z","updated_at":"2026-03-16T10:37:03.922Z","avatar_url":"https://github.com/ittus.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"## Firebase prompt\n\nShow current firebase project on terminal prompt\n\nWhen working on multiple stages (development, staging, production), developers usually use\n\n`firebase use [project_id_or_alias]`\n\nto switch between projects. It's very easy to run a command on production environment instead of development, which is very dangerous.\n\nThis script intends to show firebase project name on **shell prompt**. I hope this can help prevent unexpected situation.\n\n## How to set up\n\n### 1. Bash\n\nAdd following script to the end of `~/.bash_profile`\n\n```bash\nprompt_firebase() {\n  local fb_project=$(grep \\\"$(pwd)\\\" ~/.config/configstore/firebase-tools.json | cut -d\" \" -f2)\n  if [[ -n $fb_project ]]; then\n    echo [$fb_project]\n  fi\n}\nexport PS1=\"\\$(prompt_firebase)\"$PS1\n```\n\nThen run `source ~/.bash_profile` or open new terminal window\n![Demo](/assets/bash.png)\n\n### 2. iTerm2 with oh-my-zsh\nFor example, if you're using `agnoster` theme:\nEdit `~/.oh-my-zsh/themes/agnoster.zsh-theme`\n\n```bash\nprompt_firebase() {\n  local fb_project=$(grep \\\"$(pwd)\\\" ~/.config/configstore/firebase-tools.json | cut -d\" \" -f2)\n  if [[ -n $fb_project ]]; then\n    prompt_segment red black $fb_project\n  fi\n}\n```\n\nand add `prompt_firebase` to `build_prompt` functions\n\n```bash\nbuild_prompt() {\n  RETVAL=$?\n  prompt_status\n  prompt_virtualenv\n  prompt_context\n  prompt_dir\n  prompt_git\n  prompt_bzr\n  prompt_hg\n  prompt_firebase\n  prompt_end\n}\n```\n\nThen run `source ~/.zshrc` or open new terminal window\n\n![Demo](/assets/oh_my_zsh.png)\n\n## More Info\n- https://www.freecodecamp.org/news/how-to-show-your-current-firebase-project-name-on-the-command-line-prompt-to-prevent-dangerous-1bfee6293811/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fittus%2Ffirebase-prompt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fittus%2Ffirebase-prompt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fittus%2Ffirebase-prompt/lists"}