FF

freelensapp/freelens-example-extension

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

5 stars 质量 66 趋势 33MIT

Example of a Freelens extension

概览

This repository is the reference template for building, type-checking, testing and releasing an extension for the Freelens application. The Freelens extension documentation describes the extension API and points here for everything around it. Start a new extension from a copy of this repository. The extension adds a cluster page, a details panel and a context menu item for a custom resource, Example, and a setting on the preferences page: - Example is implemented for v1alpha1 and v1alpha2, each with its own model, list page, details and menu item. v1alpha2 renames spec.active to spec.suspended, with the meaning inverted. - The "Examples" page shows the newest version the cluster serves, or a message when the CRDs are not installed. - While the extension is enabled, Example is left out of the Custom Resources tree of the cluster sidebar, so it is listed once, under "Examples". - Per-object logic is a static method that takes the object, such as Example.getSuspended(object).

README

以下为原文 README 节选,完整内容请查看原文。

@freelensapp/example-extension

Overview

This repository is the reference template for building, type-checking, testing and releasing an extension for the Freelens application. The Freelens extension documentation describes the extension API and points here for everything around it. Start a new extension from a copy of this repository.

The extension adds a cluster page, a details panel and a context menu item for a custom resource, Example, and a setting on the preferences page:

  • Two API versions of one CRD. Example is implemented for v1alpha1 and v1alpha2, each with its own model, list page, details and menu item. v1alpha2 renames spec.active to spec.suspended, with the meaning inverted.
  • The served API version picked at runtime. The “Examples” page shows the newest version the cluster serves, or a message when the CRDs are not installed.
  • One sidebar entry for the resource. While the extension is enabled, Example is left out of the Custom Resources tree of the cluster sidebar, so it is listed once, under “Examples”.
  • Static helpers on the model. Per-object logic is a static method that takes the object, such as Example.getSuspended(object).
  • An error boundary. Each page, details panel and menu item renders an error message instead of breaking the view when it throws.
  • A persisted preference. The “Example checkbox” setting is kept across restarts and shown in the details panel.

Agent skills

Two skills in the Agent Skills format guide a coding agent, such as Claude Code, Codex, GitHub Copilot, Cursor or Gemini CLI, through an extension in its own repository:

  • create-freelens-extension starts a new Freelens extension from a copy of this repository.
  • port-freelens-extension-to-v2 ports an extension written for the v1 extension API to v2.
在 GitHub 查看完整 README

推荐工具

换一个关键词,或者移除筛选条件。

安装

npx skillfish add freelensapp/freelens-example-extension
新手?先看 mcpskill.org 教程 →