Get Started Quickly with JFrog CLI
This procedure walks you through installing JFrog CLI, authenticating with your JFrog Platform instance, and verifying the connection. Complete all five steps to confirm that JFrog CLI is ready to use.
This topic covers the following steps:
- Step 1: Install
- Step 2: Authenticate
- Step 3: Verify the Connection
- Step 4: View Environment Variables
- Step 5: Clean Up
Step 1: Install
To install JFrog CLI:
-
Install JFrog CLI via cURL:
curl -fL https://install-cli.jfrog.io | sh -
Verify the installation:
jf --version
If this step fails
If
jf --versionreturns "command not found", the binary is not in your PATH. Try/usr/local/bin/jf --version. If that works, add it to your PATH:export PATH=$PATH:/usr/local/bin. For other installation methods, see Download and Install JFrog CLI.
Step 2: Authenticate
To authenticate JFrog CLI with your JFrog Platform instance:
-
Add a server configuration with your access token:
jf config add <server-id> --url=<your-url> --access-token=<your-token> --interactive=falseWhere:
<server-id>: A name you choose for this configuration (for example,my-server).<your-url>: Your JFrog Platform URL (for example,https://acme.jfrog.io).<your-token>: A valid JFrog access token.
For example:
jf config add my-server --url=https://acme.jfrog.io --access-token=eyJ... --interactive=false
If this step fails
If you see "Server ID already exists", add
--overwriteto the command. If you see a connection error, verify your URL includeshttps://and is reachable withcurl -I <your-url>/api/system/ping. If you don't have an access token yet, generate one in the UI: Administration > Identity and Access > Access Tokens.
Step 3: Verify the Connection
To verify the connection to Artifactory:
-
Ping Artifactory to confirm authentication works:
jf rt ping --server-id=<server-id>You should see
OKwhen the connection is valid.
If this step fails
A 401 error means invalid credentials — regenerate your access token. A connection timeout means the URL is wrong or unreachable — verify with
curl -I <your-url>. A TLS error means certificate issues.
Step 4: View Environment Variables
To view all supported environment variables:
-
Run the following command:
jf optionsUse this output to set
JFROG_URL,JFROG_ACCESS_TOKEN, and other variables for scripted use.
Step 5: Clean Up
To remove the test server configuration:
-
Run the following command:
jf config remove <server-id> --quiet
Expected Output
When everything works correctly, your session looks something like this:
$ jf --version
jf version 2.x.x
$ jf config add my-server --url=https://acme.jfrog.io --access-token=eyJ... --interactive=false
Server configuration successfully added.
$ jf rt ping --server-id=my-server
OK
$ jf options
JFROG_CLI_LOG_LEVEL Log verbosity. DEBUG, INFO, WARN or ERROR
JFROG_CLI_LOG_TIMESTAMP Timestamp format for log messages...
... (full list of environment variables)
$ jf config remove my-server --quiet
Troubleshooting
| Problem | Fix |
|---|---|
jf: command not found | The CLI is not in your PATH. Re-run the install script or add the binary location to your PATH |
jf rt ping returns an error | Check your URL (must include https://) and verify the access token is valid |
| "Server ID already exists" | Add --overwrite to the jf config add command |
Updated 12 days ago
