{"id":31074189,"url":"https://github.com/lsdcapital/zsh-doppler","last_synced_at":"2026-05-19T07:34:40.191Z","repository":{"id":311759004,"uuid":"1044876920","full_name":"lsdcapital/zsh-doppler","owner":"lsdcapital","description":"Zsh plugin that displays your current doppler environment in the prompt","archived":false,"fork":false,"pushed_at":"2025-08-26T11:04:00.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-26T14:16:41.039Z","etag":null,"topics":["doppler","oh-my-zsh","powerlevel10k","prompt","shell","zsh","zsh-plugin"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lsdcapital.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-08-26T10:34:59.000Z","updated_at":"2025-08-26T11:04:04.000Z","dependencies_parsed_at":"2025-08-26T14:17:28.268Z","dependency_job_id":"4392883c-e0e1-40ca-9707-d93eb50f9d6a","html_url":"https://github.com/lsdcapital/zsh-doppler","commit_stats":null,"previous_names":["lsdcapital/zsh-doppler"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/lsdcapital/zsh-doppler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsdcapital%2Fzsh-doppler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsdcapital%2Fzsh-doppler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsdcapital%2Fzsh-doppler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsdcapital%2Fzsh-doppler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lsdcapital","download_url":"https://codeload.github.com/lsdcapital/zsh-doppler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsdcapital%2Fzsh-doppler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275348511,"owners_count":25448626,"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","status":"online","status_checked_at":"2025-09-16T02:00:10.229Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["doppler","oh-my-zsh","powerlevel10k","prompt","shell","zsh","zsh-plugin"],"created_at":"2025-09-16T02:05:34.110Z","updated_at":"2026-05-19T07:34:40.178Z","avatar_url":"https://github.com/lsdcapital.png","language":"Shell","funding_links":[],"categories":["Plugins"],"sub_categories":["ZSH on Windows"],"readme":"# Zsh Doppler Plugin\n\n[![Tests](https://github.com/lsdcapital/zsh-doppler/actions/workflows/test.yml/badge.svg)](https://github.com/lsdcapital/zsh-doppler/actions/workflows/test.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![GitHub stars](https://img.shields.io/github/stars/lsdcapital/zsh-doppler)](https://github.com/lsdcapital/zsh-doppler/stargazers)\n[![GitHub issues](https://img.shields.io/github/issues/lsdcapital/zsh-doppler)](https://github.com/lsdcapital/zsh-doppler/issues)\n\nA lightweight Zsh plugin that displays your current [Doppler](https://doppler.com) project and configuration in your shell prompt from environment variables. Perfect for developers working with multiple Doppler environments who want to keep track of their current context.\n\n![Demo](demo.png)\n\n## Features\n\n- ⚡ **Lightning Fast** - Reads from Doppler CLI configuration and environment variables\n- 🚀 **CI/CD Perfect** - Works seamlessly in Docker, CI/CD, and production environments\n- 🎯 **Auto-detection** - Shows when `DOPPLER_PROJECT` and `DOPPLER_CONFIG` are set or configured\n- 🎨 **Smart Colors** - Environment-based colors (green for dev, yellow for staging, red for prod)\n- 🔧 **Highly Customizable** - Configure colors, format, prefix/suffix, and more\n- 🔌 **Compatible** - Works with Oh My Zsh, Prezto, or standalone Zsh\n- 💎 **Powerlevel10k** - Full custom segment support with instant prompt compatibility\n- 🛡️ **Reliable** - Graceful fallbacks and error handling\n- ⚠️ **Production Warning** - Visual alert when entering production directories\n- ✅ **Well Tested** - Comprehensive test suite with 57 tests\n\n## Quick Start\n\nGet up and running in under 2 minutes:\n\n1. **Install** (Oh My Zsh):\n   ```bash\n   git clone https://github.com/lsdcapital/zsh-doppler.git ~/.oh-my-zsh/custom/plugins/zsh-doppler\n   ```\n\n2. **Enable** by adding `zsh-doppler` to your plugins in `~/.zshrc`:\n   ```bash\n   plugins=(git zsh-doppler)\n   ```\n\n3. **Add to your prompt**:\n   ```bash\n   PROMPT='${DOPPLER_PROMPT_INFO} %~ $ '   # Left side\n   # or\n   RPROMPT='${DOPPLER_PROMPT_INFO}'        # Right side\n   ```\n\n4. **Reload** your shell:\n   ```bash\n   source ~/.zshrc\n   ```\n\n5. **Configure Doppler** in your project directory:\n   ```bash\n   doppler setup\n   ```\n\nNow your prompt shows `[project/config]` with environment-aware colors! 🎉\n\n**Powerlevel10k users**: Run `doppler_p10k_setup` after installation for p10k-specific instructions.\n\n## Requirements\n\n- Zsh\n- [Doppler CLI](https://docs.doppler.com/docs/install-cli) (optional, for directory-based configuration)\n- Environment variables `DOPPLER_PROJECT` and `DOPPLER_CONFIG` (automatically set by `doppler run`) or directory-based Doppler configuration\n\n## Installation\n\n### Oh My Zsh\n\n1. Clone this repository to your Oh My Zsh custom plugins directory:\n```bash\ngit clone https://github.com/lsdcapital/zsh-doppler.git ~/.oh-my-zsh/custom/plugins/zsh-doppler\n```\n\n2. Add `zsh-doppler` to your plugins list in `~/.zshrc`:\n```bash\nplugins=(git zsh-doppler)\n```\n\n3. Restart your terminal or run:\n```bash\nsource ~/.zshrc\n```\n\n### Standalone Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/lsdcapital/zsh-doppler.git ~/.zsh-doppler\n```\n\n2. Add this line to your `~/.zshrc`:\n```bash\nsource ~/.zsh-doppler/zsh-doppler.plugin.zsh\n```\n\n3. Restart your terminal or run:\n```bash\nsource ~/.zshrc\n```\n\n### Zinit\n\n```bash\nzinit light lsdcapital/zsh-doppler\n```\n\n### Zplug\n\n```bash\nzplug \"lsdcapital/zsh-doppler\"\n```\n\n### Antigen\n\n```bash\nantigen bundle lsdcapital/zsh-doppler\n```\n\n### npm\n\n```bash\nnpm install -g @lsdcapital/zsh-doppler\n```\n\nThen add to your `~/.zshrc`:\n```bash\nsource \"$(npm root -g)/@lsdcapital/zsh-doppler/zsh-doppler.plugin.zsh\"\n```\n\n### Manual Installation\n\nSimply download `zsh-doppler.plugin.zsh` and source it in your `~/.zshrc`:\n```bash\nsource /path/to/zsh-doppler.plugin.zsh\n```\n\n### Powerlevel10k Installation\n\nIf you're using Powerlevel10k (which overrides standard prompts), follow these steps:\n\n1. Install the plugin using any method above\n2. Run the p10k setup helper:\n```bash\ndoppler_p10k_setup\n```\n3. Add `doppler` to your prompt elements in `~/.p10k.zsh`:\n```bash\n# Add to right side prompt\ntypeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(\n  doppler  # Add this line\n  status\n  command_execution_time\n  # ... your existing elements ...\n)\n```\n4. Restart your terminal or run: `p10k reload`\n\n## Usage\n\n### Standard Zsh Prompts\n\nAdd `${DOPPLER_PROMPT_INFO}` to your `PROMPT` or `RPROMPT`:\n\n```bash\n# Left prompt\nPROMPT='${DOPPLER_PROMPT_INFO} %~ $ '\n\n# Right prompt\nRPROMPT='${DOPPLER_PROMPT_INFO}'\n\n# With existing elements\nPROMPT='%F{green}%n@%m%f ${DOPPLER_PROMPT_INFO}%F{blue}%~%f $ '\n```\n\n### Powerlevel10k\n\nRun the setup helper to add the `doppler` segment:\n```bash\ndoppler_p10k_setup\n```\n\nThen add `doppler` to your prompt elements in `~/.p10k.zsh`:\n```bash\ntypeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(\n  doppler  # Add here\n  status\n  # ... other elements\n)\n```\n\n### Example Output\n\n```\n[myproject/dev] ~/code/myapp $\n```\n\nColors change automatically based on environment: dev (green), staging (yellow), prod (red).\n\n## Configuration\n\nCustomize the plugin behavior with these environment variables:\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `DOPPLER_PROMPT_ENABLED` | `true` | Enable/disable the plugin |\n| `DOPPLER_PROMPT_PREFIX` | `[` | Text before Doppler info |\n| `DOPPLER_PROMPT_SUFFIX` | `]` | Text after Doppler info |\n| `DOPPLER_PROMPT_SEPARATOR` | `/` | Separator between project and config |\n| `DOPPLER_PROMPT_FORMAT` | `%project%separator%config` | Format template |\n| `DOPPLER_PROMPT_COLOR` | `cyan` | Color name (fallback) |\n| `DOPPLER_COLOR_DEV` | `green` | Color for dev environments |\n| `DOPPLER_COLOR_STAGING` | `yellow` | Color for staging environments |\n| `DOPPLER_COLOR_PROD` | `red` | Color for production environments |\n| `DOPPLER_COLOR_DEFAULT` | `cyan` | Color for unknown environments |\n| `DOPPLER_P10K_AUTO_ADD` | `false` | Auto-add to p10k right prompt |\n| `DOPPLER_PROD_WARNING` | `true` | Show warning when entering prod directories |\n| `DOPPLER_PROD_WARNING_MESSAGE` | `⚠️  PRODUCTION ENVIRONMENT` | Custom warning message |\n\n### Environment Pattern Matching\n\nColors are automatically assigned based on config name patterns (case-insensitive):\n\n| Color | Patterns | Examples |\n|-------|----------|----------|\n| Green (dev) | `dev*`, `development*`, `local*` | `dev`, `dev-us`, `development`, `local` |\n| Yellow (staging) | `stag*`, `staging*`, `test*`, `uat*`, `qa*` | `staging`, `stg`, `test`, `uat`, `qa` |\n| Red (prod) | `prod*`, `production*`, `live*`, `prd*` | `prod`, `production`, `prd`, `live` |\n| Cyan (default) | `ci*`, `sandbox*`, and everything else | `ci`, `sandbox`, `demo`, `preview` |\n\n### Powerlevel10k Configuration\n\nAdditional variables for Powerlevel10k users:\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `POWERLEVEL9K_DOPPLER_FOREGROUND` | `cyan` | Text color |\n| `POWERLEVEL9K_DOPPLER_BACKGROUND` | `none` | Background color |\n| `POWERLEVEL9K_DOPPLER_VISUAL_IDENTIFIER_EXPANSION` | `🔐` | Icon |\n| `POWERLEVEL9K_DOPPLER_PREFIX` | `[` | Text before (p10k) |\n| `POWERLEVEL9K_DOPPLER_SUFFIX` | `]` | Text after (p10k) |\n| `POWERLEVEL9K_DOPPLER_FORMAT` | Uses `DOPPLER_PROMPT_FORMAT` | P10k format template |\n\n### Examples\n\n```bash\n# Minimal config-only display\nexport DOPPLER_PROMPT_FORMAT=\"%config\"\nexport DOPPLER_PROMPT_PREFIX=\"env:\"\nexport DOPPLER_PROMPT_SUFFIX=\" \"\n# Output: env:dev\n\n# Custom separators\nexport DOPPLER_PROMPT_PREFIX=\"(\"\nexport DOPPLER_PROMPT_SUFFIX=\")\"\nexport DOPPLER_PROMPT_SEPARATOR=\" → \"\n# Output: (myproject → dev)\n\n# Custom environment colors\nexport DOPPLER_COLOR_DEV=\"blue\"\nexport DOPPLER_COLOR_PROD=\"magenta\"\n```\n\n### Production Warning\n\nWhen you `cd` into a directory configured for a production environment, the plugin displays a warning banner:\n\n```\n⚠️  PRODUCTION ENVIRONMENT (myproject/prod)\n```\n\nThis helps prevent accidental operations in production. The warning appears when:\n- You `cd` into a directory with a production Doppler config\n- The config name matches production patterns (`prod*`, `production*`, `live*`, `prd*`)\n\nThe warning does **not** repeat when:\n- Moving between subdirectories of the same production directory\n- Already in the production directory context\n\n```bash\n# Disable production warnings\nexport DOPPLER_PROD_WARNING=false\n\n# Customize the warning message\nexport DOPPLER_PROD_WARNING_MESSAGE=\"🔴 DANGER: PRODUCTION\"\n```\n\n### Format Template\n\nThe `DOPPLER_PROMPT_FORMAT` variable supports these placeholders:\n\n- `%project` - Doppler project name\n- `%config` - Doppler config name\n- `%separator` - The separator character/string\n\n## Performance\n\nThe plugin is designed for minimal prompt latency:\n\n### Caching Architecture\nThe plugin uses a `precmd` hook to populate `$DOPPLER_PROMPT_INFO` once per command, avoiding file I/O on every keystroke. This means:\n- Use `${DOPPLER_PROMPT_INFO}` in prompts (cached, instant)\n- Avoid `$(doppler_prompt_info)` (executes on every redraw)\n\n### Data Sources\n1. **Environment variables** (fastest): When using `doppler run`, reads `$DOPPLER_PROJECT` and `$DOPPLER_CONFIG` directly\n2. **YAML file**: When configured via `doppler setup`, reads `~/.doppler/.doppler.yaml` using fast awk-based parsing\n\nThe plugin never calls the Doppler CLI during prompt rendering, ensuring consistent performance regardless of network or API conditions.\n\n## Troubleshooting\n\n### Plugin Not Showing\n\n1. **Test the plugin**:\n   ```bash\n   doppler_prompt_test    # Check Doppler CLI and configuration\n   doppler_prompt_config  # View current plugin settings\n   ```\n\n2. **Verify Doppler setup**:\n   ```bash\n   doppler configure      # Check directory configuration\n   doppler --version      # Ensure CLI is installed\n   ```\n\n3. **Check prompt substitution** is enabled:\n   ```bash\n   setopt prompt_subst\n   ```\n\n### Performance Issues\n\n- Ensure you're using `${DOPPLER_PROMPT_INFO}` (cached) not `$(doppler_prompt_info)` (executes every keystroke)\n- Verify `~/.doppler/.doppler.yaml` file exists and is readable (created by `doppler setup`)\n- Check YAML parsing: `cat ~/.doppler/.doppler.yaml | grep $(pwd)` to verify directory config exists\n\n## Compatibility\n\nThis plugin works with:\n- ✅ Oh My Zsh\n- ✅ Prezto\n- ✅ Standalone Zsh\n- ✅ **Powerlevel10k** - Full custom segment support\n- ✅ Powerlevel9k - Compatible with p10k segment API\n- ✅ Any Zsh framework that supports plugins\n\nTested with:\n- macOS (Zsh 5.8+)\n- Linux (Zsh 5.1+)\n- Doppler CLI 3.0+\n\n**Note**: Requires Zsh 5.1+ due to use of `${var:l}` lowercase parameter expansion.\n\n## Testing\n\nThe plugin includes a comprehensive test suite with color logic, prompt formatting, configuration, and performance regression detection.\n\n### Running Tests\n\n```bash\npnpm install  # Install dependencies\npnpm test     # Run all tests\npnpm run test:coverage  # With coverage report\n```\n\nTests execute actual Zsh functions to ensure real-world compatibility. See test files in `tests/` for implementation details.\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature-name`\n3. Make your changes\n4. Run the test suite: `pnpm test`\n5. Test with different Zsh configurations\n6. Submit a pull request\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## Related Projects\n\n- [Doppler CLI](https://github.com/DopplerHQ/cli) - Official Doppler command-line tool\n- [Oh My Zsh](https://github.com/ohmyzsh/ohmyzsh) - Framework for managing Zsh configuration\n\n## Support\n\n- 🐛 [Report issues](https://github.com/lsdcapital/zsh-doppler/issues)\n- 📖 [Doppler Documentation](https://docs.doppler.com)\n- 💬 [Doppler Community](https://doppler.com/community)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsdcapital%2Fzsh-doppler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flsdcapital%2Fzsh-doppler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsdcapital%2Fzsh-doppler/lists"}