feat(internal/librarian): add debug command with env subcommand - #6576
Conversation
A new debug command with an env subcommand is added to the CLI to print the librarian environment. This includes resolved paths for LIBRARIAN_CACHE, LIBRARIAN_BIN, and language-specific tool installation directories. To support accessing the tool installation directories from the new command, the internal getInstallDir functions in the golang and java packages are exported as InstallDir.
There was a problem hiding this comment.
Code Review
This pull request introduces a new debug env command to the librarian CLI, which prints out resolved environment paths and language-specific tool installation directories. To support this, the installation directory retrieval functions for Go and Java tools have been exported. The feedback highlights that the runEnv function silently ignores errors when retrieving these directories, and suggests propagating these errors to the caller instead of using blank identifiers.
JoeWang1127
left a comment
There was a problem hiding this comment.
Could you create an issue for this feature?
We should document the rational for this feature in the issue.
JoeWang1127
left a comment
There was a problem hiding this comment.
Sorry I have one more comment about the return type.
🤖 I have created a release *beep* *boop* --- ## [0.24.0](v0.23.0...v0.24.0) (2026-07-01) ### Features * **add:** handle Release Please config for google-cloud-node ([#6569](#6569)) ([1f8ee00](1f8ee00)) * **internal/librarian/java:** add code snippet extraction helpers for README rendering ([#6593](#6593)) ([96f6925](96f6925)), closes [#6515](#6515) * **internal/librarian/java:** add extractSamples for README generation ([#6578](#6578)) ([b5e3d45](b5e3d45)), closes [#6515](#6515) * **internal/librarian/nodejs:** add metadata_name_override and name_pretty_override support ([#6603](#6603)) ([3f6cfed](3f6cfed)), closes [#6453](#6453) * **internal/librarian:** add debug command with env subcommand ([#6576](#6576)) ([027103b](027103b)), closes [#6374](#6374) * **internal/librarian:** populate Java Maven coordinates from defaults ([#6554](#6554)) ([accb8ad](accb8ad)), closes [#6513](#6513) * **librarian/swift:** use discovery config ([#6604](#6604)) ([5a44ed7](5a44ed7)) * **sidekick/discovery:** signatures without path params ([#6588](#6588)) ([bb40e83](bb40e83)) ### Bug Fixes * **internal/librarian/java:** exclude google-cloud-bom and libraries-bom when generating gapic-libraries-bom/pom.xml ([#6601](#6601)) ([b8e50a5](b8e50a5)) * **internal/serviceconfig:** normalize transport name for Java repo-metadata ([#6582](#6582)) ([e20f77a](e20f77a)) * **sdk.yaml:** allow rust for many non-cloud apis ([#6598](#6598)) ([0efb6e7](0efb6e7)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
A new
debugcommand with anenvsubcommand is added to the CLI to print the librarian environment. This includes resolved paths forLIBRARIAN_CACHE,LIBRARIAN_BIN, and language-specific tool installation directories.To support accessing the tool installation directories from the new command, the internal
getInstallDirfunctions in the golang and java packages are exported asInstallDir.Local Testing
run
go run ./cmd/librarian debug env, result:Fixes #6374