nazarli-shabnam/devkit
关于
CLI to set up local dev environments from a single config: dependencies, DB migrations, seed, and docker-compose generation. Add .dev-env.yml and run devkit setup.
系统与基础设施实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 0
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文envkit
Set up your whole local dev environment from one file. Define your dependencies, databases, and services once — then let envkit install dependencies, run migrations and seeds, generate a ready-to-use docker-compose.yml for your databases and services, and keep your setup shareable and versioned. Secrets stay in .env, never in your config.
envkit writes the Compose file but does not start containers for you: you run docker compose up -d yourself (see the quick start).
Requires Node.js 16+
Install
npm install -g dev-env-kit
This gives you the envkit command (also available as dev-env-kit). If your shell can't find it afterward, run envkit path-setup once.
Quick start
envkit init # answer a few questions to create .dev-env.yml
envkit generate # create docker-compose.yml from your config
docker compose up -d # start the databases and services
envkit setup # install dependencies + run migrations/seeds
The order matters: migrations and seeds talk to your databases, so the containers must be running before envkit setup. If your databases are not run through Docker (or are already running), you can skip the middle two steps.
Run any command from your project root or any subfolder — envkit finds the project automatically.
Commands
| Command | What it does |
|---|---|
envkit init |
Create your .dev-env.yml with a short interactive wizard. |
envkit setup |
Install dependencies and run database migrations + seeds. Skip parts with --skip-deps, --skip-db, or preview with --dry-run. |
envkit validate |
Check your config is valid — great for CI. Use --strict to also fail on warnings. |
envkit generate |
Build a docker-compose.yml from your config. -o, --output <file> writes elsewhere (default docker-compose.yml); --dry-run prints it instead of writing. |
envkit snapshot create/list/restore/delete |
Save and switch between config versions. create [name] --force replaces an existing snapshot; restore <name> -y skips the confirmation. Restoring backs up your current config first. |
envkit share export / import |
Share your setup with teammates — secrets are swapped for placeholders on export. Both accept -o, --output <file>; import <file> --validate-only checks a file without writing anything. |
envkit path-setup |
Add envkit to your PATH so envkit works from any folder (alias pathsetup). Run it once if your shell can't find the command after installing. |
Add -v for more detail or -q to print errors only — data you asked for, such as snapshot list, is still shown. Run envkit <command> --help anytime.
Where things are stored
Snapshots live in .devkit/snapshots/<name>/ inside your project (the config as it was, plus a small metadata file). Add .devkit/ to your .gitignore unless you want to commit them.
Configuration
Everything lives in one .dev-env.yml at your project root. Keep secrets in a .env file and reference them with ${VAR_NAME}:
name: my-app
dependencies:
- type: npm
command: npm install
databases:
- type: postgresql
port: 5432
user: ${DB_USER}
password: ${DB_PASSWORD}
database: myapp
docker:
enabled: true
Variables
${VAR}is replaced from.env, your shell, or the config's ownenv:block (the block wins).${VAR:-fallback}usesfallbackwhenVARis unset or empty.$${VAR}writes a literal${VAR}(for example in a healthchecktestthat the container's shell should expand).- Numeric fields such as
portaccept variables too (port: ${DB_PORT}). - Quote versions (
version: "3.10"): YAML reads an unquoted3.10as the number3.1.
See .dev-env.example.yml for every available option. Don't have a config yet? Just run envkit init — or if you run envkit setup without one, it'll offer to create it for you.
Contributing
npm install
npm test
License
MIT
探索相关项目
加载中…