Getting started overview
MicroENV is a platform designed for secure management and distribution of environment variables and secrets across development, staging, and production environments. This guide details the process of initiating an account, installing the command-line interface (CLI), and making a successful first request to store and retrieve a secret. The workflow generally involves signing up for a MicroENV account, installing the official CLI, authenticating the CLI with an API key, creating a project, and then adding or retrieving an environment variable.
MicroENV emphasizes secure environment variable management, team-based secret sharing, and integration with CI/CD pipelines, as outlined in their MicroENV documentation. For developers, consistent local development environment configuration is also a key feature. Before proceeding, ensure you have a stable internet connection and access to a terminal or command prompt.
Quick reference table
| Step | What to Do | Where |
|---|---|---|
| 1. Sign Up | Create a MicroENV account | MicroENV homepage |
| 2. Install CLI | Download and install the MicroENV CLI | MicroENV CLI installation guide |
| 3. Authenticate CLI | Generate an API key and log in via CLI | MicroENV API key management |
| 4. Create Project | Initialize a new project within MicroENV | MicroENV CLI or MicroENV Cloud Dashboard |
| 5. First Request | Add and retrieve an environment variable | MicroENV CLI |
Create an account and get keys
To begin using MicroENV, the first step is to establish an account. MicroENV offers a free tier that includes up to three projects and 10,000 requests per month, which is sufficient for initial testing and small-scale use cases. Paid plans are also available, starting at $19 per month for individual developers.
Account Creation
- Navigate to the MicroENV homepage.
- Click on the "Sign Up" or "Get Started Free" button.
- Follow the prompts to create your account, which may involve providing an email address and setting a password, or using a single sign-on (SSO) option if available.
- Verify your email address if required to activate your account.
API Key Generation
After creating and logging into your MicroENV account, you will need to generate an API key. This key is used by the MicroENV CLI to authenticate your requests and link them to your account and projects. API keys act as credentials for programmatic access, similar to how AWS access keys or Google API keys function for their respective services.
- Log in to your MicroENV Cloud Dashboard.
- Navigate to the "Settings" or "API Keys" section. The exact path can be found in the MicroENV API key documentation.
- Generate a new API key. It is common practice to assign a descriptive name to the key for easier management.
- Copy the API key immediately after generation. For security reasons, API keys are often displayed only once and cannot be retrieved later. Treat this key as sensitive information, similar to a password.
Your first request
With an account created and an API key generated, the next step involves setting up the MicroENV CLI and making your first interaction. The MicroENV CLI is the primary tool for managing environment variables from your local machine or CI/CD pipelines.
CLI Installation
The MicroENV CLI supports various operating systems. Refer to the official MicroENV CLI installation instructions for the most up-to-date methods. Common installation methods include package managers or direct downloads.
For macOS/Linux, using curl or a package manager like Homebrew might be an option:
# Example for macOS/Linux (consult official docs for exact command)
curl -fsSL https://install.microenv.com/cli | sh
For Windows, a direct installer or PowerShell script might be provided:
# Example for Windows (consult official docs for exact command)
Invoke-WebRequest -Uri "https://install.microenv.com/cli.ps1" -OutFile ".\install-microenv-cli.ps1"
.\install-microenv-cli.ps1
After installation, verify the CLI is working by checking its version:
microenv --version
This command should output the installed version of the MicroENV CLI.
CLI Authentication
Use the API key obtained earlier to authenticate your CLI session:
microenv login --key <YOUR_API_KEY>
Replace <YOUR_API_KEY> with the actual key copied from your dashboard. A successful login message will confirm authentication.
Creating Your First Project
MicroENV organizes environment variables within projects. Create a new project using the CLI:
microenv project create my-first-project
This command creates a project named my-first-project. You can verify its creation via the MicroENV Cloud Dashboard.
Adding an Environment Variable
Now, add an environment variable to your newly created project. You'll specify the project name, the variable key, and its value:
microenv env set my-first-project MY_SECRET_KEY my-secret-value
This command sets the variable MY_SECRET_KEY with the value my-secret-value within my-first-project.
Retrieving an Environment Variable
To confirm the variable was set correctly, retrieve it using the CLI:
microenv env get my-first-project MY_SECRET_KEY
The output should be my-secret-value. You can also fetch all environment variables for a project:
microenv env list my-first-project
This will display a list of all variables and their values associated with my-first-project.
Common next steps
After successfully performing your first request, several common next steps can enhance your MicroENV integration and workflow:
- Integrate with Local Development: Use the CLI to load secrets directly into your local development environment. For example,
microenv run --project my-first-project -- <your_command>can inject variables into a process. - Team Collaboration: Invite team members to your project in the MicroENV Cloud Dashboard. MicroENV supports granular access control, allowing you to define roles and permissions for different users, aligning with security best practices for managing permissions in cloud environments.
- CI/CD Integration: Integrate MicroENV into your continuous integration/continuous deployment pipelines. The MicroENV documentation on CI/CD provides specific examples for platforms like GitHub Actions, GitLab CI, and Jenkins. This ensures that your deployment processes can securely access necessary credentials without hardcoding them.
- Multiple Environments: Create separate projects or environments within a single project (e.g.,
my-app-dev,my-app-staging,my-app-prod) to manage environment variables specific to each deployment stage. This practice helps prevent accidental exposure of production secrets during development or testing. - Secret Rotation: Implement a strategy for rotating sensitive secrets regularly. While MicroENV securely stores secrets, periodic rotation is a fundamental security practice. The CLI or dashboard can be used to update variable values when needed.
- Audit Logs: Review audit logs within the MicroENV Cloud Dashboard to monitor access and changes to your environment variables, which is important for compliance and security monitoring.
Troubleshooting the first call
Encountering issues during the initial setup is not uncommon. Here are some common problems and their solutions:
microenvcommand not found:- Cause: The CLI was not installed correctly, or its installation directory is not in your system's PATH.
- Solution: Re-run the CLI installation script. Ensure that the installation completes without errors. If installed manually, add the directory containing the
microenvexecutable to your system's PATH environment variable.
- Invalid API Key during
microenv login:- Cause: The API key provided is incorrect, expired, or has insufficient permissions.
- Solution: Double-check the API key for typos. Generate a new API key from your MicroENV Cloud Dashboard and ensure it has the necessary permissions (e.g., "Manager" or "Admin" if creating projects). Copy the new key carefully.
- "Project not found" error:
- Cause: The project name specified in the command (e.g.,
microenv env set my-first-project ...) does not exist or is misspelled. - Solution: Verify the project name. Use
microenv project listto see all projects associated with your account. If the project doesn't exist, create it usingmicroenv project create <project-name>.
- Cause: The project name specified in the command (e.g.,
- Permission denied when setting/getting variables:
- Cause: The API key or the authenticated user does not have the necessary permissions to perform the requested action on the specified project.
- Solution: Review the permissions associated with your API key or user role in the MicroENV Cloud Dashboard's access control settings. Adjust permissions to allow variable management.
- Network connection issues:
- Cause: Your machine cannot reach the MicroENV API servers. This could be due to firewall restrictions, proxy issues, or general internet connectivity problems.
- Solution: Check your internet connection. If you are behind a corporate firewall or proxy, ensure that MicroENV's domains are whitelisted. Consult your network administrator if necessary.