@freelensapp/example-extension
v1.8.0
Published
Example of a Freelens extension
Maintainers
Readme
@freelensapp/example-extension
This repository serves as an example how to build and publish extensions for Freelens application.
Visit wiki page about creating extensions for more informations.
Requirements
- Kubernetes >= 1.24
- Freelens >= 1.8.0
API supported
- example.freelens.app/v1alpha1
To install Custom Resource Definition for this example run:
kubectl apply -f examples/crds/customresourcedefinition.yamlExamples provide a resource for test:
kubectl apply -f examples/test/example.yamlInstall
To install open Freelens and go to Extensions (ctrl+shift+E or
cmd+shift+E), and install @freelensapp/example-extension.
or:
Use a following URL in the browser: freelens://app/extensions/install/%40freelensapp%2Fexample-extension
Build from the source
You can build the extension using this repository.
Prerequisites
Use NVM or mise-en-place or windows-nvm to install the required Node.js version.
From the root of this repository:
nvm install
# or
mise install
# or
winget install CoreyButler.NVMforWindows
nvm install 22.21.1
nvm use 22.21.1Install Pnpm:
corepack install
# or
curl -fsSL https://get.pnpm.io/install.sh | sh -
# or
winget install pnpm.pnpmBuild extension
pnpm i
pnpm build
pnpm packOne script to build then pack the extension to test:
pnpm pack:devInstall built extension
The tarball for the extension will be placed in the current directory. In Freelens, navigate to the Extensions list and provide the path to the tarball to be loaded, or drag and drop the extension tarball into the Freelens window. After loading for a moment, the extension should appear in the list of enabled extensions.
Check code statically
pnpm lint:checkor
pnpm trunk:checkand
pnpm build
pnpm knip:checkTesting the extension with unpublished Freelens
In Freelens working repository:
rm -f *.tgz
pnpm i
pnpm build
pnpm pack -rthen for extension:
echo "overrides:" >> pnpm-workspace.yaml
for i in ../freelens/*.tgz; do
name=$(tar zxOf $i package/package.json | jq -r .name)
echo " \"$name\": $i" >> pnpm-workspace.yaml
done
pnpm clean:node_modules
pnpm buildLicense
Copyright (c) 2025 Freelens Authors.
