infisical-env-sync

infisical-env-sync is a command for Claude Code from smicolon/ai-kit. It costs 21 tokens per session (780 once invoked), scanned A, original, MIT.

A command for exporting Infisical secrets into local .env files or JSON, YAML, and CSV files for a selected environment and secret path.

In plain words
What is it for?
Use it to create files such as .env, .env.staging, or secrets.json from development, staging, production, or custom Infisical environments.
Why use it?
It avoids manually copying configuration values and lets local tools receive the settings needed for development or deployment.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Good fit Use it to create files such as .env, .env.staging, or secrets.json from development, staging, production, or custom Infisical environments.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/smicolon/ai-kit/infisical-env-sync
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/smicolon/ai-kit

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for infisical-env-sync

README.md
[![agentmods](https://agentmods.dev/badge/commands/smicolon/ai-kit/infisical-env-sync/github.svg)](https://agentmods.dev/commands/smicolon/ai-kit/infisical-env-sync)
Your own site
<a href="https://agentmods.dev/commands/smicolon/ai-kit/infisical-env-sync"><img src="https://agentmods.dev/badge/commands/smicolon/ai-kit/infisical-env-sync/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for infisical-env-sync

Your own site · 80×15
<a href="https://agentmods.dev/commands/smicolon/ai-kit/infisical-env-sync"><img src="https://agentmods.dev/badge/commands/smicolon/ai-kit/infisical-env-sync.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 780 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00021 $0.00780
Opus 5 $0.00010 $0.00390
Sonnet 5 $0.00004 $0.00156
Haiku 4.5 $0.00002 $0.00078

Measured 6d ago against content hash 3ca70c5ebe89, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

infisical-env-sync scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packs/infisical/commands/infisical-env-sync.md · 116 lines

How it starts

The opening of the file, as written. The whole thing — 116 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Infisical Env Sync Command

Export secrets from Infisical to local .env files or other formats.

Parse Arguments

Extract from user input:

  • environment: dev, staging, production, or custom (default: ask user)

Workflow

Step 1: Verify Authentication

# Ensure logged in
infisical user

If not logged in, direct user to /infisical-auth.

Step 2: Gather Export Parameters

Ask user:

  • Environment: dev, staging, production, or custom name
  • Format: dotenv (default), json, yaml, csv
  • Secret path: root / or specific folder (e.g., /database)
  • Output file: .env (default), .env.local, custom path

Step 3: Export Secrets

# Export as dotenv (default)
infisical export --env=dev > .env

# Export specific environment
infisical export --env=staging > .env.staging

# Export as JSON
infisical export --env=production --format=json > secrets.json

# Export as YAML
infisical export --env=production --format=yaml > secrets.yaml

# Export specific path
infisical export --env=production --path=/database > .env.database

# Export with self-hosted domain
infisical export --env=production --domain=https://secrets.company.com > .env

Step 4: Generate .env.example

# Generate example with keys only (no values)
infisical secrets generate-example-env --env=dev > .env.example

Step 5: Verify Export

# Count keys in exported file
wc -l .env

# Count keys in Infisical
infisical secrets --env=dev --silent | wc -l

# Compare counts (should match, excluding comments/blanks)

Step 6: Ensure .gitignore

Verify .env is gitignored:

grep -q "^\.env$" .gitignore || echo ".env" >> .gitignore
grep -q "^\.env\.local$" .gitignore || echo ".env.local" >> .gitignore
grep -q "^\.env\.\*\.local$" .gitignore || echo ".env.*.local" >> .gitignore

Recommendation

Prefer infisical run over .env files when possible:

# Better: inject at runtime (no file on disk)
infisical run --env=dev -- npm run dev

# Acceptable: export for tools that require .env files
infisical export --env=dev > .env

Read the full file on GitHub · 116 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 116 lines · 21 tokens per session scan A 3ca70c5ebe89

Subscribe to this mod's changes

infisical-env-sync is a command published in the GitHub repository smicolon/ai-kit (6 stars, last pushed 6d ago), licensed MIT. It adds 21 tokens to every session and 780 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.