Conversation
WalkthroughAdds a hidden CLI command to generate man pages, includes generated manpages in release packaging (archives, NFPM, Docker/Homebrew/Nix), updates command help text, adjusts dev/test scripts and .gitignore, and adds manpage-generation dependencies. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer / CI
participant CLI as https-wrench (cobra rootCmd)
participant Gen as go-md2man / GenManTree
participant FS as Filesystem (manpages/)
participant Release as goreleaser
Dev->>CLI: run `https-wrench man --dest-dir=manpages`
CLI->>Gen: build GenManHeader & call GenManTree(rootCmd, dest)
Gen->>FS: write generated .1 files (and .1.gz)
Note right of FS: manpages/ now contains generated pages
Dev->>Release: run goreleaser
Release->>FS: before hooks generate manpages (if not present)
Release->>Release: include `manpages/*` in archives, NFPM, Homebrew, Docker, Nix artifacts
Release->>Users: release artifacts include manpages
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
cmd/man.go (1)
40-41: Consider default directory alignment with build process.The default destination directory is "." (current directory), but the build process uses "manpages" (as seen in .goreleaser.yaml line 28-29). Consider whether defaulting to "manpages" would be more consistent, though the current approach offers flexibility.
If you prefer consistency with the build process, apply this diff:
manCmd.Flags().StringVar(&manPagesDestDir, "dest-dir", - ".", "Destination directory for the man pages files") + "manpages", "Destination directory for the man pages files")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (8)
.gitignore(1 hunks).goreleaser.yaml(5 hunks)cmd/certinfo.go(1 hunks)cmd/man.go(1 hunks)cmd/requests.go(1 hunks)cmd/root.go(1 hunks)devenv.nix(3 hunks)go.mod(2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-11-15T17:16:55.051Z
Learnt from: xenOs76
Repo: xenOs76/https-wrench PR: 5
File: devenv.nix:569-569
Timestamp: 2025-11-15T17:16:55.051Z
Learning: In the xenOs76/https-wrench repository, the devenv.nix test environment is local-only without GitHub CI integration, so automatic dependency updates in enterTest are acceptable for the maintainer's workflow.
Applied to files:
devenv.nix
📚 Learning: 2025-11-08T16:00:48.187Z
Learnt from: xenOs76
Repo: xenOs76/https-wrench PR: 3
File: internal/requests/requests.go:164-182
Timestamp: 2025-11-08T16:00:48.187Z
Learning: In the https-wrench tool (xenOs76/https-wrench repository), do not enforce minimum TLS version constraints in the HTTP client configuration. The tool is designed to inspect and test TLS settings on various servers, including legacy ones, and needs the flexibility to connect to servers with older TLS versions.
Applied to files:
cmd/root.go
🔇 Additional comments (13)
cmd/requests.go (1)
27-42: LGTM! Enhanced documentation improves usability.The expanded help text provides clear guidance on configuration, sample generation, and includes helpful external references. The examples demonstrate practical usage patterns effectively.
cmd/certinfo.go (1)
23-48: LGTM! Documentation improvements enhance clarity.The updated help text better describes certinfo capabilities (fetching from TLS endpoints, reading PEM bundles, verifying key-certificate matches) with clear, consistent examples.
.gitignore (1)
5-5: LGTM! Correctly ignores generated manpages directory.This aligns with the manpage generation feature introduced in this PR, as manpages are generated during the build process (as seen in .goreleaser.yaml).
cmd/man.go (1)
17-36: LGTM! Clean implementation of manpage generation.The command correctly uses Cobra's
doc.GenManTreeto generate manpages. The command is appropriately hidden since it's primarily for build-time use. The metadata inGenManHeaderis properly configured.devenv.nix (3)
40-40: LGTM! More explicit git-hooks exclude pattern.The change from "completions" to "completions/*" makes the exclusion pattern more explicit, ensuring all files under the completions directory are excluded from git hooks.
241-244: LGTM! Test coverage for sample config display.The new test verifies that the
--show-sample-configflag correctly outputs the sample configuration with expected content (containing 'requests:').
512-512: LGTM! Test properly integrated into the test suite.The new test script is correctly added to the requests test suite execution flow.
.goreleaser.yaml (5)
27-30: LGTM! Manpage generation integrated into build process.The before hooks correctly generate manpages using the new
mancommand and compress them with gzip, making them ready for distribution.
52-52: LGTM! Archive configuration updated for new manpages directory.The path correctly references the
manpages/*directory that's created in the before hooks.
73-92: LGTM! Comprehensive manpage packaging for Linux distributions.All generated manpages are correctly mapped to their installation destinations under
/usr/share/man/man1/. This includes manpages for:
- Main command (https-wrench)
- Subcommands (requests, certinfo)
- Completion commands (bash, fish, zsh)
157-160: LGTM! Homebrew manpages configuration.The manpages section correctly lists the primary manpages for inclusion in the Homebrew cask package.
178-180: LGTM! Nix manpage installation.The
installManPagecommands correctly install the primary manpages (main command and subcommands) for the Nix package.go.mod (1)
32-32: No security vulnerabilities detected for the indirect dependencies.The verification confirms that both
github.com/cpuguy83/go-md2man/v2 v2.0.6andgithub.com/russross/blackfriday/v2are free from known security advisories in the GitHub vulnerability database. The indirect dependencies supporting manpage generation viagithub.com/spf13/cobra/docare safe to use.
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
cmd/root.go (1)
54-54: Fix typo in subcommand name (duplicate concern).Line 54 still contains "certfinfo" which should be "certinfo" to match the actual subcommand name.
Apply this diff to fix the typo:
-https-wrench has two sub commands: requests and certfinfo. +https-wrench has two sub commands: requests and certinfo.
🧹 Nitpick comments (2)
cmd/root.go (2)
59-60: Minor grammar improvement.Line 59 uses "allows to easily read" which is grammatically awkward. Consider rephrasing for better readability.
Apply this diff for a clearer phrasing:
-certinfo is a sub command that allows to easily read information from PEM certificates and keys. The +certinfo is a sub command that reads information from PEM certificates and keys. TheAlternatively:
-certinfo is a sub command that allows to easily read information from PEM certificates and keys. The +certinfo is a sub command that allows you to easily read information from PEM certificates and keys. The
54-59: Consider standardizing "subcommand" terminology.The description uses "sub commands" and "sub command" (two words) throughout lines 54, 56, and 59. The standard term in CLI documentation and Cobra is "subcommand" (one word).
Consider this diff to standardize the terminology:
-https-wrench has two sub commands: requests and certinfo. +https-wrench has two subcommands: requests and certinfo. -requests is the sub command that does HTTPS requests according to the configuration provided +requests is the subcommand that does HTTPS requests according to the configuration provided -certinfo is a sub command that allows to easily read information from PEM certificates and keys. The +certinfo is a subcommand that allows to easily read information from PEM certificates and keys. The
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
cmd/root.go(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-08T16:00:48.187Z
Learnt from: xenOs76
Repo: xenOs76/https-wrench PR: 3
File: internal/requests/requests.go:164-182
Timestamp: 2025-11-08T16:00:48.187Z
Learning: In the https-wrench tool (xenOs76/https-wrench repository), do not enforce minimum TLS version constraints in the HTTP client configuration. The tool is designed to inspect and test TLS settings on various servers, including legacy ones, and needs the flexibility to connect to servers with older TLS versions.
Applied to files:
cmd/root.go
Summary by CodeRabbit
Documentation
Chores
Tests
✏️ Tip: You can customize this high-level summary in your review settings.