Skip to content

Add --key-output-bech32/--key-output-text-envelope to governance key-gen commands#1378

Merged
carbolymer merged 1 commit into
masterfrom
mgalazyn/key-output-format-governance
May 15, 2026
Merged

Add --key-output-bech32/--key-output-text-envelope to governance key-gen commands#1378
carbolymer merged 1 commit into
masterfrom
mgalazyn/key-output-format-governance

Conversation

@carbolymer
Copy link
Copy Markdown
Contributor

@carbolymer carbolymer commented May 15, 2026

Changelog

- description: |
    Add --key-output-bech32/--key-output-text-envelope to governance key-gen commands
# uncomment types applicable to the change:
  type:
   - feature        # introduces a new feature
  # - breaking       # the API has changed in a breaking way
   - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  # - refactoring    # QoL changes
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

Context

Closes #1165

The --key-output-bech32 and --key-output-text-envelope flags were added to some key-gen commands but were missing from the governance key-gen commands:

  • cardano-cli <era> governance drep key-gen
  • cardano-cli <era> governance committee key-gen-cold
  • cardano-cli <era> governance committee key-gen-hot

This PR adds the missing output format flags to those commands, making the behaviour consistent across all key-gen commands.

How to trust this PR

Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

Copilot AI review requested due to automatic review settings May 15, 2026 15:52
…gen commands

Adds key output format flags to drep key-gen, committee key-gen-cold,
and committee key-gen-hot, matching the existing address key-gen behaviour.

Closes #1165
@carbolymer carbolymer force-pushed the mgalazyn/key-output-format-governance branch from ba3cacb to 12acd09 Compare May 15, 2026 15:53
@carbolymer carbolymer changed the title Fix worktree gitdir paths to use relative paths Add --key-output-bech32/--key-output-text-envelope to governance key-gen commands May 15, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for selecting the output format (text envelope vs bech32) when generating Governance DRep and Committee keys, and updates the CLI golden help fixtures accordingly. It also wires the new keyOutputFormat argument through testnet-data generation so internal key generation uses the same output format as elsewhere.

Changes:

  • Add --key-output-bech32 / --key-output-text-envelope (and deprecated --key-output-format) to governance DRep and Committee key-gen* commands.
  • Update DRep/Committee key-gen run logic to write keys as either Bech32 text or TextEnvelope JSON based on the selected format.
  • Refresh golden help outputs to include the new flags and updated usage rendering.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
cardano-cli/src/Cardano/CLI/EraBased/Governance/DRep/Command.hs Adds keyOutputFormat to DRep key-gen command args.
cardano-cli/src/Cardano/CLI/EraBased/Governance/DRep/Option.hs Parses --key-output-* flags for DRep key-gen.
cardano-cli/src/Cardano/CLI/EraBased/Governance/DRep/Run.hs Writes DRep keys in Bech32 or TextEnvelope depending on selected format.
cardano-cli/src/Cardano/CLI/EraBased/Governance/Committee/Command.hs Adds keyOutputFormat to Committee key-gen args and imports the format types.
cardano-cli/src/Cardano/CLI/EraBased/Governance/Committee/Option.hs Parses --key-output-* flags for Committee key-gen commands.
cardano-cli/src/Cardano/CLI/EraBased/Governance/Committee/Run.hs Writes Committee keys in Bech32 or TextEnvelope depending on selected format.
cardano-cli/src/Cardano/CLI/EraBased/Genesis/CreateTestnetData/Run.hs Updates internal Committee/DRep key-gen invocations to pass a key output format.
cardano-cli/test/cardano-cli-golden/files/golden/help.cli Updates aggregated help usage sections to show the new format flags.
cardano-cli/test/cardano-cli-golden/files/golden/help/*governancekey-gen.cli Updates per-command golden help output to include new options and usage formatting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cardano-cli/src/Cardano/CLI/EraBased/Governance/DRep/Run.hs
@carbolymer carbolymer linked an issue May 15, 2026 that may be closed by this pull request
@carbolymer carbolymer self-assigned this May 15, 2026
Copy link
Copy Markdown
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one comment regarding adding a feature destined for deprecation.

--key-output-bech32 Format key output to BECH32.
--key-output-text-envelope
Format key output to TEXT_ENVELOPE (default).
--key-output-format STRING
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the key-output-format will be deprecated in a future version why bother adding it again?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's --key-output-format STRING that's deprecated, not the new-style --key-output-bech32 / --key-output-text-envelope flags - those are the replacements.

This PR wires pKeyOutputFormat into the governance key-gen commands that were missing it.
The deprecated --key-output-format fallback comes along automatically as part of that same parser - pFormatFlagsExt combines both the new flags and the legacy parser for backwards compatibility.

So we're not re-adding anything deprecated - we're extending the new flags to commands that never had them.

@carbolymer carbolymer added this pull request to the merge queue May 15, 2026
Merged via the queue into master with commit ce5f587 May 15, 2026
28 checks passed
@carbolymer carbolymer deleted the mgalazyn/key-output-format-governance branch May 15, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New output flag missing for governance commands

3 participants