envy
Version, currently 0.1.012 versions
- 1.0.5latestJun 6, 2025
- 1.0.4not indexedAug 9, 2026
- 1.0.3not indexedAug 9, 2026
- 1.0.2not indexedAug 9, 2026
- 1.0.1not indexedAug 9, 2026
- 1.0.0not indexedAug 9, 2026
- 0.4.0not indexedAug 9, 2026
- 0.3.1not indexedAug 9, 2026
- 0.3.0not indexedAug 9, 2026
- 0.2.1not indexedAug 9, 2026
- 0.2.0not indexedAug 9, 2026
- 0.1.0not indexedAug 9, 2026
github.com/GrottoPress/envy
Load environment variables from YAML
11 stars
2 dependents
License: MIT
Nothing has been indexed for 0.1.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
envy:
github: GrottoPress/envy
version: ~> 0.1.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.1.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
# Envy
**Envy** loads and sets environment variables from YAML. It supports all YAML data types, including arrays and hashes.
*Envy* uses the YAML key mapping of a value as the environment variable name. For example, the following YAML configuration...
```yaml
---
app:
database:
host: localhost
port: 4321
server:
hosts:
- localhost
- grottopress.localhost
port: 8080
webhooks:
- url: "https://example.com"
token: "a1b2c2"
- url: "https://myapp.net"
token: "d4e5f6"
```
...sets environment variables as follows:
```crystal
ENV["APP_DATABASE_HOST"] = "localhost"
ENV["APP_DATABASE_PORT"] = "4321"
ENV["APP_SERVER_HOSTS_0"] = "localhost"
ENV["APP_SERVER_HOSTS_1"] = "grottopress.localhost"
ENV["APP_SERVER_PORT"] = "8080"
ENV["APP_WEBHOOKS_0_URL"] = "https://example.com"
ENV["APP_WEBHOOKS_0_TOKEN"] = "a1b2c2"
ENV["APP_WEBHOOKS_1_URL"] = "https://myapp.net"
ENV["APP_WEBHOOKS_1_TOKEN"] = "d4e5f6"
```
It sets file permission (`0600` by default) for all config files.
*Envy* supports loading a file from a supplied list of files in decreasing order of priority; the first readable file is loaded.
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
envy:
github: GrottoPress/envy
```
2. Run `shards install`
## Usage
- Load the first readable file from a supplied list of files. Optionally set files permissions. This does *not* overwrite existing environment variables:
```crystal
require "envy"
Envy.from_file ".env.yml", ".env.dev.yml", perm: 0o400
```
- Load the first readable file from a supplied list of files. Optionally set files permissions. This *overwrites* existing environment variables:
```crystal
require "envy"
Envy.from_file! ".env.yml", ".env.dev.yml", perm: 0o400
```
## Contributing
1. [Fork it](https://github.com/GrottoPress/envy/fork)
1. Switch to the `master` branch: `git checkout master`
1. Create your feature branch: `git checkout -b my-new-feature`
1. Make your changes, updating changelog and documentation as appropriate.
1. Commit your changes: `git commit`
1. Push to the branch: `git push origin my-new-feature`
1. Submit a new *Pull Request* against the `GrottoPress:master` branch.
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.0- Tagged
- Aug 9, 2026
- Commit
390343477713- Indexed
- not yet
Dependents
Repository
github.com/GrottoPress/envy
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 13, 2026
- Synced
- Aug 13, 2026
- Versions
- 12