Elixir SDK for direnv-config (dc) -- read and write YAML-backed directory configuration.

Installation

Add direnv_config to your list of dependencies in mix.exs:

def deps do
  [
    {:direnv_config, "~> 0.1.0"}
  ]
end

Quick Start

Reading configuration

# Read all config for the current directory
{:ok, config} = DirenvConfig.read()

# Read a specific key
{:ok, value} = DirenvConfig.read("my_key")

# Read from a specific path
{:ok, config} = DirenvConfig.read(path: "/path/to/project")

Writing configuration

# Set a key in the nearest config file
:ok = DirenvConfig.write("my_key", "my_value")

# Set a key at a specific path
:ok = DirenvConfig.write("my_key", "my_value", path: "/path/to/project")

Documentation

Full documentation and CLI usage at the main repository.

License

MIT -- see LICENSE for details.