{"id":28376242,"url":"https://github.com/phasehq/cli","last_synced_at":"2026-04-02T11:57:12.383Z","repository":{"id":185570339,"uuid":"673275094","full_name":"phasehq/cli","owner":"phasehq","description":"Securely manage and sync environment variables with Phase.","archived":false,"fork":false,"pushed_at":"2026-03-24T07:41:23.000Z","size":156358,"stargazers_count":15,"open_issues_count":19,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-24T09:22:21.981Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phasehq.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-01T09:09:08.000Z","updated_at":"2026-03-24T07:38:13.000Z","dependencies_parsed_at":"2023-09-22T14:13:08.822Z","dependency_job_id":"d67ffab7-d6af-4d06-9893-960258d2d087","html_url":"https://github.com/phasehq/cli","commit_stats":null,"previous_names":["phasehq/cli"],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/phasehq/cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phasehq%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phasehq%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phasehq%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phasehq%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phasehq","download_url":"https://codeload.github.com/phasehq/cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phasehq%2Fcli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31305966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T09:48:21.550Z","status":"ssl_error","status_checked_at":"2026-04-02T09:48:19.196Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2025-05-30T00:06:03.633Z","updated_at":"2026-04-02T11:57:12.378Z","avatar_url":"https://github.com/phasehq.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phase cli\n\n```\nλ phase --help\nKeep Secrets.\n\n             /$$\n            | $$\n    /$$$$$$ | $$$$$$$   /$$$$$$   /$$$$$$$  /$$$$$$\n   /$$__  $$| $$__  $$ |____  $$ /$$_____/ /$$__  $$\n  | $$  \\ $$| $$  \\ $$  /$$$$$$$|  $$$$$$ | $$$$$$$$\n  | $$  | $$| $$  | $$ /$$__  $$ \\____  $$| $$_____/\n  | $$$$$$$/| $$  | $$|  $$$$$$$ /$$$$$$$/|  $$$$$$$\n  | $$____/ |__/  |__/ \\_______/|_______/  \\_______/\n  | $$\n  |__/\n\nCommands:\n  auth                              💻 Authenticate with Phase\n  init                              🔗 Link your project with your Phase app\n  run                               🚀 Run and inject secrets to your app\n  shell                             🐚 Launch a sub-shell with secrets as environment variables\n  apps list                         📱 List available apps and their environments\n  secrets list                      📇 List all the secrets\n  secrets get                       🔍 Fetch details about one or more secrets in JSON\n  secrets create                    💳 Create a new secret\n  secrets update                    📝 Update an existing secret\n  secrets delete                    🗑️ Delete secrets\n  secrets import                    📩 Import secrets from a .env file\n  secrets export                    🥡 Export secrets in a specific format\n  dynamic-secrets list              📇 List dynamic secrets \u0026 metadata\n  dynamic-secrets lease generate    ✨ Generate a lease (create fresh dynamic secret)\n  dynamic-secrets lease get         🔍 Get leases for a dynamic secret\n  dynamic-secrets lease renew       🔁 Renew a lease\n  dynamic-secrets lease revoke      🗑️ Revoke a lease\n  users whoami                      🙋 See details of the current user\n  users switch                      🪄 Switch between Phase users, orgs and hosts\n  users logout                      🏃 Logout from phase-cli\n  users keyring                     🔐 Display information about the Phase keyring\n  ai enable                         🪄 Enable AI integrations and configure secret visibility\n  ai disable                        🚫 Disable AI integrations and remove skill docs\n  ai skill                          📄 Print the Phase AI skill document\n  console                           🖥️ Open the Phase Console in your browser\n  docs                              📖 Open the Phase CLI Docs in your browser\n  completion                        ⌨️ Generate the autocompletion script for the specified shell\n\nFlags:\n  -h, --help      help for phase\n  -v, --version   version for phase\n```\n\n## Features\n\n- **End-to-end encryption** — secrets are encrypted client-side before leaving your machine\n- **Secret types** — `config` (non-sensitive), `secret` (sensitive), and `sealed` (write-only) with enforced visibility rules\n- **`phase run`** — inject secrets as environment variables into any command without code changes\n- **`phase shell`** — launch a sub-shell (bash, zsh, fish, etc.) with secrets preloaded\n- **Dynamic secrets** — generate short-lived credentials (e.g. AWS IAM) with automatic lease management (generate, renew, revoke)\n- **Secret references** — reference secrets across environments and apps, resolved automatically at runtime\n- **Personal overrides** — override shared secrets locally without affecting your team\n- **Import / Export** — import from `.env` files; export to dotenv, JSON, YAML, TOML, CSV, XML, HCL, INI, Java properties, and more\n- **Path-based organisation** — organise secrets in hierarchical paths for monorepos and microservices\n- **Tagging** — tag secrets and filter operations by tag\n- **Random secret generation** — generate hex, alphanumeric, base64, base64url, 128-bit, or 256-bit keys on create or update\n- **AI agent integration** — skill-based integration with Claude Code, Cursor, VS Code Copilot, Codex, and OpenCode with automatic value redaction and safety guardrails\n- **Multiple auth methods** — web-based login, personal access tokens, service account tokens, and AWS IAM identity auth\n- **Multi-user \u0026 multi-org** — switch between Phase accounts, orgs, and self-hosted instances\n- **OS keyring integration** — credentials stored in macOS Keychain, GNOME Keyring, or Windows Credential Manager\n- **Multiple environments** — dev, staging, production, and custom environments with per-project defaults via `phase init`\n\n## Installation\n\nYou can install Phase CLI using curl:\n\n```bash\ncurl -fsSL https://pkg.phase.dev/install.sh | bash\n```\n\n## Usage\n\n### Prerequisites\n\n- Create an app in the [Phase Console](https://console.phase.dev)\n\n### Login\n\n```bash\nphase auth\n```\n\n### Initialize\n\nLink the Phase CLI to your project:\n\n```bash\nphase init\n```\n\nOr non-interactively:\n\n```bash\nphase apps list                                    # find your app ID\nphase init --app-id \"your-app-id\" --env Development\n```\n\n### Import .env (optional)\n\nImport and encrypt existing secrets and environment variables:\n\n```bash\nphase secrets import .env\n```\n\n### List / view secrets\n\n```bash\nphase secrets list --show\n```\n\n### Run and inject secrets\n\n```bash\nphase run 'npm start'\nphase run 'go run main.go'\nphase run --env production 'python manage.py runserver'\n```\n\n### AI integration\n\nEnable AI agent support (installs a skill doc for your AI coding tool):\n\n```bash\nphase ai enable\n```\n\nThis installs the Phase skill to your chosen AI tool (Claude Code, Cursor, VS Code Copilot, Codex, or OpenCode) and configures secret visibility. Sealed secrets are never revealed to AI agents regardless of settings.\n\n## Development\n\n### Prerequisites\n\n- [Go](https://go.dev/dl/) 1.24 or later\n\n### Project structure\n\n```\nsrc/\n├── main.go          # Entrypoint\n├── cmd/             # Cobra command definitions\n├── pkg/\n│   ├── ai/          # AI agent detection, skill doc, redaction\n│   ├── config/      # Config file handling (~/.phase/, .phase.json)\n│   ├── display/     # Output formatting (tree view, tables)\n│   ├── errors/      # Error types\n│   ├── keyring/     # OS keyring integration\n│   ├── phase/       # Phase client helpers (auth, init)\n│   ├── util/        # Misc utilities (color, spinner, browser)\n│   └── version/     # Version constant\n└── go.mod\n```\n\n### Run from source\n\n```bash\ncd src\ngo run main.go --help\n```\n\n### Build a binary\n\n```bash\ncd src\ngo build -o phase .\n./phase --version\n```\n\nYou can set the version at build time with `-ldflags`:\n\n```bash\ngo build -ldflags \"-X github.com/phasehq/cli/pkg/version.Version=2.0.0\" -o phase .\n```\n\n### Install locally (development)\n\nBuild and install to `/usr/local/bin` so `phase` is available globally:\n\n```bash\ncd src\nsudo go build -o /usr/local/bin/phase .\nphase --version\n```\n\nOr if `$GOPATH/bin` is in your `$PATH`:\n\n```bash\ncd src\ngo build -o $(go env GOPATH)/bin/phase .\n```\n\n### Run tests\n\n```bash\ncd src\ngo test ./...\n```\n\n### Local SDK development\n\nThe CLI uses the Phase Go SDK via a `replace` directive in `go.mod`. To develop against a local copy of the SDK:\n\n```go\n// go.mod\nreplace github.com/phasehq/golang-sdk/v2 =\u003e /path/to/your/golang-sdk\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphasehq%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphasehq%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphasehq%2Fcli/lists"}