Configure JFrog CLI server connections, authentication, and multi-server setup. Use when setting up JFrog CLI, adding servers, switching between instances, managing credentials, or troubleshooting authentication issues. Triggers on jf config, jf login, authentication, server setup, access token.
Server configuration and authentication for JFrog CLI.
# Interactive setup (recommended for first time)
jf config add my-server --url https://your-instance.jfrog.io --interactive
# Web-based login (Artifactory 7.64.0+)
jf login https://your-instance.jfrog.io
# Non-interactive (CI/CD)
jf config add artifactory --url https://your-instance.jfrog.io --access-token $JFROG_ACCESS_TOKEN
# Show current config
jf config show
# Switch active server
jf config use my-server
# Interactive mode
jf config add <server-id> --url <url> --interactive
# With access token (recommended for CI/CD)
jf config add <server-id> --url <url> --access-token <token>
# With username/password
jf config add <server-id> --url <url> --user <username> --password <password>
# With API key (deprecated)
jf config add <server-id> --url <url> --apikey <key>
jf config edit <server-id> --interactive
jf config edit <server-id> --url <new-url>
# Show all servers
jf config show
# Show specific server
jf config show <server-id>
# Remove specific server
jf config remove <server-id>
# Remove all configurations
jf config remove --all
jf config use <server-id>
# Export to token (for sharing/backup)
jf config export <server-id>
# Import from token
jf config import <config-token>
For interactive environments with a browser (Artifactory 7.64.0+):
jf login <platform-url>
Opens browser for OAuth/SSO authentication. Token is stored automatically.
| Method | Use Case | Command Flag |
|---|---|---|
| Access Token | CI/CD, automation | --access-token |
| Username/Password | Interactive setup | --user, --password |
| Web Login | Developer machines | jf login <url> |
| API Key | Legacy (deprecated) | --apikey |
Recommended: Use access tokens for automation. Create tokens with minimal required scopes.
# Add multiple servers
jf config add prod --url https://prod.jfrog.io --access-token $PROD_TOKEN
jf config add dev --url https://dev.jfrog.io --access-token $DEV_TOKEN
# Switch between them
jf config use prod
jf rt upload ... # Uses prod
jf config use dev
jf rt upload ... # Uses dev
# Or specify per-command
jf rt upload --server-id=prod ...
Override config with environment variables:
| Variable | Purpose |
|---|---|
JFROG_CLI_SERVER_ID | Default server ID |
JF_URL | Platform URL |
JF_USER | Username |
JF_PASSWORD | Password |
JF_ACCESS_TOKEN | Access token |
~/.jfrog/jfrog-cli.conf.v6%USERPROFILE%\.jfrog\jfrog-cli.conf.v6# List configured servers
jf config show
# Check active server
jf config use
# Test connection
jf rt ping
# Re-authenticate
jf config edit <server-id> --interactive
# Re-login
jf login <url>
# Or update token
jf config edit <server-id> --access-token <new-token>