Skip to content

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

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

@Olorunshogo Olorunshogo commented Oct 8, 2026 •

Copy link
Copy Markdown

PR Summary

Summary

  • dotenvy: add dotenvy = "0.15" and load .env at startup before env_logger::init(). A missing .env stays silent; a malformed one logs a warn! instead of failing silently.
  • .env.example: new file documenting every environment variable the CLI reads, grouped by command area (global options, descriptors, backends, proxy, key management, transaction building, PSBT ops, Payjoin, logging).
  • .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 note pointing at the official verification guide. Wire cp .env.example .env into the install instructions and the regtest walkthrough. Fix the $(just address) footgun with an explicit note. Renumber the regtest steps sequentially after the new step was inserted.
  • docs/summary.md: new capability reference doc covering all commands, backends, and setup paths.

Notes to the reviewers

  • dotenvy::dotenv()'g .env stays silent(the common case), but a
    malformed one now lor::init()` runs, instead of failing silently.
  • .env.example cover value in src/,including POLICY/TYPE for
    the compile commanble names match theexisting clap definitions
    as-is; renaming themeaking anyone alreadyusing them as shell exports.
  • The Bitcoin Core insips checksumverification for brevity; added a
    note pointing at thetion guide instead ofinlining the full steps.

Files changed

File Change
Cargo.toml / Cargo.lock add dotenvy = "0.15"
src/main.rs loadarse failure
.env.example new, documents all env vars
.gitignore fix .env from being tracked
README.md bitcoind prereq, .env onboarding, step fixes

Test plan

  • cargo build and cargo build --features rpc succeed without new warnings
  • cp .env.example .env, set NETWORK=regtest, run bdk-cli wallet -w <name> balance without -n and confirm the network resolves correctly
  • put an invalid line in .env and confirm a warn! log appears and the app still starts
  • git check-ignore -v .env returns .gitignore:.env
  • walk the regtest steps in README.md end to end

Checklists

  • I've signed all my commits
  • I followed the [s://github.com/bitcoindevkit/bdk-cli/blob/master/CONTRIBUTING.md)
  • I ran cargo fmt before committing

New Features:

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

@Olorunshogo
Olorunshogo marked this pull request as ready for review October 8, 2026 15:07
@notmandatory

notmandatory commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

NACK. This project already has a config file system so I don't see any need for this change.

@tvpeter

tvpeter commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

The project already uses toml files for managing configs.

@tvpeter tvpeter closed this Oct 9, 2026
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.

3 participants