NAME
Langertha::Knarr::CLI::Cmd::Init - Scan environment and generate Knarr configuration
VERSION
version 1.102
DESCRIPTION
Implements the knarr init command. Scans %ENV and any .env files for known API key variables (.env and .env.local in the current directory and $HOME/.env are always scanned when they exist), then generates a complete YAML configuration and writes it to stdout or a file.
knarr init > knarr.yaml
knarr init -e .env.production -o production.yaml
knarr init -l 0.0.0.0:8080 -l 0.0.0.0:11434 > knarr.yaml # for a container
The generated config listens on 127.0.0.1:8080 and 127.0.0.1:11434 unless -l says otherwise, enables auto_discover, sets OpenAI as the default engine when an OpenAI key was found, names the variable each key was found in as api_key_env (the default engine included), and has no passthrough: section.
See knarr for full option details, "scan_env" in Langertha::Knarr::Config for the env scanning logic, and Langertha::Knarr::Config for the config format.
SEE ALSO
knarr — CLI synopsis and option reference
"scan_env" in Langertha::Knarr::Config — API key detection
"generate_config" in Langertha::Knarr::Config — YAML generation
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/Getty/langertha-knarr/issues.
IRC
Join #langertha on irc.perl.org or message Getty directly.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.