stacks-env

Load typed .env variables with auto-coercion and AES-256-GCM encryption for Bun/Node.

622|17|Updated Apr 26, 2022
One-click install
npx skills add https://github.com/stacksjs/stacks --skill stacks-env
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stacks-env
Source: https://github.com/stacksjs/stacks/tree/main/.claude/skills/stacks-env
Command: npx skills add https://github.com/stacksjs/stacks --skill stacks-env

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This solution provides a typed environment proxy for Stacks apps, enabling auto-coerced environment variables, seamless .env loading, and secure encryption of sensitive values.

Core Features & Use Cases

  • Typed environment proxy with auto-coercion for booleans and numbers.
  • Automatic .env loading and runtime detection of Bun/Node.
  • AES-256-GCM encryption/decryption of env values and secure key handling.
  • CI provider detection and runtime/platform detection to adapt config per environment.
  • CLI commands to get/set/encrypt/decrypt env vars and manage keys.
  • Type definitions that cover a comprehensive env surface for Stacks apps.

Quick Start

Install the Stacks env package and initialize the proxy to load your .env file and access typed environment variables.

Frequently Asked Questions about stacks-env

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I load and access typed environment variables in TypeScript?

Yes, you can encrypt sensitive .env values using AES-256-GCM encryption. The tool provides a CLI to encrypt and decrypt environment variables, ensuring secure key handling for local and CI environments.

How do I encrypt sensitive .env values for local development and CI?

You can encrypt sensitive .env values using AES-256-GCM encryption. The CLI supports encrypting and decrypting environment variables with secure key handling for both local development and CI environments.

Does this typed env proxy work with both Bun and Node runtimes?

Yes, this typed env proxy works with both Bun and Node runtimes through automatic runtime detection. It adapts environment loading to support whichever JavaScript runtime you are using.

What is the best way to manage environment configuration across different CI providers?

The best way to manage environment configuration across CI providers is using a solution with built-in CI provider detection. It automatically adapts your config loading based on the detected runtime and platform environment.

Can I use a CLI to get and set environment variables in a Stacks app?

Yes, you can use the provided CLI commands to get, set, encrypt, and decrypt environment variables. This allows you to manage your Stacks app configuration and secure keys directly from the command line.