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

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

None.

Environment Variables

VariableDefaultRequiredDescription
JFROG_CLI_PLUGINS_SERVERNoneYesConfigured Artifactory server ID 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:

    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 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 matching App.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:

  1. 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 go is installed and on your PATH.
  • JFROG_CLI_PLUGINS_SERVER is 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's App.Version field, including any v prefix. For example, if 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 (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_SERVER and JFROG_CLI_PLUGINS_REPO.
  • After publishing, verify the plugin works by installing it: jf plugin install <plugin-name>.

What’s Next

After publishing, install your plugin to verify it works.