Skip to content

Hacking: plugin-crawler CLI #1601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

leventebalogh
Copy link
Collaborator

@leventebalogh leventebalogh commented Mar 6, 2025

What is this?

A simple - at this point mostly internal - CLI tool for fetching information about Grafana plugins that have their source code available on Github.

Screen.Recording.2025-03-06.at.14.44.12.mov

How to try out?

You will need to create a Github PAT and make it available as GITHUB_PAT in the bash session.

Install

git checkout leventebalogh/github-crawler
cd ./packages/plugin-crawler
npm install
npm run build

Run

# List all plugins
node ./dist/bin/run.js plugins

# List plugins of a certain type
node ./dist/bin/run.js plugins --panel
node ./dist/bin/run.js plugins --app
node ./dist/bin/run.js plugins --panel --app

# List plugins which have a certain `plugin.json` field defined
node ./dist/bin/run.js plugins --pluginJsonFieldDefined "extensions.addedLinks"

# List plugins based on their dependencies
node ./dist/bin/run.js plugins --dependency "@grafana/scenes"
node ./dist/bin/run.js plugins -d "@grafana/scenes@>=6" -d "react-router-dom@>=6"

# Find by plugin id
node ./dist/bin/run.js plugins --id asserts

# JSON output
node ./dist/bin/run.js plugins --json
node ./dist/bin/run.js plugins --json | jq '.[] | select(.pluginJson?.extensions != null) | .pluginJson.id'

# Disable caching
node ./dist/bin/run.js plugins --no-cache

# Find extensions 
node ./dist/bin/run.js extensions

# Print out extensions info in a verbose way (this can be used in combination with any extension commands)
node ./dist/bin/run.js extensions -v

# Find extensions for a certain plugin
node ./dist/bin/run.js extensions --pluginId "asserts" -v

# Find certain type of extensions
node ./dist/bin/run.js extensions --pluginId --addedLinks
node ./dist/bin/run.js extensions --pluginId --addedComponents
node ./dist/bin/run.js extensions --pluginId --exposedComponents
node ./dist/bin/run.js extensions --pluginId --exposedComponentUsages
node ./dist/bin/run.js extensions --pluginId --extensionPoints

Copy link
Contributor

github-actions bot commented Mar 6, 2025

Hello! 👋 This repository uses Auto for releasing packages using PR labels.

❌ This PR cannot be merged until the following issues are addressed:

  • This PR is missing one of the following labels: patch, minor, major, no-changelog.
  • Optionally if using a patch, minor or major label also add the release label if you would like this PR to trigger npm package publishing.
🏷️ More info about which labels to use
  • If the changes only affect the docs website, documentation, or this repository's tooling add the no-changelog label.
  • If there are changes to any of the npm packages src files please choose from one of the following labels:
    • 🐛 if this PR fixes a bug add the patch label
    • 🚀 if this PR includes an enhancement add the minor label
    • 💥 if this PR includes a breaking change add the major label
  • Optionally, if you would like this PR to publish new versions of packages when it is merged add the release label.

@tolzhabayev tolzhabayev moved this from 📬 Triage to 🧑‍💻 In development in Plugins Platform / Grafana Community Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🧑‍💻 In development
Development

Successfully merging this pull request may close these issues.

1 participant