Quick Start Guide#

Get started with Dirvana in 5 minutes!


Step 1: Create a Project Configuration#

Navigate to your project directory:

cd ~/projects/myproject

Initialize Dirvana (creates .dirvana.yml):

dirvana init

Step 2: Edit Configuration#

Open the configuration file:

dirvana edit

Or edit .dirvana.yml manually:

# Simple aliases
aliases:
  ll: ls -lah
  gs: git status
  build: go build -o bin/app ./cmd

# Aliases with auto-completion
aliases:
  k:
    command: kubectl
    completion: kubectl  # Now 'k <TAB>' works!

# Functions
functions:
  mkcd: |
    mkdir -p "$1" && cd "$1"

# Environment variables
env:
  PROJECT_NAME: myproject
  LOG_LEVEL: debug

  # Dynamic values
  GIT_BRANCH:
    sh: git rev-parse --abbrev-ref HEAD

Step 3: Authorize the Project#

For security, you must authorize each project:

dirvana allow

Step 4: Load the Configuration#

Reload by changing directories:

cd .. && cd -

Or manually:

eval "$(dirvana export)"

Step 5: Test Your Configuration#

# Test alias
ll

# Test function
mkcd test_dir

# Test auto-completion
k get <TAB>
# Shows: pods, services, deployments, ...

# Check environment variable
echo $PROJECT_NAME
# Output: myproject

Common Use Cases#

aliases:
  k:
    command: kubectl
    completion: kubectl
  kns: kubens
  kctx: kubectx

env:
  KUBECONFIG:
    sh: echo "$HOME/.kube/$(basename $(pwd))-config"
aliases:
  dc: docker compose
  up: docker compose up -d
  down: docker compose down
  logs: docker compose logs -f

env:
  COMPOSE_PROJECT_NAME: myproject
aliases:
  tf:
    command: terraform
    completion: terraform
  plan: terraform plan
  apply: terraform apply

env:
  TF_LOG: debug
  TF_VAR_environment: dev
aliases:
  dev: npm run dev
  build: npm run build
  test: npm test

env:
  NODE_ENV: development

Next Steps#

Configuration Guide Advanced Features