tauri-dotenv-working-directory

Community

Make Tauri apps reliably load .env files.

Authorstrataga
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Fix for Tauri app not loading .env file with dotenvy. Use when: (1) Environment variables return not set errors in Tauri commands, (2) dotenvy::from_filename() fails with relative paths like ../../.env, (3) API keys or config work locally but not in Tauri app, (4) GhostClient::from_env() or similar fails with missing env vars. The fix is that cargo tauri dev runs with CWD at project root, not at ui/src-tauri, so use .env not ../../.env.

Core Features & Use Cases

  • Corrects the working directory context for dotenvy in Tauri dev.
  • Implements a multi-path loading approach to locate the .env file.
  • Verifies critical environment variables at startup to prevent silent failures.

Quick Start

Add a small multi-path env loader to your Tauri entry point and verify env vars load correctly during development. Then run cargo tauri dev from the project root to ensure GHOST_URL and other keys are available.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: tauri-dotenv-working-directory
Download link: https://github.com/strataga/claude-skill-inception/archive/main.zip#tauri-dotenv-working-directory

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.