feat(cli): read config from stdin#1316
Open
corylanou wants to merge 1 commit into
Open
Conversation
PR Build Metrics✅ All clear — no issues detected
Binary Size
Dependency ChangesNo dependency changes. govulncheck OutputBuild Info
🤖 Updated on each push. |
|
🤩 Really looking forward to this feature. Thank you so much for addressing #1205! |
benbjohnson
requested changes
Jun 23, 2026
benbjohnson
left a comment
Owner
There was a problem hiding this comment.
Can you change this so that it uses -config - to read from STDIN rather than adding a -stdin flag? I tried looking around for other tools that read config from STDIN and that seems to be the convention:
docker compose -f -caddy run --config -kubectl apply -f -
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a
-stdinconfig source for CLI commands that already read Litestream configuration. The shared config loader now reads from either-config, standard input, or the default config path, and rejects-configplus-stdintogether.Scope:
databases,status,replicate,ltx,restore, andresetconfig loading.-stdinwith direct replica URL/positional replica URL flows where-configis already invalid.Motivation and Context
Issue #1205 requests passing dynamically generated configuration through standard input so integrations do not need to create temporary config files that may contain credentials.
Fixes #1205
How Has This Been Tested?
go test -run 'TestReadConfig|TestDatabasesCommand_Run/StdinJSONOutput' ./cmd/litestreamgo test ./cmd/litestreamgo build ./...go test ./...pre-commit run --all-filesgo test -race ./...golangci-lint run --new-from-rev=c30c5ffc364d6ee35b0b37d8ce4278371c8107a8golangci-lint runwithout a diff base currently reports existingerrcheckfindings outside this change; the diff-scoped run reports0 issues.Types of changes
Checklist
go fmt,go vet)go test ./...)