Publish JFrog CLI plugins to a registry
Publish a JFrog CLI plugin to the plugins registry. You run this command from the plugin's directory.
Before you begin
- Go must be installed and on your
PATH. The publish command compiles your plugin source into binaries during upload.- A JFrog CLI server configuration must exist for your target registry. Run
jf config showto confirm. For a private registry, add one withjf config add.- Your plugin project must follow the Plugin Developer Guide structure (Go binary with specific entry points).
JFROG_CLI_PLUGINS_SERVERis required for this command. There is no default publish target β you must explicitly specify the destination server.
Synopsis
jf plugin publish <plugin-name> <plugin-version> [options]
Aliases: plugin p
Arguments
| Argument | Required | Description |
|---|---|---|
<plugin-name> | Yes | Name of the plugin to publish |
<plugin-version> | Yes | Version of the plugin to publish. Must exactly match the version string declared in your plugin's App.Version field, including any v prefix (for example, v1.2.0) |
Options
None.
Environment Variables
| Variable | Default | Required | Description |
|---|---|---|---|
JFROG_CLI_PLUGINS_SERVER | None | Yes | Configured Artifactory server ID to publish the plugin to (use jf config show to list servers) |
JFROG_CLI_PLUGINS_REPO | jfrog-cli-plugins | No | Repository name on the target server. Use with JFROG_CLI_PLUGINS_SERVER for a custom registry |
Examples
Show Help
To show publish command help:
-
Run:
jf plugin publish --help
Publish a Plugin
To publish a plugin to your configured registry:
-
Set the target server ID and change to your plugin root directory.
-
Run:
export JFROG_CLI_PLUGINS_SERVER=<server-id> cd <plugin-root-directory> jf plugin publish <plugin-name> <plugin-version>Where:
<server-id>: JFrog CLI server ID for the Artifactory instance that hosts the plugins repository<plugin-root-directory>: Path to the root of your plugin source tree<plugin-name>: Plugin name (must match your project)<plugin-version>: Version string matchingApp.Version(for example,v1.2.0)
For example:
export JFROG_CLI_PLUGINS_SERVER=my-server cd /path/to/my-awesome-plugin jf plugin publish my-awesome-plugin v1.2.0
Expected output:
[Info] Verifying version uniqueness...
[Info] Building plugin for: <os>-<arch>...
[Info] Verifying versions matching...
[Info] Publishing my-awesome-plugin:v1.2.0 to my-server...
Publish to Custom Registry
To publish using a non-default repository name:
-
Set both environment variables, then publish from the plugin root:
export JFROG_CLI_PLUGINS_SERVER=<server-id> export JFROG_CLI_PLUGINS_REPO=<repo-name> cd <plugin-root-directory> jf plugin publish <plugin-name> <plugin-version>Where:
<server-id>: JFrog CLI server ID<repo-name>: Local generic repository name for plugins on that server<plugin-root-directory>: Path to your plugin source root<plugin-name>: Plugin name<plugin-version>: Version to publish
For example:
export JFROG_CLI_PLUGINS_SERVER=my-server export JFROG_CLI_PLUGINS_REPO=my-plugins-repo cd /path/to/my-awesome-plugin jf plugin publish my-awesome-plugin v1.2.0
When to Use
Use jf plugin publish when you have developed a JFrog CLI plugin and want to share it via the plugins registry (or your organization's private registry).
Important Notes
- Run this command from the root directory of your plugin source code.
- Go is required. The CLI compiles your plugin source into binaries for each target platform during publish. Ensure
gois installed and on yourPATH. JFROG_CLI_PLUGINS_SERVERis mandatory. The command will fail immediately if this environment variable is not set.- Version must match exactly. The
<plugin-version>argument must exactly match the version string declared in your plugin'sApp.Versionfield, including anyvprefix. For example, if your plugin declaresapp.Version = "v1.2.0", passv1.2.0β not1.2.0. - The plugin must conform to the JFrog CLI plugin structure (Go binary with specific entry points). See the Plugin Developer Guide for requirements.
- Publishing to the official registry requires the plugin to be accepted into the jfrog-cli-plugins-reg repository.
- For private registries, set both
JFROG_CLI_PLUGINS_SERVERandJFROG_CLI_PLUGINS_REPO. - After publishing, verify the plugin works by installing it:
jf plugin install <plugin-name>.
Updated 14 days ago
