Skip to content
JFrog CLI is a client that provides a simple interface that automates access to the JFrog products.
Go Python JavaScript Shell Dockerfile Batchfile
Branch: master
Clone or download
Latest commit 0a2645e Sep 26, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
artifactory Fix number of arguments check in build clean #462 (#463) Sep 26, 2019
bintray Remove Exit On Error (#449) Sep 22, 2019
completion Support bash and zsh auto-completion (#409) Jul 8, 2019
docs Allow buildname, buildnumber, excludeEnv and buildUrl from env (#453) Sep 22, 2019
inttestutils Progress bar fixes & log API changes. Jun 10, 2019
missioncontrol Remove Exit On Error (#449) Sep 22, 2019
npm Update version to 1.29.1 Sep 26, 2019
python Update build / test instructions following the changes in version 1.2… Sep 2, 2019
testsdata Artifactory tests : Run UploadDebian test in separate repository (#447) Sep 23, 2019
utils Update version to 1.29.1 Sep 26, 2019
xray Remove Exit On Error (#449) Sep 22, 2019
.gitignore Update README.md + Appveyor.yml Sep 23, 2019
CONTRIBUTING.md Fix typos in project Jul 30, 2019
Dockerfile Fix Dockerfile Jun 11, 2019
Jenkinsfile ARM CLI Support (#427) Aug 4, 2019
LICENSE Added LICENSE file May 5, 2016
README.md Update README.md + Appveyor.yml Sep 23, 2019
appveyor.yml Update README.md + Appveyor.yml Sep 23, 2019
artifactory_test.go Artifactory tests : Run UploadDebian test in separate repository (#447) Sep 23, 2019
bintray_test.go Fix typos in project Jul 30, 2019
build.bat Update build / test instructions following the changes in version 1.2… Sep 2, 2019
build.sh Update build / test instructions following the changes in version 1.2… Sep 2, 2019
buildinfo_test.go Allow env buildname and buildnumber in bag and bad (#458) Sep 23, 2019
buildtools_test.go Update README.md + Appveyor.yml Sep 23, 2019
getCli.sh ARM CLI Support (#427) Aug 4, 2019
go.mod Upgrade jfrog-client-go to v0.5.2 Sep 24, 2019
go.sum Go 1 13 compatibility Sep 23, 2019
main.go Support bash and zsh auto-completion (#409) Jul 8, 2019
main_test.go Add tests for pip-install Sep 23, 2019
test.bat Update build / test instructions following the changes in version 1.2… Sep 2, 2019
test.sh Update build / test instructions following the changes in version 1.2… Sep 2, 2019
unit_test.go Support report usage information api (#381) May 20, 2019

README.md

Branch Status
master Build status
dev Build status

Overview

JFrog CLI is a compact and smart client that provides a simple interface that automates access to Artifactory, Bintray and Mission Control through their respective REST APIs. By using the JFrog CLI, you can greatly simplify your automation scripts making them more readable and easier to maintain. Several features of the JFrog CLI makes your scripts more efficient and reliable:

  • Multi-threaded upload and download of artifacts make builds run faster
  • Checksum optimization reduces redundant file transfers
  • Wildcards and regular expressions give you an easy way to collect all the artifacts you wish to upload or download.
  • "Dry run" gives you a preview of file transfer operations before you actually run them

Download and Installation

You can download the executable directly using the JFrog CLI Download Page, or install it with npm, homebrew or docker.

NPM

npm install jfrog-cli-go

Homebrew

brew install jfrog-cli-go

Docker

docker run docker.bintray.io/jfrog/jfrog-cli-go:latest jfrog <COMMAND>

Building the Executable

JFrog CLI is written in the Go programming language, so to build the CLI yourself, you first need to have Go installed and configured on your machine.

Install Go

To download and install Go, please refer to the Go documentation. Please download Go 1.12.7 or above.

Download and Build the CLI

Navigate to a directory where you want to create the jfrog-cli-go project, outside the $GOPATH tree.

If the GOPATH variable is unset, it's default value is the go folder under the user home.

Verify that the GO111MODULE variable is either unset, or explicitly set to auto.

Clone the jfrog-cli project by executing the following command:

git clone https://github.com/jfrog/jfrog-cli

Build the project by navigating to the jfrog folder and executing the following commands. On Unix based systems run:

cd jfrog-cli
./build.sh

On Windows run:

cd jfrog-cli
build.bat

Once completed, you will find the JFrog CLI executable at your current directory.

Tests

Artifactory tests

General tests

To run Artifactory tests execute the following command. On Unix based systems run:

./test.sh -v github.com/jfrog/jfrog-cli-go

On Windows run:

test.bat -v github.com/jfrog/jfrog-cli-go
Optional flags
Flag Description
-rt.url [Default: http://localhost:8081/artifactory] Artifactory URL.
-rt.user [Default: admin] Artifactory username.
-rt.password [Default: password] Artifactory password.
-rt.apikey [Optional] Artifactory API key.
-rt.sshKeyPath [Optional] Ssh key file path. Should be used only if the Artifactory URL format is ssh://[domain]:port
-rt.sshPassphrase [Optional] Ssh key passphrase.
-rt.accessToken [Optional] Artifactory access token.
  • Running the tests will create two repositories: jfrog-cli-tests-repo and jfrog-cli-tests-repo1.
    Once the tests are completed, the content of these repositories will be deleted.

Maven, Gradle and Npm tests

  • The M2_HOME environment variable should be set to the local maven installation path.
  • The gradle and npm executables should be included as part of the PATH environment variable.
  • The java executable should be included as part of the PATH environment variable. Alternatively, set the JAVA_HOME environment variable.

To run build tools tests execute the following command.

On Unix based systems run:

./test.sh -v github.com/jfrog/jfrog-cli-go -test.artifactory=false -test.buildTools=true

On Windows run:

test.bat -v github.com/jfrog/jfrog-cli-go -test.artifactory=false -test.buildTools=true
Limitation
  • Currently, build integration support only http(s) connections to Artifactory using username and password.

Docker tests

To run docker tests execute the following command (fill out the missing parameters as described below).

On Unix based systems run:

./test.sh -v github.com/jfrog/jfrog-cli-go -test.artifactory=false -test.docker=true -rt.dockerRepoDomain=DOCKER_DOMAIN -rt.dockerTargetRepo=DOCKER_TARGET_REPO -rt.url=ARTIFACTORY_URL -rt.user=USERNAME -rt.password=PASSWORD

On Windows run:

test.bat -v github.com/jfrog/jfrog-cli-go -test.artifactory=false -test.docker=true -rt.dockerRepoDomain=DOCKER_DOMAIN -rt.dockerTargetRepo=DOCKER_TARGET_REPO -rt.url=ARTIFACTORY_URL -rt.user=USERNAME -rt.password=PASSWORD
Mandatory flags
Flag Description
-rt.dockerRepoDomain Artifactory Docker registry domain.
-rt.dockerTargetRepo Artifactory Docker repository name.
-rt.url Artifactory URL.
-rt.user Artifactory username.
-rt.password Artifactory password.

Go commands tests

To run go tests run the following command.

On Unix based systems run:

./test.sh -v github.com/jfrog/jfrog-cli-go -test.artifactory=false -test.go=true 

On Windows run:

test.bat -v github.com/jfrog/jfrog-cli-go -test.artifactory=false -test.go=true 

NuGet tests

To run NuGet tests:

  • Add NuGet executable to the system search path (PATH environment variable).
  • Create a remote repository named jfrog-cli-tests-nuget-remote-repo
  • Run the following command.

On Unix based systems run:

./test.sh -v github.com/jfrog/jfrog-cli-go -test.artifactory=false -test.nuget=true 

On Windows run:

test.bat -v github.com/jfrog/jfrog-cli-go -test.artifactory=false -test.nuget=true 

Pip tests

To run pip tests:

  • Add Python and pip executables to the system search path (PATH environment variable).
  • Pip tests must run inside a clean pip-environment. You can either activate a virtual-environment and execute the tests from within, or provide the path to your virtual-environment using the -rt.pipVirtualEnv flag.
  • Run the following command:

On Unix based systems run:

./test.sh -v github.com/jfrog/jfrog-cli-go -test.artifactory=false -test.pip=true

On Windows run:

test.bat -v github.com/jfrog/jfrog-cli-go -test.artifactory=false -test.pip=true
Optional flags
Flag Description
-rt.pipVirtualEnv [Optional] Path to the directory of a clean pip virtual-environment. Make sure to provide the binaries directory (in unix: /bin, in windows: \Scripts)

Bintray tests

Bintray tests credentials are taken from the CLI configuration. If non configured or not passed as flags, the tests will fail.

To run Bintray tests execute the following command:

go test -v github.com/jfrog/jfrog-cli-go -test.artifactory=false -test.bintray=true

Flags:

Flag Description
-bt.user [Mandatory if not configured] Bintray username.
-bt.key [Mandatory if not configured] Bintray API key.
-bt.org [Optional] Bintray organization. If not configured, -bt.user is used as the organization name.
  • Running the tests will create a repository jfrog-cli-tests-repo1 in bintray.
    Once the tests are completed, the repository will be deleted.

Pull Requests

We welcome pull requests from the community.

Guidelines

  • Before creating your first pull request, please join our contributors community by signing JFrog's CLA.
  • If the existing tests do not already cover your changes, please add tests..
  • Pull requests should be created on the dev branch.
  • Please use gofmt for formatting the code before submitting the pull request.

Using JFrog CLI

JFrog CLI can be used for a variety of functions with Artifactory, Bintray, Xray and Mission Control, and has a dedicated set of commands for each product. To learn how to use JFrog CLI, please visit the JFrog CLI User Guide.

Using JFrog CLI Docker Image

The docker image of JFrog CLI can be pulled from Bintray by running the following command:

docker pull docker.bintray.io/jfrog/jfrog-cli-go:latest

Run a JFrog CLI command using docker as follows:

docker run docker.bintray.io/jfrog/jfrog-cli-go:latest jfrog <COMMAND>

Release Notes

The release are available on Bintray.

You can’t perform that action at this time.