Dirvana#

Dirvana Logo

Reach directory nirvana
Per-project aliases, functions, and env vars that auto-load when you cd. Zero friction, zero pollution.

Release Coverage License


Beta Status - We Need Your Feedback!

Dirvana is currently in beta and actively seeking testers to help validate its functionality across different configurations and use cases.

Found a bug? Have a feature request? Please open an issue!

The Problem#

Managing different shell environments for different projects is tedious:

  • Cluttered .bashrc files with project-specific aliases
  • Manual sourcing of environment files
  • Forgetting to unload configurations when switching projects
  • Global shell pollution

The Solution#

Dirvana automatically loads project-specific configurations when you enter a directory and unloads them when you leave.

Before Dirvana#

$ cd ~/projects/terraform
$ export TF_LOG=debug
$ alias tf="task terraform --"
$ alias plan="task terraform -- plan"
$ alias apply="task terraform -- apply"
# ... and don't forget to unset everything when leaving!

With Dirvana#

# .dirvana.yml
aliases:
  tf:
    command: task terraform --
    completion: terraform  # Auto-completion works!
  plan: task terraform -- plan
  apply: task terraform -- apply

env:
  TF_LOG: debug
$ cd ~/projects/terraform
# Everything loads automatically!
$ tf <TAB>          # Auto-completion works!
  apply  console  destroy  init  plan  validate ...

$ cd ..
# Everything unloads automatically!

Key Features#

  • Fast - <10ms overhead with intelligent caching
  • Secure - Authorization system prevents untrusted configs
  • Hierarchical - Merge configurations from parent directories
  • Simple - YAML configuration with JSON Schema validation
  • Compatible - Works with Bash and Zsh
  • Auto-completion - Inherits completion from aliased commands

Quick Start#

  1. Install Dirvana

    go install github.com/NikitaCOEUR/dirvana/cmd/dirvana@latest
  2. Setup shell hook

    dirvana setup
    source ~/.bashrc  # or ~/.zshrc
  3. Create configuration

    cd your-project
    dirvana init
    dirvana allow

That’s it! Your environment is now automatically managed.


Documentation#

Installation Quick Start Configuration Advanced Features