A unified configuration library combining environment variables and CLI arguments with a clear priority chain.
Available in both JavaScript and Rust.
lino-arguments provides a unified configuration system that automatically loads configuration from multiple sources with a clear priority chain:
- CLI arguments - Highest priority (manually entered options)
- Environment variables - With case-insensitive lookup
- Configuration file - Dynamic config file path via CLI
- Default values - Fallback values
The JavaScript version supports Node.js, Bun, and Deno runtimes.
npm install lino-argumentsimport { makeConfig } from 'lino-arguments';
const config = makeConfig({
yargs: ({ yargs, getenv }) =>
yargs.option('port', { default: getenv('PORT', 3000) }),
});See js/README.md for full documentation.
The Rust version uses clap for argument parsing.
[dependencies]
lino-arguments = "0.2"use clap::Parser;
use lino_arguments::{getenv_int, getenv_bool};
#[derive(Parser)]
struct Args {
#[arg(short, long, default_value_t = getenv_int("PORT", 3000) as u16)]
port: u16,
}See rust/README.md for full documentation.
lino-arguments/
├── js/ # JavaScript implementation
│ ├── src/ # Source code
│ ├── tests/ # Tests
│ ├── examples/ # Usage examples
│ ├── .changeset/ # Changesets for JS releases
│ └── package.json # npm package config
├── rust/ # Rust implementation
│ ├── src/ # Source code
│ ├── tests/ # Integration tests
│ ├── changelog.d/ # Changelog fragments for Rust releases
│ └── Cargo.toml # Cargo package config
├── scripts/ # Shared release/CI scripts
├── .github/workflows/ # CI/CD workflows
│ ├── js.yml # JavaScript CI/CD
│ └── rust.yml # Rust CI/CD
└── docs/ # Documentation
cd js
npm install
npm test
npm run lintcd rust
cargo test
cargo clippy
cargo fmtSee the language-specific directories for contribution guidelines:
Both languages use changelog fragments for versioning:
- JavaScript uses
.changeset/with changesets - Rust uses
changelog.d/with markdown fragments
This is free and unencumbered software released into the public domain. See the LICENSE file for details.