monosecret_builder
Build runner generator for typed Dart access to monosecret.toml manifests.
What it does
monosecret_builder reads your monosecret.toml at build time and generates:
- A typed secrets class (e.g.
AppSecrets) with fields matching your secret names - A
Profileenum for profile-specific loading - Extension methods on
MonosecretClientfor single-secret access
Generated code contains no secret values — only configuration metadata. Values are resolved at runtime through the monosecret CLI.
Quick start
@MonosecretConfig(className: 'AppSecrets')
library app_secrets;
import 'package:monosecret/monosecret.dart';
part 'app_secrets.g.dart';
Run:
dart run build_runner build --delete-conflicting-outputs
Learn more
- Dart SDK documentation — full end-to-end setup guide
- Configuration reference