• Stars
    star
    532
  • Rank 83,377 (Top 2 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 9 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

JFrog CLI is a client that provides a simple interface that automates access to the JFrog products.

JFrog CLI

JFrog CLI

Scanned by Frogbot Go Report Card license Go version

Tests status
V2 DEV
artifactory Artifactory
xray Xray
distribution Distribution
access Access
maven Maven
gradle Gradle
npm npm
docker Docker
podman Podman
nuget NuGet
python Python
go Go
📃 Scripts
📊 Code Analysis
🔌 Plugins
☁️ Transfer To Cloud

Table of Contents

Overview

JFrog CLI is a compact and smart client that provides a simple interface that automates access to Artifactory 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:

  • Multithreaded 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 either install JFrog CLI using one of the supported installers or download its executable directly. Visit the Install JFrog CLI Page for details.

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.14.x or above.

Download and Build the CLI

Navigate to a directory where you want to create the jfrog-cli 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/build.sh

On Windows run:

cd jfrog-cli
build\build.bat

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

Tests

Usage

go test -v github.com/jfrog/jfrog-cli [test-types] [flags]

The flags are:

Flag Description
-jfrog.url [Default: http://localhost:8081] JFrog platform URL.
-jfrog.user [Default: admin] JFrog platform username.
-jfrog.password [Default: password] JFrog platform password.
-jfrog.adminToken [Optional] JFrog platform admin token.
-ci.runId [Optional] A unique identifier used as a suffix to create repositories and builds in the tests.

The types are:

Type Description
-test.artifactory Artifactory tests
-test.access Access tests
-test.npm Npm tests
-test.maven Maven tests
-test.gradle Gradle tests
-test.docker Docker tests
-test.dockerScan Docker scan tests
-test.podman Podman tests
-test.go Go tests
-test.pip Pip tests
-test.pipenv Pipenv tests
-test.poetry Poetry tests
-test.nuget Nuget tests
-test.plugins Plugins tests
-test.distribution Distribution tests
-test.transfer Transfer tests
-test.xray Xray tests
  • Running the tests will create builds and repositories with timestamps, for example: cli-rt1-1592990748 and cli-rt2-1592990748.
    Once the tests are completed, the content of these repositories will be deleted.

Artifactory tests

In addition to general optional flags you can use the following optional artifactory flags.

Flag Description
-jfrog.sshKeyPath [Optional] Ssh key file path. Should be used only if the Artifactory URL format is ssh://[domain]:port.
-jfrog.sshPassphrase [Optional] Ssh key passphrase.
Examples

To run artifactory tests execute the following command.

go test -v github.com/jfrog/jfrog-cli -test.artifactory [flags]

Npm tests

Requirements
  • The npm executables should be included as part of the PATH environment variable.
  • The tests are compatible with npm 7 and higher.
Limitation
  • Currently, npm integration support only http(s) connections to Artifactory using username and password.
Examples

To run npm tests execute the following command.

go test -v github.com/jfrog/jfrog-cli -test.npm [flags]

Maven tests

Requirements
  • The java executable should be included as part of the PATH environment variable. Alternatively, set the JAVA_HOME environment variable.
Limitation
  • Currently, maven integration support only http(s) connections to Artifactory using username and password.
Examples

To run maven tests execute the following command.

go test -v github.com/jfrog/jfrog-cli -test.maven [flags]

Gradle tests

Requirements
  • The gradle 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.
Limitation
  • Currently, gradle integration support only http(s) connections to Artifactory using username and password.
Examples

To run gradle tests execute the following command.

go test -v github.com/jfrog/jfrog-cli -test.gradle [flags]

Docker tests

Requirements
  • Make sure the environment variable RTLIC is configured with a valid license.
  • You can start an Artifactory container by running the startArtifactory.sh script under the testdata/docker/artifactory directory. Before running the tests, wait for Artifactory to finish booting up in the container.
Flag Description
-test.containerRegistry Artifactory Docker registry domain.
Examples

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

go test -v github.com/jfrog/jfrog-cli -test.docker [flags]

Podman tests

Flag Description
-test.containerRegistry Artifactory container registry domain.
Examples

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

go test -v github.com/jfrog/jfrog-cli -test.podman [flags]

Go commands tests

Requirements
  • The tests are compatible with Artifactory 6.10 and higher.
  • To run go tests run the following command:
go test -v github.com/jfrog/jfrog-cli -test.go [flags]

NuGet tests

Requirements
  • Add NuGet executable to the system search path (PATH environment variable).
  • Run the following command:
go test -v github.com/jfrog/jfrog-cli -test.nuget [flags]

Pip tests

Requirements
  • Add Python and pip executables to the system search path (PATH environment variable).
  • Run the following command:
go test -v github.com/jfrog/jfrog-cli -test.pip [flags]

Plugins tests

To run Plugins tests execute the following command:

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

Distribution tests

To run Distribution tests execute the following command:

go test -v github.com/jfrog/jfrog-cli -test.distribution [flags]

Transfer tests

Requirement

The transfer tests execute transfer-files commands between a local Artifactory server and a remote SaaS instance. In addition to general optional flags you must use the following flags:

Flag Description
-jfrog.targetUrl JFrog target platform URL.
-jfrog.targetAdminToken JFrog target platform admin token.
-jfrog.jfrogHome The JFrog home directory of the local Artifactory installation.
-jfrog.installDataTransferPlugin Set to true if you'd like the test to install the data-transfer automatically in the source Artifactory server

To run transfer tests execute the following command:

go test -v github.com/jfrog/jfrog-cli -test.transfer [flags]

Xray tests

To run Xray tests execute the following command:

go test -v github.com/jfrog/jfrog-cli -test.xray -test.dockerScan [flags]

Code Contributions

We welcome code contributions through pull requests from the community.

Pull Requests Guidelines

  • 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.

Dependencies in other JFrog modules

This project heavily depends on:

  • github.com/jfrog/jfrog-client-go
  • github.com/jfrog/build-info-go
  • github.com/jfrog/jfrog-cli-core

Local Development

During local development, when you encounter code that needs to be changed from one of the above modules, it is recommended to replace the dependency to work with a local clone of the dependency.

For example, assuming you would like to change files from jfrog-cli-core. Clone jfrog-cli-core (preferably your fork) to your local development machine (assuming it will be cloned to /repos/jfrog-cli-core).

Change go.mod to include the following:

replace github.com/jfrog/jfrog-cli-core/v2 => /repos/jfrog-cli-core

Pull Requests

Once done with your coding, you should push the changes you made to the other modules first. Once pushed, you can change this project to resolve the dependencies from your GitHub fork / branch. This is done by pointing the dependency in go.mod to your repository and branch. For example:

replace github.com/jfrog/jfrog-cli-core/v2 => github.com/galusben/jfrog-cli-core/v2 dev

Then run go mod tidy

Notice that go will change the version in the go.mod file.

Using JFrog CLI

JFrog CLI can be used for a variety of functions with Artifactory, 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.

JFrog CLI Plugins

JFrog CLI plugins support enhancing the functionality of JFrog CLI to meet the specific user and organization needs. The source code of a plugin is maintained as an open source Go project on GitHub. All public plugins are registered in JFrog CLI's Plugins Registry, which is hosted in the jfrog-cli-plugins-reg GitHub repository. We encourage you, as developers, to create plugins and share them publicly with the rest of the community. Read more about this in the JFrog CLI Plugin Developer Guide.

Release Notes

The release notes are available here.

More Repositories

1

project-examples

Small projects in universal build ecosystems to configure CI and Artifactory
C#
974
star
2

artifactory-user-plugins

Sample Artifactory User Plugins
Groovy
356
star
3

artifactory-docker-examples

Examples for using Artifactory Docker distribution in various environments
Shell
330
star
4

artifactory-client-java

Artifactory REST Client Java API bindings
Java
318
star
5

frogbot

🐸 Scans your Git repository with JFrog Xray for security vulnerabilities. 🤖
Go
299
star
6

terraform-provider-artifactory

Terraform provider to manage JFrog Artifactory
Go
275
star
7

charts

JFrog official Helm Charts
Shell
255
star
8

setup-jfrog-cli

Set up JFrog CLI in your GitHub Actions workflow
TypeScript
245
star
9

jfrog-client-go

All go clients for JFrog products
Go
211
star
10

log4j-tools

Java
168
star
11

gocenter

The Github README for JFrog Go-center. Use this for reporting issues
164
star
12

jfrog-idea-plugin

JFrog IntelliJ IDEA plugin
Java
153
star
13

jfrog-vscode-extension

JFrog VS-Code Extension
TypeScript
151
star
14

terraform-provider-xray

Terraform provider to manage JFrog Xray
Go
149
star
15

terraform-provider-project

Terraform provider to manage JFrog Projects
Go
148
star
16

build-info

Artifactory's open integration layer for CI build servers
Java
146
star
17

artifactory-scripts

Scripts for Artifactory (Usually, for REST API), community driven.
Groovy
143
star
18

text4shell-tools

Python
104
star
19

jfrog-spring-tools

Python
80
star
20

JFrog-Cloud-Installers

Template to deploy Artifactory Enterprise cluster.
CSS
78
star
21

jfrog-docker-desktop-extension

🐸 Scans any of your local Docker images for security vulnerabilities. 🐋
TypeScript
74
star
22

nexus2artifactory

NexusToArtifactory - A tool designed to ease migration from Sonatype Nexus to JFrog Artifactory.
Python
67
star
23

nimbuspwn-tools

Shell
64
star
24

build-info-go

build-info-go is a Go library and a CLI, which allows generating build-info for a source code project.
Go
63
star
25

jfrog-npm-tools

Python
54
star
26

cocoapods-art

CocoaPods Plugin to work against Artifactory Repository
Ruby
53
star
27

jfrog-cli-plugins-reg

Go
52
star
28

kubenab

Kubernetes Admission Webhook to enforce pulling of Docker images from the private registry.
Go
46
star
29

froggit-go

Froggit-Go is a universal Go library, allowing to perform actions on VCS providers.
Go
45
star
30

jfrog-CVE-2023-25136-OpenSSH_Double-Free

Python
43
star
31

vault-plugin-secrets-artifactory

HashiCorp Vault Secrets Plugin for Artifactory
Go
42
star
32

teamcity-artifactory-plugin

TeamCity plugin that enables traceable build artifacts with Artifactory
Java
42
star
33

jfrog-azure-devops-extension

JavaScript
41
star
34

chartcenter

The Central Helm Repository for the Community
Dockerfile
41
star
35

bamboo-artifactory-plugin

Atlassian Bamboo plugin that enables traceable build artifacts with Artifactory
Java
40
star
36

jfrog-docker-repo-simple-example

Getting started with JFrog Docker Repos - Example
Dockerfile
39
star
37

jfrog-CVE-2022-21449

Python
38
star
38

cve-2024-3094-tools

Shell
37
star
39

artifactory-cli-go

Artifactory CLI written in Golang
Go
33
star
40

jfrog-cli-core

Go
32
star
41

gitlab-templates

Templates for CI/CD in GitLab using JFrog CLI
30
star
42

docker2artifactory

Python
29
star
43

mlflow-jfrog-plugin

Python
28
star
44

log-analytics-prometheus

JFrog Prometheus Log Analytics Integration
27
star
45

artifactory-docker-builder

Groovy
27
star
46

auto-mat

A docker container to generate heap dump reports and indexes for eclipse MAT
Java
26
star
47

kubexray

JFrog KubeXray scanner on Kubernetes
Go
25
star
48

artifactory-maven-plugin

A Maven plugin to resolve artifacts from Artifactory, deploy artifacts to Artifactory, capture and publish build info.
Java
23
star
49

jfrog-registry-operator

Enhancing AWS Security: JFrog's Seamless Integration and the Power of AssumeRole
Go
22
star
50

artifactory-gradle-plugin

JFrog Gradle plugin for Build Info extraction and Artifactory publishing.
Java
21
star
51

log-analytics

JFrog Log Analytics
Shell
19
star
52

polkit-tools

Shell
18
star
53

jfrog-cli-plugins

Go
17
star
54

gofrog

A collection of go utilities
Go
16
star
55

bower-art-resolver

JavaScript
15
star
56

jfrog-openssl-tools

Python
15
star
57

DevRel

Java
12
star
58

artifactory-sbt-plugin

The SBT Plugin for Artifactory resolve and pulish
Scala
12
star
59

artifactory-user-plugins-devenv

Development Environment for writting Artifactory User Plugins
Shell
12
star
60

aws-codestar

Artifactory-Code Star integration
Shell
12
star
61

gradle-dep-tree

Gradle plugin that reads the Gradle dependencies of a given Gradle project, and generates a dependency tree.
Java
12
star
62

SwampUp2022

Shell
12
star
63

jfrog-client-js

Xray Javascript Client
TypeScript
11
star
64

maven-anno-mojo

Write Maven plugins using annotations
Java
11
star
65

jfrog-ecosystem-integration-env

A Docker image containing all the tools JFrog CLI integrates with and supports.
Dockerfile
11
star
66

bamboo-jfrog-plugin

Easy integration between Bamboo and the JFrog Platform.
Java
10
star
67

xray-client-java

Xray Java Client
Java
9
star
68

artifactory-bosh-release

Bosh release of Artifactory for the PCF
HTML
9
star
69

msbuild-artifactory-plugin

Artifactory integration with MSBuild
C#
8
star
70

documentation

Go
8
star
71

log-analytics-splunk

JFrog Splunk Log Analytics Integration
JavaScript
8
star
72

docker-compose-demos

JFrog example demos using docker compose
Shell
8
star
73

jfrog-visual-studio-extension

C#
8
star
74

log-analytics-elastic

JFrog Elastic Fluentd Kibana Log Analytics Integration
8
star
75

jfrog-ui-essentials

JavaScript
8
star
76

jfrog-ide-webview

JFrog-IDE-Webview is a React-based HTML page designed to be seamlessly embedded within JFrog VS Code Extension and the JFrog IDEA Plugin.
TypeScript
8
star
77

go-mockhttp

Go
7
star
78

ide-plugins-common

Common code used by the JFrog Idea Plugin and the JFrog Eclipse plugin
Java
7
star
79

jfrog-pipelines-task

7
star
80

nuget-deps-tree

This npm package reads the NuGet dependencies of a .NET project, and generates a dependencies tree object.
TypeScript
7
star
81

log-analytics-datadog

JFrog Datadog Log Analytics Integration
Dockerfile
7
star
82

knife-art

Knife Artifactory integration
Ruby
7
star
83

jfrog-pipelines-go-task

Makefile
7
star
84

jfrog-mission-control-2.0

Jfrog Mission Control 2.0 example scripts
Groovy
7
star
85

jfrog-cli-plugin-template

Go
6
star
86

npm_domain_check

Python
6
star
87

go-license-discovery

A go library for matching text against known OSS licenses
Go
6
star
88

sample-soleng-python-project

Python
6
star
89

jfrog-distroless

Starlark
6
star
90

maven-dep-tree

Maven plugin that reads the Maven dependencies of a given Maven project, and generates a dependency tree.
Java
6
star
91

terraform-provider-pipeline

Terraform provider to manage Artifactory Pipelines
Go
6
star
92

docker-remote-util

A groovy util library to interact with docker remote api
Groovy
6
star
93

webapp-examples

Examples of Web Application that use Artifactory as a backend
CSS
6
star
94

jfrog-pipelines-jenkins-example

Go
5
star
95

jfrog-cli-security

Go module that encompasses the security commands of JFrog CLI
Go
5
star
96

fan4idea

Java
4
star
97

live-logs

Go
4
star
98

gocmd

Go
4
star
99

jfrog-pipelines-docker-sample

Shell
4
star
100

SwampUp2023

HCL
4
star