Environment Management
Copy page
Manage different deployment environments with environment-specific configurations and credential management
Overview
Environment management in Inkeep Agent projects enables you to maintain different configurations for development, staging, and production deployments. The --env flag system provides secure credential management and environment-specific settings without duplicating your core project configuration.
Environment Structure
Directory Layout
Environment File Format
How Environments Work
Environment Selection Flow
Usage Examples
Environment Configuration
Credential Management
Environments primarily manage credentials for different deployment stages:
Environment Index File
Export all environments from the index file:
Credential Store Types
Memory Store
Loads credentials from environment variables at runtime:
File Store
Loads credentials from secure files:
External Store
Integrates with external credential management systems:
Environment Workflows
Development Environment
Staging Environment
Production Environment
Advanced Environment Features
Environment-Specific Overrides
While environments primarily manage credentials, they can include other settings:
Conditional Environments
Create environments that adapt to runtime conditions:
Environment Variables Integration
CLI Environment Variables
The CLI respects these environment variables when using the --env flag:
Credential Environment Variables
Environment files reference environment variables for actual credential values:
Best Practices
1. Credential Isolation
Keep credentials completely separate between environments:
2. Secure Secret Management
Never commit secrets to environment files:
3. Environment Naming
Use consistent, descriptive environment names:
4. Environment Documentation
Document what each environment is for:
Troubleshooting
Environment Not Found
Solutions:
- Check file exists in
/environments/directory - Verify file name matches
--envparameter exactly - Ensure file exports environment with correct name
Credential Loading Issues
Solutions:
- Set required environment variables before push
- Check environment variable names in credential config
- Verify credential store configuration
Environment Override Issues
Solutions:
- Check environment file exports credentials object
- Verify credential IDs match agent requirements
- Test environment file syntax with TypeScript compiler
CI/CD Integration
GitHub Actions
Docker Integration
Environment management provides the foundation for secure, scalable deployment of your Inkeep Agent projects across different stages of your development lifecycle.