Skip to main content

envshed init

Create a .envshed.json project config in the current directory.

Usage

# Single-project setup
envshed init -o <org> -p <project> [-e <env>] [--api-url <url>]

# Workspace setup (add a workspace to existing config)
envshed init --workspace <path> [-o <org>] [-p <project>] [-e <env>]

# Interactive monorepo setup (auto-detects packages)
envshed init

Options

FlagDescriptionRequired
-o, --org <slug>Organization slugYes (non-interactive)
-p, --project <slug>Project slugYes (non-interactive)
-e, --env <slug>Default environment slugNo
--api-url <url>API URL (for local development)No
-w, --workspace <path>Set up a workspace at the given pathNo

Examples

Single-project setup

# Basic setup
envshed init -o my-org -p my-project -e development

# With custom API URL for local dev
envshed init -o my-org -p my-project -e development --api-url http://localhost:3005

This creates a .envshed.json file:

{
"org": "my-org",
"project": "my-project",
"defaultEnv": "development"
}

Monorepo workspace setup

Add workspaces one at a time:

envshed init --workspace apps/web
envshed init --workspace apps/api

Each invocation prompts for the project, environment, and env file name for that workspace. The result:

{
"org": "my-company",
"workspaces": {
"apps/web": {
"project": "web-frontend",
"defaultEnv": "development",
"file": ".env.local"
},
"apps/api": {
"project": "backend-api",
"defaultEnv": "development"
}
}
}

Interactive monorepo detection

When run without flags at a monorepo root (with pnpm-workspace.yaml or package.json workspaces), the CLI auto-detects packages and offers to set up workspaces for each:

$ envshed init
Found 5 packages. Select which to configure:
❯ ◉ apps/web
◉ apps/api
◯ apps/landing
◯ packages/db
◯ packages/shared

If the file already exists, you will be prompted to confirm updating it.

See envshed workspace for managing workspaces after initial setup.