Skip to content

feat(cli): add dotenv support, env var template, and bitcoind setup docs - #342

Closed
Olorunshogo wants to merge 1 commit into
bitcoindevkit:masterfrom
Olorunshogo:feat/dotenv-onboarding
Closed

Olorunshogo wants to merge 1 commit into
bitcoindevkit:masterfrom
Olorunshogo:feat/dotenv-onboarding

Conversation

@Olorunshogo

Copy link
Copy Markdown

Description

Notes to the reviewers

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

PR summary

Summary

  • Add dotenvy and load .env at startup, before env_logger::init(), so every #[arg(env = "...")] value in src/ can be set via a file instead of shell exports. A missing .env stays silent; a malformed one now logs a warn! instead of failing silently.
  • Add .env.example documenting every environment variable the CLI reads, grouped by command (global options, descriptors, backends, proxy, key management, transaction building, PSBT ops, compile, Payjoin, logging).
  • Fix .gitignore: the entry was .env/, a directory-only pattern that never matched the .env file itself. Changed to .env.
  • README.md:
    • Document the bitcoind/bitcoin-cli prerequisite for the rpc feature and the Justfile workflow, with an install snippet and a checksum-verification note.
    • Wire cp .env.example .env into both the install instructions and the regtest walkthrough.
    • Fix the $(just address) vs ${just address} footgun with an explicit note.
    • Renumber the regtest walkthrough steps to stay sequential after the new step was inserted.

Files changed

File Change
Cargo.toml / Carg5"
src/main.rs load .env on startup, warn on parse failure
.env.example new
.gitignore fix .env/ → .env
README.md bitcoi step fixes

Test plan

                                                                      - [ ] `cargo build` an` succeed
  • cp .env.example .env, set NETWORK, confirm it applies without a CLI flag
  • Put an invalid line in .env, confirm a warn log appears and the app still starts
  • git check-ignore .env reports it as ignored
  • Walk the regtestend

@Olorunshogo Olorunshogo closed this Oct 8, 2026
@Olorunshogo
Olorunshogo deleted the feat/dotenv-onboarding branch October 8, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant