Skip to content

feat(plugins): add zero plugins info command#773

Open
Ayush7614 wants to merge 2 commits into
Gitlawb:mainfrom
Ayush7614:feat/plugins-info
Open

feat(plugins): add zero plugins info command#773
Ayush7614 wants to merge 2 commits into
Gitlawb:mainfrom
Ayush7614:feat/plugins-info

Conversation

@Ayush7614

@Ayush7614 Ayush7614 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add zero plugins info <id> [--user] [--json] to inspect installed plugins
  • Show manifest path, enabled state, extension counts, lockfile source/hash, and hash drift
  • Mirrors the existing zero skill info workflow

Test plan

  • go test ./internal/plugins/ ./internal/cli/ -count=1
  • go vet on changed packages
  • golangci-lint (unused/ineffassign/staticcheck) on ./internal/plugins/ — 0 issues
  • govulncheck — no vulnerabilities
  • Manual: install a plugin, run zero plugins info <id>, confirm lock metadata

Summary by CodeRabbit

  • New Features

    • Added zero plugins info <plugin-id> to inspect plugin details.
    • View installation status, manifest location, available capabilities, source, and lock metadata.
    • Detect when a plugin differs from its recorded lock information.
    • Added --user and --json options for targeted and machine-readable output.
    • Updated plugin help and extension documentation.
  • Bug Fixes

    • Improved handling and reporting when a requested plugin is not installed.

Add plugins info to inspect manifest state, extension counts, and
lockfile source/hash with optional hash drift detection.
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Ayush7614, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 5 minutes

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 64a1bf6b-44d6-4b92-adbf-3853d37b6f6c

📥 Commits

Reviewing files that changed from the base of the PR and between 41fb27d and 74aac04.

📒 Files selected for processing (3)
  • internal/cli/distribution.go
  • internal/plugins/info.go
  • internal/plugins/info_test.go

Walkthrough

Adds a zero plugins info <id> command that reports plugin details, manifest and source paths, enabled state, inventory counts, lock metadata, and hash drift. It supports user-scoped or workspace-aware loading, text or JSON output, help text, usage errors, tests, and documentation.

Changes

Plugin info command

Layer / File(s) Summary
Plugin metadata API
internal/plugins/info.go, internal/plugins/info_test.go
Adds plugins.Info, result types, missing-plugin errors, lock metadata loading, hash-drift detection, and tests for metadata and missing plugins.
CLI routing and reporting
internal/cli/distribution.go, internal/cli/extensions.go
Adds command dispatch, --user/--json/--help parsing, workspace-aware loading, formatted and JSON output, usage errors, and help text.
Command validation and documentation
internal/cli/distribution_test.go, docs/EXTENDING.md
Tests successful plugin inspection and documents the new command and reported fields.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant runPlugins
  participant runPluginInfo
  participant plugins.Info
  participant PluginLoader
  participant Lockfile
  User->>runPlugins: invoke plugins info <id>
  runPlugins->>runPluginInfo: dispatch command
  runPluginInfo->>plugins.Info: request plugin metadata
  plugins.Info->>PluginLoader: discover plugin
  plugins.Info->>Lockfile: read lock metadata
  plugins.Info-->>runPluginInfo: return plugin and drift details
  runPluginInfo-->>User: render text or JSON
Loading

Possibly related PRs

  • Gitlawb/zero#61: Extends the same plugin CLI dispatcher and help surface.
  • Gitlawb/zero#653: Introduces plugin lock and manifest metadata reused by this command.
  • Gitlawb/zero#693: Shares plugin CLI routing and missing-plugin error handling.

Suggested reviewers: vasanthdev2004, kevincodex1

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding the zero plugins info command.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
internal/cli/distribution.go (1)

315-320: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consolidate duplicate conditional blocks.

Both blocks check info.LockHash != "". Consolidating them reduces duplication and improves readability.

♻️ Proposed refactor
-	if info.LockHash != "" {
-		lines = append(lines, "  lock hash: "+info.LockHash)
-	}
-	if info.LockHash != "" {
-		lines = append(lines, fmt.Sprintf("  hash drift: %t", info.HashDrift))
-	}
+	if info.LockHash != "" {
+		lines = append(lines, "  lock hash: "+info.LockHash)
+		lines = append(lines, fmt.Sprintf("  hash drift: %t", info.HashDrift))
+	}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/cli/distribution.go` around lines 315 - 320, Consolidate the two
adjacent info.LockHash checks in the distribution output into a single
conditional block that appends both the lock hash and hash drift lines,
preserving their current order and formatting.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/plugins/info.go`:
- Around line 20-24: Derive lockfile lookup from each loaded plugin’s directory
instead of a caller-provided lock directory: remove LockDir from InfoOptions and
use filepath.Dir(plugin.PluginDir) in the Info logic, adding the filepath
import. Remove the LockDir assignment from the plugins.InfoOptions literal in
internal/cli/distribution.go and from both InfoOptions literals in
internal/plugins/info_test.go; apply these changes at internal/plugins/info.go
lines 20-24 and 50-52, internal/cli/distribution.go lines 274-277, and
internal/plugins/info_test.go lines 32-35 and 52-55.

---

Nitpick comments:
In `@internal/cli/distribution.go`:
- Around line 315-320: Consolidate the two adjacent info.LockHash checks in the
distribution output into a single conditional block that appends both the lock
hash and hash drift lines, preserving their current order and formatting.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 04a8632d-a853-499b-b11d-a828a41f1578

📥 Commits

Reviewing files that changed from the base of the PR and between da9fb50 and 41fb27d.

📒 Files selected for processing (6)
  • docs/EXTENDING.md
  • internal/cli/distribution.go
  • internal/cli/distribution_test.go
  • internal/cli/extensions.go
  • internal/plugins/info.go
  • internal/plugins/info_test.go

Comment thread internal/plugins/info.go
Remove LockDir from InfoOptions and read the lockfile from
filepath.Dir(plugin.PluginDir) so lock metadata matches the resolved
plugin location. Consolidate duplicate lock hash output lines.
@Ayush7614

Copy link
Copy Markdown
Contributor Author

Addressed CodeRabbit review in 74aac04:

  • Removed LockDir from InfoOptions; lockfile is now read from filepath.Dir(plugin.PluginDir) so metadata matches the resolved install path.
  • Merged duplicate LockHash output blocks in the CLI text formatter.

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.

1 participant