README
¶
Nomos File Provider
Reference implementation of an external Nomos provider for file system access.
Overview
This provider implements the Nomos Provider gRPC service contract to supply configuration data from local file system directories. It reads .csl files from a configured directory and makes them available to the Nomos compiler via gRPC.
Features
- Directory-based access: Reads all
.cslfiles from a configured directory - gRPC interface: Implements
nomos.provider.v1.ProviderService - Health checks: Built-in health monitoring
- Graceful shutdown: Clean resource cleanup on termination
Installation
From GitHub Releases
Download the appropriate archive for your platform:
Linux/macOS:
# macOS ARM64
curl -LO https://github.com/autonomous-bits/nomos-provider-file/releases/download/v0.1.0/nomos-provider-file-0.1.0-darwin-arm64.tar.gz
# macOS AMD64
curl -LO https://github.com/autonomous-bits/nomos-provider-file/releases/download/v0.1.0/nomos-provider-file-0.1.0-darwin-amd64.tar.gz
# Linux AMD64
curl -LO https://github.com/autonomous-bits/nomos-provider-file/releases/download/v0.1.0/nomos-provider-file-0.1.0-linux-amd64.tar.gz
# Linux ARM64
curl -LO https://github.com/autonomous-bits/nomos-provider-file/releases/download/v0.1.0/nomos-provider-file-0.1.0-linux-arm64.tar.gz
Windows (PowerShell):
# Windows AMD64
curl -LO https://github.com/autonomous-bits/nomos-provider-file/releases/download/v0.1.0/nomos-provider-file-0.1.0-windows-amd64.tar.gz
# Windows ARM64
curl -LO https://github.com/autonomous-bits/nomos-provider-file/releases/download/v0.1.0/nomos-provider-file-0.1.0-windows-arm64.tar.gz
Verify the checksum:
Linux/macOS:
curl -LO https://github.com/autonomous-bits/nomos-provider-file/releases/download/v0.1.0/SHA256SUMS
shasum -a 256 -c SHA256SUMS
Windows (PowerShell):
curl -LO https://github.com/autonomous-bits/nomos-provider-file/releases/download/v0.1.0/SHA256SUMS
# Verify checksum manually
Extract and install:
Linux/macOS:
# Extract the archive
tar -xzf nomos-provider-file-0.1.0-*.tar.gz
# Make executable and install
chmod +x nomos-provider-file
sudo mv nomos-provider-file /usr/local/bin/
Windows (PowerShell):
# Extract the archive (tar is available in Windows 10+ or Git Bash)
tar -xzf nomos-provider-file-0.1.0-windows-*.tar.gz
# Move to a directory in your PATH, e.g., C:\Program Files\nomos-provider-file\
# Or add the extracted directory to PATH
From Source
git clone https://github.com/autonomous-bits/nomos-provider-file.git
cd nomos-provider-file
go build -o nomos-provider-file ./cmd/provider
Usage
With Nomos CLI
Declare the provider in your .csl file:
source:
alias: 'configs'
type: 'file'
version: '0.1.0'
directory: './configs'
import:configs:database
Run nomos init to install the provider:
nomos init
Then build your configuration:
nomos build -p ./config.csl
Standalone Testing
The provider can be run standalone for testing:
./nomos-provider-file
The provider will:
- Start a gRPC server on a random available port
- Print
PROVIDER_PORT=<port>to stdout - Wait for RPC calls
Configuration
The provider accepts the following configuration in the Init RPC call:
| Key | Type | Required | Description |
|---|---|---|---|
directory |
string | Yes | Absolute or relative path to directory containing .csl files |
Development
Prerequisites
- Go 1.25+ or later
- Protocol Buffers compiler (for regenerating proto stubs)
- Local clone of the Nomos repository (for now, until modules are published)
Note on Dependencies
This provider currently uses replace directives in go.mod to reference the Nomos libraries locally. For production releases, these dependencies need to be published as proper Go modules or vendored into the repository.
Building
make build
Testing
make test
Running Locally
go run ./cmd/provider
Protocol
This provider implements the nomos.provider.v1.ProviderService gRPC contract:
- Init: Initialize the provider with a directory path
- Fetch: Retrieve a
.cslfile by base name (without extension) - Info: Return provider metadata (alias, version, type)
- Health: Check provider health status
- Shutdown: Gracefully shut down the provider
Fetch Path Format
The first path component is the file base name (without .csl extension):
path: ["database"] → fetches database.csl
path: ["network"] → fetches network.csl
path: ["app", "config"] → fetches app.csl and navigates to config key
Architecture
┌──────────────┐ gRPC ┌─────────────────┐
│ Nomos │ ──────────────────────▶ │ Provider │
│ Compiler │ Init/Fetch/Info/etc │ (subprocess) │
└──────────────┘ └─────────────────┘
│
▼
┌─────────────────┐
│ File System │
│ (.csl files) │
└─────────────────┘
The provider:
- Is started as a subprocess by the Nomos compiler
- Listens on a random TCP port
- Parses
.cslfiles from the configured directory - Returns structured data via gRPC
Versioning
This project follows Semantic Versioning:
- MAJOR: Breaking changes to gRPC contract or behavior
- MINOR: New features, backward compatible
- PATCH: Bug fixes, backward compatible
License
See LICENSE file for details.
Contributing
See CONTRIBUTING.md for contribution guidelines.