skills$openclaw/Env Typegen - TypeScript Types from .env
lxgicstudios1.2kโ˜…

by lxgicstudios

Env Typegen - TypeScript Types from .env โ€“ OpenClaw Skill

Env Typegen - TypeScript Types from .env is an OpenClaw Skills integration for coding workflows. Generate TypeScript types from .env files with smart inference. Type-safe environment variables. Optional Zod schema. Free CLI tool.

1.2k stars8.0k forksSecurity L1
Updated Feb 7, 2026Created Feb 7, 2026coding

Skill Snapshot

nameEnv Typegen - TypeScript Types from .env
descriptionGenerate TypeScript types from .env files with smart inference. Type-safe environment variables. Optional Zod schema. Free CLI tool. OpenClaw Skills integration.
ownerlxgicstudios
repositorylxgicstudios/env-typegen
languageMarkdown
licenseMIT
topics
securityL1
installopenclaw add @lxgicstudios/env-typegen
last updatedFeb 7, 2026

Maintainer

lxgicstudios

lxgicstudios

Maintains Env Typegen - TypeScript Types from .env in the OpenClaw Skills directory.

View GitHub profile
File Explorer
2 files
.
_meta.json
307 B
SKILL.md
2.3 KB
SKILL.md

name: Env Typegen - TypeScript Types from .env description: Generate TypeScript types from .env files with smart inference. Type-safe environment variables. Optional Zod schema. Free CLI tool.

Env Typegen

Generate TypeScript types from your .env file. Smart type inference for numbers, booleans, URLs.

Installation

npm install -g @lxgicstudios/env-typegen

Commands

Generate Types

npx @lxgicstudios/env-typegen
npx @lxgicstudios/env-typegen .env.local
npx @lxgicstudios/env-typegen -o src/types/env.d.ts

With Zod Schema

npx @lxgicstudios/env-typegen --zod

Example

Input .env:

# Database
DATABASE_URL=postgresql://localhost:5432/db
DB_POOL_SIZE=10

# Server
PORT=3000
DEBUG=true

# API
API_KEY=sk_live_abc123

Output:

export interface Env {
  /** Database */
  DATABASE_URL: string;
  DB_POOL_SIZE: number;
  /** Server */
  PORT: number;
  DEBUG: boolean;
  /** API */
  API_KEY: string;
}

export function getEnv(): Env {
  return {
    DATABASE_URL: process.env.DATABASE_URL || '',
    DB_POOL_SIZE: Number(process.env.DB_POOL_SIZE),
    PORT: Number(process.env.PORT),
    DEBUG: ['true', '1', 'yes'].includes(process.env.DEBUG?.toLowerCase() || ''),
    API_KEY: process.env.API_KEY || '',
  };
}

declare global {
  namespace NodeJS {
    interface ProcessEnv {
      DATABASE_URL: string;
      DB_POOL_SIZE: string;
      PORT: string;
      DEBUG: string;
      API_KEY: string;
    }
  }
}

Type Inference

PatternType
PORT=3000number
DEBUG=trueboolean
API_URL=https://...string (URL)
EMAIL=a@b.comstring (email)
Everything elsestring

Options

OptionDescription
-i, --inputInput file (default: .env)
-o, --outputOutput file (default: env.d.ts)
--zodGenerate Zod schema too
--nameInterface name (default: Env)

Common Use Cases

Generate for project:

npx @lxgicstudios/env-typegen -o src/types/env.d.ts

With runtime validation:

npx @lxgicstudios/env-typegen --zod -o src/env.ts

Built by LXGIC Studios

๐Ÿ”— GitHub ยท Twitter

README.md

No README available.

Permissions & Security

Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.

Requirements

  • OpenClaw CLI installed and configured.
  • Language: Markdown
  • License: MIT
  • Topics:

FAQ

How do I install Env Typegen - TypeScript Types from .env?

Run openclaw add @lxgicstudios/env-typegen in your terminal. This installs Env Typegen - TypeScript Types from .env into your OpenClaw Skills catalog.

Does this skill run locally or in the cloud?

OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.

Where can I verify the source code?

The source repository is available at https://github.com/openclaw/skills/tree/main/skills/lxgicstudios/env-typegen. Review commits and README documentation before installing.