Publish JFrog CLI Plugins to a Registry

Publish a custom JFrog CLI plugin to the JFrog CLI Plugins Registry or your own registry.

Publish a JFrog CLI plugin to the JFrog CLI Plugins Registry. You run this command from the plugin's directory.

📘

Note

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. Run jf config show to confirm. For a private registry, add one with jf config add. Your plugin project must follow the Plugin Developer Guide structure as a Go binary with specific entry points. The JFROG_CLI_PLUGINS_SERVER environment 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.

ArgumentRequiredDescription
<PLUGIN_NAME>YesName of the plugin to publish
<PLUGIN_VERSION>YesVersion 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.

FlagShortDefaultDescription
--formatOutput 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 with no value after the plugin name and version returns [Error] only the following output formats are supported: json. The same message appears for an unsupported value (for example, --format=table).

Environment Variables

The following table lists environment variables for jf plugin publish. For the complete list of JFrog CLI environment variables, see Environment Variables.

VariableDefaultRequiredDescription
JFROG_CLI_PLUGINS_SERVERNoneYesConfigured JFrog Artifactory server identifier to publish the plugin to. Use jf config show to list servers.
JFROG_CLI_PLUGINS_REPOjfrog-cli-pluginsNoRepository 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:

  1. Set the target server ID and change to your plugin root directory.

  2. 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 matching App.Version, such as 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=<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 go command is installed and on your PATH.
  • JFROG_CLI_PLUGINS_SERVER is 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's App.Version field, including any v prefix. When your plugin declares app.Version = "v1.2.0", pass v1.2.0, not 1.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_SERVER and JFROG_CLI_PLUGINS_REPO.
  • After publishing, verify the plugin works by installing it. For more information, see jf plugin install.

Frequently Asked Questions

This section provides answers to frequently asked questions.

plusFAQs
Q: What do I need before publishing a JFrog CLI plugin?

A: The Go programming language installed and on your PATH, a JFrog CLI server configuration for your target registry, and the JFROG_CLI_PLUGINS_SERVER environment variable set. See Publish a Plugin for the full example.

Q: What happens if I don't set JFROG_CLI_PLUGINS_SERVER?

A: The command fails immediately. There is no default publish target, so you must explicitly specify the destination server.

Q: What is the difference between the plugin version argument and my plugin's App.Version field?

A: They must match exactly, including any v prefix. If your plugin declares app.Version = "v1.2.0", pass v1.2.0 as the <PLUGIN_VERSION> argument, not 1.2.0.

Q: Can I publish to a private registry instead of the public one?

A: Yes. Set both JFROG_CLI_PLUGINS_SERVER and JFROG_CLI_PLUGINS_REPO to publish to your own JFrog Artifactory instance. See Publish to Custom Registry.

Q: How do I make my plugin available in the official JFrog CLI Plugins Registry?

A: Your plugin must conform to the JFrog CLI plugin structure and be accepted into the jfrog-cli-plugins-reg repository.

Related Topics


What’s Next

To verify the installation, see Install JFrog CLI Plugins.

Did this page help you?