KeyEnvKeyEnv

Project Commands

CLI commands for managing KeyEnv projects.

Project Commands

Commands for initializing and managing KeyEnv projects.

init

Initialize a new KeyEnv project in the current directory.

keyenv init [OPTIONS]

Options

OptionDescription
-n, --name <NAME>Create a new project with this name
-p, --project <ID>Link to an existing project by ID

Examples

# Interactive initialization
keyenv init

# Create a new project
keyenv init --name "my-api"

# Link to existing project
keyenv init --project abc123-def456-...

What It Does

  1. Prompts you to select or create a project
  2. Creates a .keyenv.toml file with project configuration
  3. Sets the default environment (usually development)

Configuration File

# .keyenv.toml
project_id = "abc123-def456-..."
default_environment = "development"

projects

Manage KeyEnv projects. Requires a subcommand.

keyenv projects <COMMAND>

Subcommands

CommandDescription
listList all available projects
show <id>Show details for a specific project

projects list

List all available projects.

keyenv projects list

Examples

keyenv projects list
# Projects:
#   • my-api (abc123...) ← current
#   • frontend (def456...)
#   • shared-services (ghi789...)

JSON Output

keyenv projects list --json
{
  "projects": [
    {
      "id": "abc123-...",
      "name": "my-api",
      "current": true
    },
    {
      "id": "def456-...",
      "name": "frontend"
    }
  ],
  "current_project": "abc123-..."
}

projects show

Show details for a specific project.

keyenv projects show <ID>

Arguments

ArgumentDescription
IDThe project ID to show details for

Examples

keyenv projects show abc123-def456-...
# Project: my-api
#   ID: abc123-def456-...
#   Environments: development, staging, production
#   Created: 2024-01-15

JSON Output

keyenv projects show abc123-def456-... --json
{
  "id": "abc123-def456-...",
  "name": "my-api",
  "environments": ["development", "staging", "production"],
  "created_at": "2024-01-15T10:30:00Z"
}

switch

Switch to a different project.

keyenv switch <PROJECT>

Arguments

ArgumentDescription
PROJECTProject name or ID to switch to

Examples

# Switch by name
keyenv switch frontend

# Switch by ID
keyenv switch def456-...

Notes

  • Updates your global config to use the selected project
  • Affects all subsequent commands in any directory
  • Use keyenv init in a project directory for per-directory configuration

On this page