ilbertt/parsh/parsh-env
Claude Code and agent skill by ilbertt/parsh
- community
Checking that the SKILL.md file is still in the repository.
How to use @parshjs/env for typed, lazy environment-variable access in a parsh CLI. Use when adding env vars to a CLI, or when you see a handler reading `process.env` directly. Pairs with the parsh skill — read that first if you don't know how parsh CLIs are structured.
Install
npx vskill@latest install ilbertt/parsh/parsh-envSKILL.md
parsh-env
`@parshjs/env` gives a parsh CLI a typed, lazy ctx.context.env for environment variables. It validates each variable with Standard Schema v1 (Zod, Valibot, ArkType, …) the first time a handler reads it — subcommands that never touch a variable never pay the cost or throw on a missing one.
For the broader parsh workflow (commands, codegen, Register), see `../parsh/SKILL.md`.
When to use
- The user asks to add an env var to a parsh CLI.
- A handler is reading
process.env.Xdirectly — replace withctx.context.env.X. - The CLI needs config that depends on the deployment environment (DB URL, ports, feature flags, secrets).
Do not use for CLI flags — those go in defineCommand({ options: … }). @parshjs/env is exclusively for process.env-style variables.
Install
Setup
Inject createEnvContext into createCli's context, and register the Cli so the types propagate.
The declare module block is required — without it, ctx.context is invisible to TypeScript.
Reading variables in a handler
Registered context lives under ctx.context, so the typed env reads as ctx.context.env.<KEY>:
Each variable is validated lazily, on first access. Once validated, the value is cached for the lifetime of the run.
Coercion
@parshjs/env tries the raw string as-is, then numerically, then as a boolean — first success wins. So z.number() and z.boolean() work without z.coerce.*:
Defaults
Provide default to make a variable optional. The default is returned when the source has no value (undefined or empty string) and bypasses the schema — supply a value already in the schema's output type.
Without a default, reading a missing variable throws EnvMissingError. An invalid value throws EnvValidationError.
Remapping the variable name
If the in-code key should differ from the env var name, pass name:
Custom source
By default the source is process.env. Pass source to override — useful for tests or for reading from a parsed .env snapshot.
Common mistakes
- Reading `process.env.X` directly inside a handler. Use
ctx.context.env.Xinstead — typed, validated, lazy. - Looking on `ctx.env` instead of `ctx.context.env`. Registered context always lives under
ctx.context. The flatctx.envdoesn't exist. - Forgetting the `Register` augmentation. Without it,
ctx.contextis invisible at the type level. See the parsh skill. - Using `z.coerce.*` for numbers/booleans. Not needed —
@parshjs/envcoerces automatically. - Putting CLI flags in `vars`. Flags go in
defineCommand({ options: … }), not in env.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/parsh-env/SKILL.md
Popularity
- Repository stars
- 35
- Repository forks
- 2
- 7-day trend score
- 18
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 22 Jun 2026, 4 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ilbertt/parsh/parsh-env)