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
| Option | Description |
|---|---|
-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
- Prompts you to select or create a project
- Creates a
.keyenv.tomlfile with project configuration - 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
| Command | Description |
|---|---|
list | List all available projects |
show <id> | Show details for a specific project |
projects list
List all available projects.
keyenv projects listExamples
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
| Argument | Description |
|---|---|
ID | The 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-15JSON 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
| Argument | Description |
|---|---|
PROJECT | Project 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 initin a project directory for per-directory configuration