Publish JFrog CLI Plugins to a Registry
Publish a JFrog CLI plugin to the JFrog CLI Plugins Registry. You run this command from the plugin's directory.
Before you begin
The Go programming language 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. Runjf config showto confirm. For a private registry, add one withjf config add. Your plugin project must follow the Plugin Developer Guide structure as a Go binary with specific entry points. TheJFROG_CLI_PLUGINS_SERVERenvironment variable is 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
The following table lists jf plugin publish 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
The following table lists jf plugin publish options.
| Flag | Short | Default | Description |
|---|---|---|---|
--format | β | β | Output format. Available from JFrog CLI 2.105.0. Only json is supported (table is not accepted). With --format json the command emits {"status_code":N,"message":"..."}. Passing --format alone returns Incorrect Usage: flag needs an argument: -format; passing an unsupported value (for example, --format=table) returns [π¨Error] only the following output formats are supported: json. |
Environment Variables
The following table lists environment variables for jf plugin publish.
| Variable | Default | Required | Description |
|---|---|---|---|
JFROG_CLI_PLUGINS_SERVER | None | Yes | Configured JFrog Artifactory server identifier 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 the following command.
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 identifier for the JFrog Artifactory instance that hosts the plugins repository.<plugin-root-directory>β Path to the root of your plugin source tree.<plugin-name>β Plugin name. This value must match your project.<plugin-version>β Version string matchingApp.Version, such asv1.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=<repository-name> cd <plugin-root-directory> jf plugin publish <plugin-name> <plugin-version>Where:
<server-id>β JFrog CLI server identifier.<repository-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 through 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. JFrog CLI compiles your plugin source into binaries for each target platform during publish. Ensure the
gocommand is installed and on yourPATH. JFROG_CLI_PLUGINS_SERVERis mandatory. The command fails 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. When your plugin declaresapp.Version = "v1.2.0", passv1.2.0, not1.2.0. - The plugin must conform to the JFrog CLI plugin structure as a Go binary with specific entry points. For requirements, see the Plugin Developer Guide.
- 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. For more information, see
jf plugin install.
