{"id":46013381,"url":"https://github.com/dominionthedev/lean","last_synced_at":"2026-03-01T01:00:25.077Z","repository":{"id":341061353,"uuid":"1164549231","full_name":"dominionthedev/lean","owner":"dominionthedev","description":"A smart tool for managing your env files ⚡️","archived":false,"fork":false,"pushed_at":"2026-02-23T08:00:23.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-27T23:34:07.487Z","etag":null,"topics":["env","environment-variables","go","managing","managing-dotfiles","tool"],"latest_commit_sha":null,"homepage":"","language":"Go","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/dominionthedev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2026-02-23T08:00:14.000Z","updated_at":"2026-02-23T08:53:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dominionthedev/lean","commit_stats":null,"previous_names":["dominionthedev/lean"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/dominionthedev/lean","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominionthedev%2Flean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominionthedev%2Flean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominionthedev%2Flean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominionthedev%2Flean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dominionthedev","download_url":"https://codeload.github.com/dominionthedev/lean/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominionthedev%2Flean/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29957128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T22:53:01.873Z","status":"ssl_error","status_checked_at":"2026-02-28T22:52:50.699Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["env","environment-variables","go","managing","managing-dotfiles","tool"],"created_at":"2026-03-01T01:00:23.717Z","updated_at":"2026-03-01T01:00:24.944Z","avatar_url":"https://github.com/dominionthedev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/logo.svg\" alt=\"lean logo\" width=\"400\"\u003e\n\u003c/p\u003e\n\n# lean ⚡\n\n[![CI](https://github.com/dominionthedev/lean/actions/workflows/ci.yml/badge.svg)](https://github.com/dominionthedev/lean/actions/workflows/ci.yml)\n[![Release](https://github.com/dominionthedev/lean/actions/workflows/release.yml/badge.svg)](https://github.com/dominionthedev/lean/actions/workflows/release.yml)\n[![Latest Release](https://img.shields.io/github/v/release/dominionthedev/lean?color=205\u0026label=latest)](https://github.com/dominionthedev/lean/releases)\n[![Go Version](https://img.shields.io/github/go-mod/go-version/dominionthedev/lean)](https://go.dev)\n[![License](https://img.shields.io/github/license/dominionthedev/lean)](LICENSE)\n\n\n\u003e A lightweight, expressive environment profile manager.\n\nlean keeps your `.env` files safe, organized, and human-friendly.\nSwitch between profiles, protect secrets, restore backups — all from one CLI.\n\n---\n\n## Installation\n```bash\ngo install github.com/dominionthedev/lean@latest\n```\n\nOr grab a binary from the [Releases](https://github.com/dominionthedev/lean/releases) page\n(Linux, macOS, Windows — amd64 + arm64).\n\n---\n\n## Quick start\n```bash\nlean init              # interactive setup — creates your first profile\nlean create --name prod\nlean apply prod        # .env.prod → .env  (backs up the old .env first)\nlean list              # see all profiles\nlean current           # which profile is active right now\n```\n\n---\n\n## Commands\n\n### `lean init`\nInteractive setup wizard. Creates your first profile and writes `.env`.\n```bash\nlean init\n```\n\n\u003e Running `lean init --quiet`? lean has feelings about that.\n\n---\n\n### `lean create`\nCreate a new environment profile.\n```bash\nlean create --name staging\nlean create --name prod --from .env.template\nlean create --name test  --from .env.dev --strip   # keys only, no values\nlean create --interactive                           # guided prompt\n```\n\n| Flag | Short | Description |\n|------|-------|-------------|\n| `--name` | `-n` | Profile name |\n| `--from` | | Copy from a template or existing file |\n| `--strip` | `-s` | Strip values (keep keys only) |\n| `--interactive` | `-i` | Prompt for name interactively |\n\n---\n\n### `lean apply`\nSwitch the active environment. Backs up the current `.env` before overwriting.\n```bash\nlean apply dev\nlean apply prod\n```\n\n---\n\n### `lean set`\nSet (or update) a variable in a profile.\n```bash\nlean set DEBUG=true\nlean set API_KEY=abc123 --profile prod\n```\n\nIf the profile is currently active, `.env` is updated immediately.\n\n| Flag | Short | Description |\n|------|-------|-------------|\n| `--profile` | `-p` | Target profile (default: active) |\n\n---\n\n### `lean get`\nGet the value of a variable. Output is plain — pipeline-friendly.\n```bash\nlean get DEBUG\nlean get DATABASE_URL --profile prod\nlean get SECRET_KEY --profile staging | pbcopy\n```\n\n| Flag | Short | Description |\n|------|-------|-------------|\n| `--profile` | `-p` | Target profile (default: active) |\n\n---\n\n### `lean delete`\nRemove a variable from a profile.\n```bash\nlean delete OLD_KEY\nlean delete LEGACY_TOKEN --profile staging\n```\n\nAliases: `del`, `rm`\n\n| Flag | Short | Description |\n|------|-------|-------------|\n| `--profile` | `-p` | Target profile (default: active) |\n\n---\n\n### `lean list`\nList all known profiles. Auto-discovers any `.env.*` files on disk.\n```bash\nlean list\n```\n```\n⚡ Profiles\n\n  ▶ dev    (active)\n  · prod\n  · staging\n```\n\n---\n\n### `lean current`\nShow the active profile.\n```bash\nlean current\n```\n\n---\n\n### `lean restore`\nRestore `.env` from a backup. lean takes a snapshot every time `lean apply` runs.\n```bash\nlean restore              # interactive picker\nlean restore dev-20250228-143022.env   # direct\n```\n\n---\n\n### `lean version`\nPrint the current version.\n```bash\nlean version\n```\n\n---\n\n## How it works\n\nlean keeps a `.lean/` folder in your project:\n```\n.lean/\n  state.json       ← active profile, registered profiles, version\n  backups/         ← timestamped .env snapshots (created on every apply)\n```\n\n`state.json` is safe to commit. The backups folder is local only.\n\n---\n\n## Safety\n\n- **Atomic writes** — lean never writes directly to `.env`. It writes to a temp file and renames, so a crash mid-write can't corrupt your env.\n- **Backup on apply** — every `lean apply` snapshots the current `.env` before replacing it. Run `lean restore` to get it back.\n- **`.gitignore` aware** — lean's own `.gitignore` excludes `.env` and `.env.*` by default, keeping secrets off GitHub.\n\n---\n\n## Releasing\n\nlean uses [GoReleaser](https://goreleaser.com). To cut a release:\n```bash\ngit tag v1.0.0\ngit push origin v1.0.0\n```\n\nThe release workflow builds binaries for Linux, macOS (Intel + Apple Silicon), and Windows — then attaches them to the GitHub release automatically.\n\n---\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n\n---\n\n## License\n\nMIT — see [LICENSE](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdominionthedev%2Flean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdominionthedev%2Flean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdominionthedev%2Flean/lists"}