CLI for JFrog Artifactory

Overview

This page describes how to use JFrog CLI with JFrog Artifactory.
Read more about JFrog CLI here.

Environment Variables

The Artifactory upload command makes use of the following environment variable:
Variable Name
Description
JFROG_CLI_MIN_CHECKSUM_DEPLOY_SIZE_KB
[Default: 10] Minimum file size in KB for which JFrog CLI performs checksum deploy optimization.
JFROG_CLI_RELEASES_REPO
Configured Artifactory repository name from which to download the jar needed by the mvn/gradle command. This environment variable's value format should be <server ID configured by the 'jf c add' command>/<repo name>. The repository should proxy https://releases.jfrog.io. This environment variable is used by the 'jf mvn' and 'jf gradle' commands, and also by the 'jf audit' command, when used for maven or gradle projects.
JFROG_CLI_DEPENDENCIES_DIR
[Default: $JFROG_CLI_HOME_DIR/dependencies] Defines the directory to which JFrog CLI's internal dependencies are downloaded.
JFROG_CLI_REPORT_USAGE
[Default: true] Set to false to block JFrog CLI from sending usage statistics to Artifactory.
JFROG_CLI_SERVER_ID
Server ID configured using the config command, unless sent as a command argument or option.
JFROG_CLI_BUILD_NAME
Build name to be used by commands which expect a build name, unless sent as a command argument or option.
JFROG_CLI_BUILD_NUMBER
Build number to be used by commands which expect a build number, unless sent as a command argument or option.
JFROG_CLI_BUILD_PROJECT
JFrog project key to be used by commands which expect build name and build number. Determines the project of the published build.
JFROG_CLI_BUILD_URL
Sets the CI server build URL in the build-info. The "jf rt build-publish" command uses the value of this environment variable, unless the --build-url command option is sent.
JFROG_CLI_ENV_EXCLUDE
[Default: password;secret;key;token] List of case insensitive patterns in the form of "value1;value2;...". Environment variables match those patterns will be excluded. This environment variable is used by the "jf rt build-publish" command, in case the --env-exclude command option is not sent.
JFROG_CLI_TRANSITIVE_DOWNLOAD_EXPERIMENTAL
[Default: false] Used by the "jf rt download" command. Set to true to download artifacts also from remote repositories. This feature is experimental and available on Artifactory version 7.17.0 or higher.`

Note
Read about additional environment variables at the Welcome to JFrog CLI page.

Authentication

When used with Artifactory, JFrog CLI offers several means of authentication: JFrog CLI does not support accessing Artifactory without authentication.

Authenticating with Username and Password / API Key

To authenticate yourself using your JFrog login credentials, either configure your credentials once using the jf c add command or provide the following option to each command.
Command option
Description
--url
JFrog Artifactory API endpoint URL. It usually ends with /artifactory
--user
JFrog username
--password
JFrog password or API key
For enhanced security, when JFrog CLI is configured to use a username and password / API key, it automatically generates an access token to authenticate with Artifactory. The generated access token is valid for one hour only. JFrog CLI automatically refreshed the token before it expires. The jfrog c add command allows disabling this functionality. This feature is currently not supported by commands which use external tools or package managers or work with JFrog Distribution.

Authenticating with an Access Token

To authenticate yourself using an Artifactory Access Token, either configure your Access Token once using the jf c add command or provide the following option to each command.
Command option
Description
--url
JFrog Artifactory API endpoint URL. It usually ends with /artifactory
--access-token
JFrog access token

Authenticating with RSA Keys


Note
Currently, authentication with RSA keys is not supported when working with external package managers and build tools (Maven, Gradle, Npm, Docker, Go and NuGet) or with the cUrl integration.

From version 4.4, Artifactory supports SSH authentication using RSA public and private keys. To authenticate yourself to Artifactory using RSA keys, execute the following instructions:
  • Enable SSH authentication as described in Configuring SSH.
  • Configure your Artifactory URL to have the following format: ssh://[host]:[port] There are two ways to do this:
    • For each command, use the --url command option.
    • Specify the Artifactory URL in the correct format using the jfrog c add command.

    Warning Don't include your Artifactory context URL
    Make sure that the [host] component of the URL only includes the hostname or the IP, but not your Artifactory context URL.

  • Configure the path to your SSH key file. There are two ways to do this:
    • For each command, use the --ssh-key-path command option.
    • Specify the path using the jfrog c add command.

Authenticating using Client Certificates (mTLS)

From Artifactory release 7.38.4, you can authenticate users using a client certificate (mTLS). To do so will require a reverse proxy and some setup on the front reverse proxy (Nginx). Read about how to set this up here.
To authenticate with the proxy using a client certificate, either configure your certificate once using the jf c add command or use the --client-cert-path and--client-cert-ket-path command options with each command.

Note
Authentication using client certificates (mTLS) is not supported by commands which integrate with package managers.

Not Using a Public CA (Certificate Authority)?
This section is relevant for you if you're not using a public CA (Certificate Authority) to issue the SSL certificate used to connect to your Artifactory domain. You may not be using a public CA either because you're using self-signed certificates or you're running your own PKI services in-house (often by using a Microsoft CA).
In this case, you'll need to make those certificates available for JFrog CLI, by placing them inside the security/certs directory, which is under JFrog CLI's home directory. By default, the home directory is ~/.jfrog, but it can be also set using the JFROG_CLI_HOME_DIR environment variable.
Note
  1. 1.
    The supported certificate format is PEM.
  2. 2.
    Some commands support the --insecure-tls option, which skips the TLS certificates verification.
  3. 3.
    Before version 1.37.0, JFrog CLI expected the certificates to be located directly under the security directory. JFrog CLI will automatically move the certificates to the new directory when installing version 1.37.0 or above. Downgrading back to an older version requires replacing the configuration directory manually. You'll find a backup if the old configuration under .jfrog/backup
JFrog CLI lets you upload and download artifacts from your local file system to Artifactory, this also includes uploading symlinks (soft links).
Symlinks are stored in Artifactory as files with a zero size, with the following properties: symlink.dest - The actual path on the original filesystem to which the symlink points symlink.destsha1 - the SHA1 checksum of the value in the symlink.dest property
To upload symlinks, the jf rt upload command should be executed with the --symlinks option set to true.
When downloading symlinks stored in Artifactory, the CLI can verify that the file to which the symlink points actually exists and that it has the correct SHA1 checksum. To add this validation, you should use the --validate-symlinks option with the jf rt download command.

Using Placeholders

The JFrog CLI offers enormous flexibility in how you download, upload, copy, or move files through the use of wildcard or regular expressions with placeholders.
Any wildcard enclosed in parentheses in the source path can be matched with a corresponding placeholder in the target path to determine the name of the artifact once uploaded.

Example 1: Upload all files to the target repository

For each .tgz file in the source directory, create a corresponding directory with the same name in the target repository and upload it there. For example, a file named froggy.tgz should be uploaded to my-local-rep/froggy. froggy will be created in a folder in Artifactory).
jf rt u "(*).tgz" my-local-repo/{1}/ --recursive=false

Example 2: Upload all files sharing the same prefix to the target repository

Upload all files whose name begins with "frog" to folder frogfiles in the target repository, but append its name with the text "-up". For example, a file called froggy.tgz should be renamed froggy.tgz-up.
jf u "(frog*)" my-local-repo/frogfiles/{1}-up --recursive=false

Example 3: Upload all files to corresponding directories according to extension type

Upload all files in the current directory to the my-local-repo repository and place them in directories that match their file extensions.
jf rt u "(*).(*)" my-local-repo/{2}/{1}.{2} --recursive=false

Example 4: Copy all zip files to target repository and append with an extension

Copy all zip files under /rabbit in the source-frog-repo repository into the same path in the target-frog-repo repository and append the copied files' names with ".cp".
jf rt cp "source-frog-repo/rabbit/(*.zip)" target-frog-repo/rabbit/{1}.cp

General Commands

The following sections describe the commands available in the JFrog CLI for use with Artifactory.

Verifying Artifactory is Accessible

This command can be used to verify that Artifactory is accessible by sending an applicative ping to Artifactory.

Commands Params

Command name
rt ping
Abbreviation
rt p
Command options
--url
[Optional] Artifactory URL.
--server-id
[Optional] Server ID configured using the jf c add command. If not specified, the default configured Artifactory server is used.
--insecure-tls
[Default: false] Set to true to skip TLS certificates verification.
Command arguments
The command accepts no arguments.

Example 1

Ping the configured default Artifactory server.
jf rt ping

Example 2

Ping the configured Artifactory server with ID rt-server-1.
jf rt ping --server-id=rt-server-1

Example 3

Ping the Artifactory server. accessible through the specified URL.
jf rt ping --url=https://my-rt-server.com/artifactory

Uploading Files

This command is used to upload files to Artifactory.

Commands Params

Command name
rt upload
Abbreviation
rt u
Command options
Warning When using the * or ; characters in the upload command options or arguments, make sure to wrap the whole options or arguments string in quotes (") to make sure the * or ; characters are not interpreted as literals.
--archive
[Optional] Set to "zip" to pack and deploy the files to Artifactory inside a ZIP archive. Currently, the only packaging format supported is zip.
--server-id
[Optional] Server ID configured using the jf c add command. If not specified, the default configured Artifactory server is used.
--spec
[Optional] Path to a file spec. For more details, please refer to Using File Specs.
--spec-vars
[Optional] List of variables in the form of "key1=value1;key2=value2;..." to be replaced in the File Spec. In the File Spec, the variables should be used as follows: ${key1}.
--build-name
[Optional] Build name. For more details, please refer to Build Integration.
--build-number
[Optional] Build number. For more details, please refer to Build Integration.
--project
[Optional] JFrog project key.
--module
[Optional] Optional module name for the build-info.
--target-props
[Optional] A list of Artifactory properties specified as "key=value" pairs separated by a semi-colon ( ; ) to be attached to the uploaded files. If any key can take several values, then each value is separated by a comma ( , ). For example, "key1=value1;key2=value21,value22;key3=value3".
--deb
[Optional] Used for Debian packages only. Specifies the distribution/component/architecture of the package. If the the value for distribution, component or architecture include a slash. the slash should be escaped with a back-slash.
--flat
[Default: false] If true, files are uploaded to the exact target path specified and their hierarchy in the source file system is ignored. If false, files are uploaded to the target path while maintaining their file system hierarchy. If Using Placeholders are used, the value of this option is ignored. Note JFrog CLI v1 In JFrog CLI v1, the default value of the --flat option is true.
--recursive
[Default: true] If true, files are also collected from sub-folders of the source directory for upload . If false, only files specifically in the source directory are uploaded.
--regexp
[Default: false] If true, the command will interpret the first argument, which describes the local file-system path of artifacts to upload, as a regular expression. If false, it will interpret the first argument as a wild-card expression. The above also applies for the --exclusions option. If you have specified that you are using regular expressions, then the beginning of the expression must be enclosed in parenthesis. For example: a/b/c/(.*)/file.zip
--ant
[Default: false] If true, the command will interpret the first argument, which describes the local file-system path of artifacts to upload, as an ANT pattern. If false, it will interpret the first argument as a wildcards expression. The above also applies for the --exclusions option.
--threads
[Default: 3] The number of parallel threads that should be used to upload where each thread uploads a single artifact at a time.
--dry-run
[Default: false] If true, the command only indicates which artifacts would have been uploaded If false, the command is fully executed and uploads artifacts as specified
--symlinks
[Default: false] If true, the command will preserve the soft links structure in Artifactory. The symlink file representation will contain the symbolic link and checksum properties.
--explode
[Default: false] If true, the command will extract an archive containing multiple artifacts after it is deployed to Artifactory, while maintaining the archive's file structure.
--include-dirs
[Default: false] If true, the source path applies to bottom-chain directories and not only to files. Bottom-chain directories are either empty or do not include other directories that match the source path.
--exclusions
[Optional] A list of Semicolon-separated exclude patterns. Allows using wildcards, regular expressions or ANT patterns, according to the value of the --regexp and --ant options. Please read the --regexp and --ant options description for more information.
--sync-deletes
[Optional] Specific path in Artifactory, under which to sync artifacts after the upload. After the upload, this path will include only the artifacts uploaded during this upload operation. The other files under this path will be deleted.
--quiet
[Default: false] If true, the delete confirmation message is skipped.
--fail-no-op
[Default: false] Set to true if you'd like the command to return exit code 2 in case of no files are affected.
--retries
[Default: 3] Number of upload retries.
--retry-wait-time
[Default: 0s] Number of seconds or milliseconds to wait between retries. The numeric value should either end with s for seconds or ms for milliseconds.
--detailed-summary
[Default: false] Set to true to include a list of the affected files as part of the command output summary.
--insecure-tls
[Default: false] Set to true to skip TLS certificates verification.
Command arguments
The command takes two arguments. In case the --spec option is used, the commands accept no arguments.
Source path
The first argument specifies the local file system path to artifacts that should be uploaded to Artifactory. You can specify multiple artifacts by using wildcards or a regular expression as designated by the --regexp command option. Please read the --regexp option description for more information.
Target path
The second argument specifies the target path in Artifactory in the following format: [repository name]/[repository path] If the target path ends with a slash, the path is assumed to be a folder. For example, if you specify the target as "repo-name/a/b/", then "b" is assumed to be a folder in Artifactory into which files should be uploaded. If there is no terminal slash, the target path is assumed to be a file to which the uploaded file should be renamed. For example, if you specify the target as "repo-name/a/b", the uploaded file is renamed to "b" in Artifactory. For flexibility in specifying the upload path, you can include placeholders in the form of {1}, {2} which are replaced by corresponding tokens in the source path that are enclosed in parenthesis. For more details, please refer to Using Placeholders.

Example 1

Upload a file called froggy.tgz to the root of the my-local-repo repository.
jf rt u froggy.tgz my-local-repo

Example 2

Collect all the zip files located under the build directory (including subdirectories), and upload them to the my-local-repo repository, under the zipFiles folder, while maintaining the original names of the files.
jf rt u "build/*.zip" my-local-repo/zipFiles/

Example 3

Collect all the zip files located under the build directory (including subdirectories), and upload them to the my-local-repo repository, under the zipFiles folder, while maintaining the original names of the files. Also delete all files in the my-local-repo repository, under the zipFiles folder, except for the files which were uploaded by this command.
jf rt u "build/*.zip" my-local-repo/zipFiles/ --sync-deletes="my-local-repo/zipFiles/"

Example 4

Collect all files located under the build directory (including subdirectories), and upload them to the **my-release-local **repository, under the files folder, while maintaining the original names of the artifacts. Exclude (do not upload) files, which include install as part of their path, and have the pack extension. This example uses a wildcard pattern. See Example 5, which uses regular expressions instead.
jf rt u "build/" my-release-local/files/ --exclusions="\*install\*pack*"

Example 5

Collect all files located under the build directory (including subdirectories), and upload them to the my-release-local repository, under the files folder, while maintaining the original names of the artifacts. Exclude (do not upload) files, which include install as part of their path, and have the pack extension. This example uses a regular expression. See Example 4, which uses a wildcard pattern instead.
jf rt u "build/" my-release-local/files/ --regexp --exclusions="(.*)install.*pack$"

Example 6

Collect all files located under the build directory and match the /*.zip ANT pattern, and upload them to the my-release-local repository, under the files folder, while maintaining the original names of the artifacts.
jf rt u "build/**/*.zip" my-release-local/files/ --ant

Example 7

Package all files located under the build directory (including subdirectories) into a zip archive named archive.zip , and upload the archive to the my-local-repo repository,
jf rt u "build/" my-local-repo/my-archive.zip --archive zip

Downloading Files

This command is used to download files from Artifactory.
Download from Remote Repositories: By default, the command only downloads files that are cached on the current Artifactory instance. It does not download files located on remote Artifactory instances, through remote or virtual repositories. To allow the command to download files from remote Artifactory instances, which are proxied by the use of remote repositories, set the JFROG_CLI_TRANSITIVE_DOWNLOAD_EXPERIMENTAL environment variable to true. This functionality requires version 7.17 or above of Artifactory. The remote download functionality is supported only on remote repositories which proxy repositories on remote Artifactory instances. Downloading through a remote repository that proxies non-Artifactory repositories is not supported.

Commands Params

Command name
rt download
Abbreviation
rt dl
Command options
Warning When using the * or ; characters in the download command options or arguments, make sure to wrap the whole options or arguments string in quotes (") to make sure the * or ; characters are not interpreted as literals.
--server-id
[Optional] Server ID configured using the config command. If not specified, the default configured Artifactory server is used.
--build-name
[Optional] Build name. For more details, please refer to Build Integration.
--build-number
[Optional] Build number. For more details, please refer to Build Integration.
--project
[Optional] JFrog project key.
--module
[Optional] Optional module name for the build-info.
--spec
[Optional] Path to a file spec. For more details, please refer to Using File Specs.
--spec-vars
[Optional] List of variables in the form of "key1=value1;key2=value2;..." to be replaced in the File Spec. In the File Spec, the variables should be used as follows: ${key1}.
--props
[Optional] A list of Artifactory properties specified as "key=value" pairs separated by a semi-colon (for example, "key1=value1;key2=value2;key3=value3"). Only artifacts with all of the specified properties names and values will be downloaded.
--exclude-props
[Optional] A list of Artifactory properties specified as "key=value" pairs separated by a semi-colon (for example, "key1=value1;key2=value2;key3=value3"). Only artifacts without all of the specified properties names and values will be downloaded.
--build
[Optional] If specified, only artifacts of the specified build are matched. The property format is build-name/build-number. If you do not specify the build number, the artifacts are filtered by the latest build number.
--bundle
[Optional] If specified, only artifacts of the specified bundle are matched. The value format is bundle-name/bundle-version.
--flat
[Default: false] If true, artifacts are downloaded to the exact target path specified and their hierarchy in the source repository is ignored. If false, artifacts are downloaded to the target path in the file system while maintaining their hierarchy in the source repository. If Using Placeholders are used, and you would like the local file system (download path) to be determined by placeholders only, or in other words, avoid concatenating the Artifactory folder hierarchy local, set to false.
--recursive
[Default: true] If true, artifacts are also downloaded from sub-paths under the specified path in the source repository. If false, only artifacts in the specified source path directory are downloaded.
--threads
[Default: 3] The number of parallel threads that should be used to download where each thread downloads a single artifact at a time.
--split-count
[Default: 3] The number of segments into which each file should be split for download (provided the artifact is over --min-split in size). To download each file in a single thread, set to 0.
--retries
[Default: 3] Number of download retries.
--retry-wait-time
[Default: 0s] Number of seconds or milliseconds to wait between retries. The numeric value should either end with s for seconds or ms for milliseconds.
--min-split
[Default: 5120] The minimum size permitted for splitting. Files larger than the specified number will be split into equally sized --split-count segments. Any files smaller than the specified number will be downloaded in a single thread. If set to -1, files are not split.
--dry-run
[Default: false] If true, the command only indicates which artifacts would have been downloaded. If false, the command is fully executed and downloads artifacts as specified.
--explode
[Default: false] Set to true to extract an archive after it is downloaded from Artifactory. Supported compression formats: br, bz2, gz, lz4, sz, xz, zstd. Supported archive formats: zip, tar (including any compressed variants like tar.gz), rar.
--bypass-archive-inspection
[Default: false] Set to true to bypass the archive security inspection before it is unarchived. Used with the 'explode' option.
--validate-symlinks
[Default: false] If true, the command will validate that symlinks are pointing to existing and unchanged files, by comparing their sha1. Applicable to files and not directories.
--include-dirs
[Default: false] If true, the source path applies to bottom-chain directories and not only to files. Bottom-chain directories are either empty or do not include other directories that match the source path.
--exclusions
A list of Semicolon-separated exclude patterns. Allows using wildcards.
--sync-deletes
[Optional] Specific path in the local file system, under which to sync dependencies after the download. After the download, this path will include only the dependencies downloaded during this download operation. The other files under this path will be deleted.
--quiet
[Default: false] If true, the delete confirmation message is skipped.
--sort-by
[Optional] A list of semicolon-separated fields to sort by. The fields must be part of the 'items' AQL domain. For more information read the AQL documentation
--sort-order
[Default: asc] The order by which fields in the 'sort-by' option should be sorted. Accepts 'asc' or 'desc'.
--limit
[Optional] The maximum number of items to fetch. Usually used with the 'sort-by' option.
--offset
[Optional] The offset from which to fetch items (i.e. how many items should be skipped). Usually used with the 'sort-by' option.
--fail-no-op
[Default: false] Set to true if you'd like the command to return exit code 2 in case of no files are affected.
--archive-entries
[Optional] If specified, only archive artifacts containing entries matching this pattern are matched. You can use wildcards to specify multiple artifacts.
--detailed-summary
[Default: false] Set to true to include a list of the affected files as part of the command output summary.
--insecure-tls
[Default: false] Set to true to skip TLS certificates verification.
--gpg-key
[Optional] Path to the public GPG key file located on the file system, used to validate downloaded release bundle files.
Command arguments
Source path
Specifies the source path in Artifactory, from which the artifacts should be downloaded. You can use wildcards to specify multiple artifacts.
Target path
The second argument is optional and specifies the local file system target path. If the target path ends with a slash, the path is assumed to be a directory. For example, if you specify the target as "repo-name/a/b/", then "b" is assumed to be a directory into which files should be downloaded. If there is no terminal slash, the target path is assumed to be a file to which the downloaded file should be renamed. For example, if you specify the target as "a/b", the downloaded file is renamed to "b". For flexibility in specifying the target path, you can include placeholders in the form of {1}, {2} which are replaced by corresponding tokens in the source path that are enclosed in parenthesis. For more details, please refer to Using Placeholders.

Example 1

Download an artifact called cool-froggy.zip located at the root of the my-local-repo repository to the current directory.
jf rt dl my-local-repo/cool-froggy.zip

Example 2

Download all artifacts located under the all-my-frogs directory in the my-local-repo repository to the all-my-frogs folder under the current directory.
jf rt dl my-local-repo/all-my-frogs/ all-my-frogs/

Example 3

Download all artifacts located in the **my-local-repo **repository with a jar extension to the all-my-frogs folder under the current directory.
jf rt dl "my-local-repo/*.jar" all-my-frogs/

Example 4

Download the latest file uploaded to the all-my-frogs folder in the my-local-repo repository.
jf rt dl "my-local-repo/all-my-frogs/" --sort-by=created --sort-order=desc --limit=1

Copying Files

This command is used to copy files in Artifactory

Commands Params

Command name
rt copy
Abbreviation
rt cp
Command options
Warning When using the * or ; characters in the copy command options or arguments, make sure to wrap the whole options or arguments string in quotes (") to make sure the * or ; characters are not interpreted as literals.
--server-id
[Optional] Server ID configured using the config command. If not specified, the default configured Artifactory server is used.
--spec
[Optional] Path to a file spec. For more details, please refer to Using File Specs.
--props
[Optional] A list of Artifactory properties specified as "key=value" pairs separated by a semi-colon. (For example, "key1=value1;key2=value2;key3=value3"). Only artifacts with these properties names and values will be copied.
--exclude-props
[Optional] A list of Artifactory properties specified as "key=value" pairs separated by a semi-colon (for example, "key1=value1;key2=value2;key3=value3"). Only artifacts without all of the specified properties names and values will be copied.
--build
[Optional] If specified, only artifacts of the specified build are matched. The property format is build-name/build-number. If you do not specify the build number, the artifacts are filtered by the latest build number.
--bundle
[Optional] If specified, only artifacts of the specified bundle are matched. The value format is bundle-name/bundle-version.
--flat
[Default: false] If true, artifacts are copied to the exact target path specified and their hierarchy in the source path is ignored. If false, artifacts are copied to the target path while maintaining their source path hierarchy.
--recursive
[Default: true] If true, artifacts are also copied from sub-paths under the specified source path. If false, only artifacts in the specified source path directory are copied.
--dry-run
[Default: false] If true, the command only indicates which artifacts would have been copied. If false, the command is fully executed and copies artifacts as specified.
--exclusions
A list of Semicolon-separated exclude patterns. Allows using wildcards.
--threads
[Default: 3] Number of threads used for copying the items.
--sort-by
[Optional] A list of semicolon-separated fields to sort by. The fields must be part of the 'items' AQL domain. For more information read the AQL documentation
--sort-order
[Default: asc] The order by which fields in the 'sort-by' option should be sorted. Accepts 'asc' or 'desc'.
--limit
[Optional] The maximum number of items to fetch. Usually used with the 'sort-by' option.
--offset
[Optional] The offset from which to fetch items (i.e. how many items should be skipped). Usually used with the 'sort-by' option.
--fail-no-op
[Default: false] Set to true if you'd like the command to return exit code 2 in case of no files are affected.
--archive-entries
[Optional] If specified, only archive artifacts containing entries matching this pattern are matched. You can use wildcards to specify multiple artifacts.
--insecure-tls
[Default: false] Set to true to skip TLS certificates verification.
--retries
[Default: 3] Number for HTTP retry attempts.
--retry-wait-time
[Default: 0s] Number of seconds or milliseconds to wait between retries. The numeric value should either end with s for seconds or ms for milliseconds.
Command arguments
The command takes two arguments
Source path
Specifies the source path in Artifactory, from which the artifacts should be copied, in the following format: [repository name]/[repository path]. You can use wildcards to specify multiple artifacts.
Target path
Specifies the target path in Artifactory, to which the artifacts should be copied, in the following format: [repository name]/[repository path] If the pattern ends with a slash, the target path is assumed to be a folder. For example, if you specify the target as "repo-name/a/b/", then "b" is assumed to be a folder in Artifactory into which files should be copied. If there is no terminal slash, the target path is assumed to be a file to which the copied file should be renamed. For example, if you specify the target as "repo-name/a/b", the copied file is renamed to "b" in Artifactory. For flexibility in specifying the target path, you can include placeholders in the form of {1}, {2} which are replaced by corresponding tokens in the source path that are enclosed in parenthesis. For more details, please refer to Using Placeholders.

Example 1

Copy all artifacts located under /rabbit in the source-frog-repo repository into the same path in the target-frog-repo repository.
jf rt cp source-frog-repo/rabbit/ target-frog-repo/rabbit/

Example 2

Copy all zip files located under /rabbit in the source-frog-repo repository into the same path in the target-frog-repo repository.
jf rt cp "source-frog-repo/rabbit/*.zip" target-frog-repo/rabbit/

Example 3

Copy all artifacts located under /rabbit in the source-frog-repo repository and with property "Version=1.0" into the same path in the target-frog-repo repository.
jf rt cp "source-frog-repo/rabbit/*" target-frog-repo/rabbit/ --props=Version=1.0

Moving Files

This command is used to move files in Artifactory

Commands Params

Command name
rt move
Abbreviation
rt mv
Command options
Warning When using the * or ; characters in the copy command options or arguments, make sure to wrap the whole options or arguments string in quotes (") to make sure the * or ; characters are not interpreted as literals.
--server-id
[Optional] Server ID configured using the config command. If not specified, the default configured Artifactory server is used.
--spec
[Optional] Path to a file spec. For more details, please refer to Using File Specs.
--props
[Optional] A list of Artifactory properties specified as "key=value" pairs separated by a semi-colon (for example, "key1=value1;key2=value2;key3=value3"). Only artifacts with these properties names and values will be moved.
--exclude-props
[Optional] A list of Artifactory properties specified as "key=value" pairs separated by a semi-colon (for example, "key1=value1;key2=value2;key3=value3"). Only artifacts without all of the specified properties names and values will be moved.
--build
[Optional] If specified, only artifacts of the specified build are matched. The property format is build-name/build-number. If you do not specify the build number, the artifacts are filtered by the latest build number.
--bundle
[Optional] If specified, only artifacts of the specified bundle are matched. The value format is bundle-name/bundle-version.
--flat
[Default: false] If true, artifacts are moved to the exact target path specified and their hierarchy in the source path is ignored. If false, artifacts are moved to the target path while maintaining their source path hierarchy.
--recursive
[Default: true] If true, artifacts are also moved from sub-paths under the specified source path. If false, only artifacts in the specified source path directory are moved.
--dry-run
[Default: false] If true, the command only indicates which artifacts would have been moved. If false, the command is fully executed and downloads artifacts as specified.
--exclusions
A list of Semicolon-separated exclude patterns. Allows using wildcards.
--threads
[Default: 3] Number of threads used for moving the items.
--sort-by
[Optional] A list of semicolon-separated fields to sort by. The fields must be part of the 'items' AQL domain. For more information read the AQL documentation
--sort-order
[Default: asc] The order by which fields in the 'sort-by' option should be sorted. Accepts 'asc' or 'desc'.
--limit
[Optional] The maximum number of items to fetch. Usually used with the 'sort-by' option.
--offset
[Optional] The offset from which to fetch items (i.e. how many items should be skipped). Usually used with the 'sort-by' option.
--fail-no-op
[Default: false] Set to true if you'd like the command to return exit code 2 in case of no files are affected.
--archive-entries
[Optional] If specified, only archive artifacts containing entries matching this pattern are matched. You can use wildcards to specify multiple artifacts.
--insecure-tls
[Default: false] Set to true to skip TLS certificates verification.
--retries
[Default: 3] Number of HTTP retry attempts.
--retry-wait-time
[Default: 0s] Number of seconds or milliseconds to wait between retries. The numeric value should either end with s for seconds or ms for milliseconds.
Command arguments
The command takes two arguments
Source path
Specifies the source path in Artifactory, from which the artifacts should be moved, in the following format: [repository name]/[repository path]. You can use wildcards to specify multiple artifacts.
Target path
Specifies the target path in Artifactory, to which the artifacts should be moved, in the following format: [repository name]/[repository path] If the pattern ends with a slash, the target path is assumed to be a folder. For example, if you specify the target as "repo-name/a/b/", then "b" is assumed to be a folder in Artifactory into which files should be moved. If there is no terminal slash, the target path is assumed to be a file to which the moved file should be renamed. For example, if you specify the target as "repo-name/a/b", the moved file is renamed to "b" in Artifactory. For flexibility in specifying the upload path, you can include placeholders in the form of {1}, {2} which are replaced by corresponding tokens in the source path that are enclosed in parenthesis. For more details, please refer to Using Placeholders.

Example 1

Move all artifacts located under /rabbit in the source-frog-repo repository into the same path in the target-frog-repo repository.
jf rt mv source-frog-repo/rabbit/ target-frog-repo/rabbit/

Example 2

Move all zip files located under /rabbit in the source-frog-repo repository into the same path in the target-frog-repo repository.
jf rt mv "source-frog-repo/rabbit/*.zip" target-frog-repo/rabbit/

Example 3

Move all artifacts located under /rabbit in the source-frog-repo repository and with property "Version=1.0" into the same path in the target-frog-repo repository .
jf rt mv "source-frog-repo/rabbit/*" target-frog-repo/rabbit/ --props=Version=1.0

Deleting Files

This command is used to delete files in Artifactory

Commands Params

Command name
rt delete
Abbreviation
rt del
Command options
Warning When using the * or ; characters in the delete command options or arguments, make sure to wrap the whole options or arguments string in quotes (") to make sure the * or ; characters are not interpreted as literals.
--server-id
[Optional] Server ID configured using the config command. If not specified, the default configured Artifactory server is used.
--spec
[Optional] Path to a file spec. For more details, please refer to Using File Specs.
--props
[Optional] A list of Artifactory properties specified as "key=value" pairs separated by a semi-colon (for example, "key1=value1;key2=value2;key3=value3"). Only artifacts with these properties names and values will be deleted.
--exclude-props
[Optional] A list of Artifactory properties specified as "key=value" pairs separated by a semi-colon (for example, "key1=value1;key2=value2;key3=value3"). Only artifacts without all of the specified properties names and values will be deleted.
--build
[Optional] If specified, only artifacts of the specified build are matched. The property format is build-name/build-number. If you do not specify the build number, the artifacts are filtered by the latest build number.
--bundle
[Optional] If specified, only artifacts of the specified bundle are matched. The value format is bundle-name/bundle-version.
--recursive
[Default: true] If true, artifacts are also deleted from sub-paths under the specified path.
--quiet
[Default: false] If true, the delete confirmation message is skipped.
--dry-run
[Default: false] If true, the command only indicates which artifacts would have been deleted. If false, the command is fully executed and deletes artifacts as specified.
--exclusions
A list of Semicolon-separated exclude patterns. Allows using wildcards.
--sort-by
[Optional] A list of semicolon-separated fields to sort by. The fields must be part of the 'items' AQL domain. For more information read the AQL documentation
--sort-order
[Default: asc] The order by which fields in the 'sort-by' option should be sorted. Accepts 'asc' or 'desc'.
--limit
[Optional] The maximum number of items to fetch. Usually used with the 'sort-by' option.
--offset
[Optional] The offset from which to fetch items (i.e. how many items should be skipped). Usually used with the 'sort-by' option.
--fail-no-op
[Default: false] Set to true if you'd like the command to return exit code 2 in case of no files are affected.
--archive-entries
[Optional] If specified, only archive artifacts containing entries matching this pattern are matched. You can use wildcards to specify multiple artifacts.
--threads
[Default: 3] Number of threads used for deleting the items.
--insecure-tls
[Default: false] Set to true to skip TLS certificates verification.
--retries
[Default: 3] Number of HTTP retry attempts.
--retry-wait-time
[Default: 0s] Number of seconds or milliseconds to wait between retries. The numeric value should either end with s for seconds or ms for milliseconds.--retry-wait-time
Command arguments
The command takes one argument
Delete path
Specifies the path in Artifactory of the files that should be deleted in the following format: [repository name]/[repository path]. You can use wildcards to specify multiple artifacts.

Example 1

Delete all artifacts located under /rabbit in the frog-repo repository.
jf rt del frog-repo/rabbit/

Example 2

Delete all zip files located under /rabbit in the frog-repo repository.
jf rt del "frog-repo/rabbit/*.zip"

Searching Files

This command is used to search and display files in Artifactory.

Commands Params

Command name
rt search
Abbreviation
rt s
Command options
Warning When using the * or ; characters in the command options or arguments, make sure to wrap the whole options or arguments string in quotes (") to make sure the * or ; characters are not interpreted as literals.
--server-id
[Optional] Server ID configured using the config command. If not specified, the default configured Artifactory server is used.
--spec
[Optional] Path to a file spec. For more details, please refer to Using File Specs.
--count
[Optional] Set to true to display only the total of files or folders found.
--include-dirs
[Optional] Set to true if you'd like to also apply the source path pattern for directories and not only for files
--spec-vars
[Optional] List of variables in the form of "key1=value1;key2=value2;..." to be replaced in the File Spec. In the File Spec, the variables should be used as follows: ${key1}.
--props
[Optional] A list of Artifactory properties specified as "key=value" pairs separated by a semi-colon (for example, "key1=value1;key2=value2;key3=value3"). Only artifacts with these properties names and values will be returned.
--exclude-props
[Optional] A list of Artifactory properties specified as "key=value" pairs separated by a semi-colon (for example, "key1=value1;key2=value2;key3=value3"). Only artifacts without all of the specified properties names and values will be returned.
--build
[Optional] If specified, only artifacts of the specified build are matched. The property format is build-name/build-number. If you do not specify the build number, the artifacts are filtered by the latest build number.
--bundle
[Optional] If specified, only artifacts of the specified bundle are matched. The value format is bundle-name/bundle-version.
--recursive
[Default: true] Set to false if you do not wish to search artifacts inside sub-folders in Artifactory.
--exclusions
A list of Semicolon-separated exclude patterns. Allows using wildcards.
--sort-by
[Optional] A list of semicolon-separated fields to sort by. The fields must be part of the 'items' AQL domain. For more information read the AQL documentation
--sort-order
[Default: asc] The order by which fields in the 'sort-by' option should be sorted. Accepts 'asc' or 'desc'.
--transitive
[Default: false] Set to true to look for artifacts also in remote repositories. Available on Artifactory version 7.17.0 or higher.
--limit
[Optional] The maximum number of items to fetch. Usually used with the 'sort-by' option.
--offset
[Optional] The offset from which to fetch items (i.e. how many items should be skipped). Usually used with the 'sort-by' option.
--fail-no-op
[Default: false] Set to true if you'd like the command to return exit code 2 in case of no files are affected.
--archive-entries
[Optional] If specified, only archive artifacts containing entries matching this pattern are matched. You can use wildcards to specify multiple artifacts.
--insecure-tls
[Default: false] Set to true to skip TLS certificates verification.
--retries
[Default: 3] Number of HTTP retry attempts.
--retry-wait-time
[Default: 0s] Number of seconds or milliseconds to wait between retries. The numeric value should either end with s for seconds or ms for milliseconds.retry-wait-time
--include
[Optional] List of fields in the form of "value1;value2;...". Only the path and the fields that are specified will be returned. The fields must be part of the 'items' AQL domain. for the full supported items list check AQL documentation