envland
v0.1.12
Published
CLI for syncing .env files with the Envland console
Maintainers
Readme
envland CLI
Sync .env files with envland.dev.
Install
npm install -g envlandUsage
envland login # authenticate via browser
envland init # connect or create a project (.envland.json; nested under parent config → sub-project)
envland pull [env] # download secrets into the mapped local file (default: .env)
envland push [env] # pick environment (↑↓, default pre-selected), then upload
envland diff [env] # compare local vs remote
envland run [env] -- <cmd> # run a command with secrets injected
envland open # open project in the consolePer-environment local files
During init, you can map each remote environment to its own local file (e.g. development → .env.local, production → .env.prod). That mapping is stored in .envland.json:
{
"defaultEnvironment": "development",
"environments": { "development": "...", "production": "..." },
"environmentFiles": {
"development": ".env.local",
"production": ".env.prod"
}
}Then:
envland pull development # writes .env.local
envland push production # reads .env.prodWithout environmentFiles, behavior stays as before: pull writes .env, and push/diff merge .env + .env.*.
At runtime, override with ENVLAND_API_URL / ENVLAND_CONSOLE_URL. Defaults are baked in at build time (see below).
Develop
From the monorepo root:
bun --filter envland build # bundle for npm (dist/envland.js)
bun --filter envland build:binary # native binary (dist/envland)
node apps/cli/dist/envland.js helpBuild-time URLs
bun run build bakes:
- API:
https://api.envland.dev - Console:
https://console.envland.dev(used forloginapprove links andopen)
For local dev:
bun run build:local # API localhost:4001, console localhost:5173Override for a one-off build:
ENVLAND_API_URL=https://api.envland.dev \
ENVLAND_CONSOLE_URL=https://console.envland.dev \
bun run build:bundleprepublishOnly runs build automatically on npm publish.
Publish (production)
Publishing a GitHub Release whose tag is cli-v* publishes to npm. Requires repo secret NPM_TOKEN (npm automation token with publish access to envland).
# 1. Commit your changes on main (bump apps/cli/package.json if you like — the release tag wins in CI)
# 2. Create and publish a GitHub Release with tag cli-v0.1.6
gh release create cli-v0.1.6 --title "CLI v0.1.6" --generate-notes --target mainOr publish an existing draft release in the GitHub UI. That runs .github/workflows/publish-cli.yml: builds with prod API/console URLs and publishes to npm.
Manual dispatch is also available under Actions → Publish CLI.
Manual publish (runtime deps are bundled — do not add workspace:* to dependencies):
cd apps/cli
bun run build
npm login
npm publish --access public --ignore-scripts