#35814 contrib: Autogenerate bitcoin-cli bash completion file from getopenrpcinfo

full analysis

https://github.com/bitcoin/bitcoin/pull/35814 · carloantinarella · +1574/-68 in 3 files, 2 commits · labels: Scripts and tools

Goal

  • Autogenerate bitcoin-cli bash completions directly from RPC metadata
  • Stop completions from falling out of sync whenever RPC commands or arguments change
  • Add shell autocompletion support for named RPC arguments

Adds a functional test and generator script that parses getopenrpcinfo and bitcoin-cli -help to autogenerate the Bash autocompletion file. The generated script supports both positional arguments and named argument options.

Problem: The bitcoin-cli Bash autocompletion script historically required manual synchronization whenever RPC commands were added or updated, frequently leaving it out of date (issue #17289).

Category: Tools and scripts (#1 of 22)

P3 · developer tool

  • P3 because it automates bash completions to keep them in sync with RPC changes
  • Improves CLI ergonomics for operators and developers by adding named argument completion

P3 because it addresses a long-standing developer experience friction point by automating bash completion updates. As noted in the description, 'Current bitcoin-cli bash autocompletion file needs to be manually updated in case RPC commands are created, modified or removed', and earlier attempts (#18606, #25243, #30860) stalled. Leveraging getopenrpcinfo provides a clean way to keep completion in sync.

Membership: Modifies contrib/completions/bash/bitcoin-cli.bash and adds a generator test script for developer tooling.

Factors: security/stability 0, bug 0, performance 0, user value 2, leverage 1

Reviewability: Ready

  • Ready for review, applies cleanly with passing CI

The PR has passing CI, has no merge conflicts, and is ready for code review.

Author status: silent since 2026-07-26

Agreement: Crickets

  • No reviews or comments have been posted yet
  • Awaiting initial feedback from maintainers and CLI users

Crickets: no reviews or comments yet.

There has been no feedback or review activity on this pull request.

Objections: none enumerated.

State derived from the lists: no substantive comment either way

Review verdicts (DrahtBot): 0

Files

1642 lines under test/bench/ci.

  • contrib/completions/bash/bitcoin-cli.bash +1095/-68
  • test/functional/tool_rpc_autocompletion.py +478/-0
  • test/functional/test_runner.py +1/-0

Card

This PR automates the generation and verification of the bitcoin-cli Bash autocompletion file by parsing the output of getopenrpcinfo and bitcoin-cli -help within a functional test. It resolves long-standing issue #17289 by preventing the completion file from falling out of sync with new or updated RPC commands and adds support for named parameters. The PR is ready for review with no open objections, but has received no comments or reviews yet.

Data

dossier JSON · extract JSON · model openrouter/google/gemini-3.8-flash, generated 2026-09-17T21:39, confidence high, input hash 52657f4db8e3d381