Edit a JFrog CLI Server Configuration

Update fields in an existing JFrog CLI server configuration with jf config edit, interactively or non-interactively.

jf config edit updates an existing server entry in the JFrog CLI configuration. In a normal terminal, the command opens interactive prompts so you can change fields safely. In continuous integration and continuous delivery (CI/CD) or scripts, you can pass --interactive=false and flags for only the values you want to change. You must understand which fields clear when you do not supply them.

Prerequisite. JFrog CLI is installed on your PATH, and at least one server is already configured. To list server IDs, use jf config show. To create a server, see Add a JFrog CLI server configuration.

🚧

Warning

Running non-interactively risks data loss. When you run non-interactively (either by passing --interactive=false or in any environment where $CI is set, since the JFrog CLI automatically disables interactive mode when $CI=true), any field you do not explicitly pass as a flag is cleared and saved as empty. The command exits 0 with no error or warning. Always pass every field you want to preserve when you run non-interactively, and verify results with jf config show <server-id> afterwards.

This topic covers:

Synopsis

jf config edit <server-id>

Aliases: jf c edit

Where:

  • <server-id>: The configured server ID to edit. Run jf config show to list IDs.

Arguments

The following table describes command arguments.

ArgumentRequiredDescription
server-idYesThe server ID to edit. Run jf config show to list configured server IDs.

Options

The following table describes command options.

FlagDefaultDescription
--urlJFrog Platform URL (for example, https://acme.jfrog.io)
--access-tokenJFrog Platform access token
--access-token-stdinfalseRead the access token from standard input instead of the flag value
--userJFrog Platform username
--passwordJFrog Platform password or API key
--password-stdinfalseRead the password from standard input instead of the flag value
--interactivetrue (auto false when $CI=true)Set to false to disable prompts and apply values from flags directly
--artifactory-urlOverride the JFrog Artifactory URL (for example, https://acme.jfrog.io/artifactory)
--distribution-urlOverride the JFrog Distribution URL
--xray-urlOverride the JFrog Xray URL
--mission-control-urlOverride the JFrog Mission Control URL
--ssh-key-pathPath to an SSH key file
--ssh-passphrasePassphrase for the SSH key
--client-cert-pathClient certificate file in PEM format
--client-cert-key-pathPrivate key for the client certificate in PEM format
--basic-auth-onlyfalseDisable automatic replacement of username and password with a refreshed access token
--enc-passwordtrueSet to false to skip encrypting the password through the JFrog Artifactory encryption REST API
--insecure-tlsfalseSkip TLS certificate verification when the JFrog CLI calls Artifactory's encryption REST API to encrypt the password (relevant when --enc-password is true, the default, against a server with a self-signed certificate)
--disable-token-refreshfalseDisable automatic hourly refresh of the access token

Examples

Edit a Server Configuration

Change one or more fields on an existing server without recreating the whole entry.

To edit a server configuration interactively:

  1. Run the following command:

    jf config edit <server-id>

    Where:

    • <server-id>: The server ID to edit.

    For example:

    jf config edit myserver
  2. Complete the prompts in order:

    1. JFrog Platform URL. The current value is shown in brackets. Press Enter to keep it, or type a new URL.

      JFrog Platform URL [https://mycompany.jfrog.io/]:
    2. Service URL menu. An arrow-key menu lists the derived Artifactory, Distribution, Xray, and Mission Control URLs. Use the arrow keys and Enter to select an entry to override it, or select Save and continue to keep the derived values.

      Select 'Save and continue' or modify any of the URLs
        > Save and continue
          JFrog Artifactory URL(https://mycompany.jfrog.io/artifactory/)
          JFrog Distribution URL(https://mycompany.jfrog.io/distribution/)
          JFrog Xray URL(https://mycompany.jfrog.io/xray/)
          JFrog Mission Control URL(https://mycompany.jfrog.io/mc/)
    3. Authentication method menu. Since editing does not pre-fill the existing password or access token, this menu always appears unless you already passed --access-token or --password as a flag:

      Select one of the following authentication methods:
        > Access Token
          Web Login
          Username and Password / Reference token
          Mutual TLS
    4. Depending on the method you select, the JFrog CLI prompts for the matching credentials only:

      • Access Token: JFrog access token: (hidden input), then an optional username prompt if one isn't already resolved from the token.
      • Username and Password / Reference token: JFrog username [<current>]: (current value in brackets), then JFrog password or Reference Token: (hidden input).
      • Mutual TLS: Client certificate file path: and Client certificate key path: prompts, shown only if those fields aren't already set.
      • Web Login: opens a browser-based login flow. No additional prompts.

      The SSH Key File Path, Client Certificate File Path, and Client Certificate Key Path prompts shown elsewhere in JFrog CLI only appear for an SSH URL or the Mutual TLS method. They are not part of every edit session.

  3. Confirm the update. After all prompts complete, the JFrog CLI prints no output.

To verify your changes:

  • Run:

    jf config show <server-id>

    Where:

    • <server-id>: Same server you edited.

    For example:

    jf config show myserver

Non-Interactive Usage for CI/CD

Pass --interactive=false along with the flags for every field you want to retain. Only the fields you specify are written. All other fields are cleared, so always pass every field you need to keep.

To rotate an access token non-interactively:

  1. Run the following command, supplying every field you must preserve (including URL and new token):

    jf config edit <server-id> \
      --interactive=false \
      --url=<your-server-url> \
      --access-token=<Token>

    Where:

    • <server-id>: The server ID to edit.
    • <your-server-url>: JFrog Platform URL for this server.
    • <Token>: New access token. Do not use a sample value in real environments.

    For example:

    jf config edit myserver \
      --interactive=false \
      --url=https://mycompany.jfrog.io/ \
      --access-token=<Token>

To update the platform URL after a domain change:

  1. Run:

    jf config edit <server-id> \
      --interactive=false \
      --url=<new-platform-url> \
      --access-token=<Token>

    Where:

    • <server-id>: The server ID to edit.
    • <new-platform-url>: The new JFrog Platform base URL.
    • <Token>: Current valid access token.

    For example:

    jf config edit myserver \
      --interactive=false \
      --url=https://newdomain.jfrog.io/ \
      --access-token=<Token>
📘

Note

In CI/CD environments, $CI is typically set to true, which causes --interactive to default to false automatically. The same data-loss risk applies. Always pass all required flags explicitly.

Replace a Full Configuration with Add and Overwrite

Alternatively, jf config add --overwrite --interactive=false replaces the entire configuration entry and helps when you want to fully re-provision a server configuration from scratch.

To replace a server configuration using add and overwrite:

  1. Run:

    jf config add <server-id> \
      --url=<your-server-url> \
      --access-token=<Token> \
      --interactive=false \
      --overwrite

    Where:

    • <server-id>: Existing server ID to replace.
    • <your-server-url>: JFrog Platform URL.
    • <Token>: Access token for authentication.

    For example:

    jf config add myserver \
      --url=https://mycompany.jfrog.io/ \
      --access-token=<Token> \
      --interactive=false \
      --overwrite

When to Use

Use jf config edit when you need to update 1 or more fields in an existing server configuration, including rotating an access token or updating a URL after a domain change. It works in both interactive terminal sessions and non-interactive environments (CI/CD, scripts) when combined with --interactive=false and the relevant flags.

Use jf config add --overwrite instead when you want to fully replace an existing configuration entry from scratch rather than patch specific fields.

Important Notes

  • Non-interactive mode clears unspecified fields. When --interactive=false is set (or when $CI=true, which triggers non-interactive mode automatically), any field you do not pass as a flag is saved as empty. There is no warning. Always pass every field you want to keep, and verify with jf config show <server-id> afterwards.
  • $CI=true disables interactive mode automatically. In CI/CD pipelines where the CI environment variable is set, the command runs non-interactively by default, even without --interactive=false. This matches the behavior of jf config add.
  • Blank input behaves differently by field type (interactive mode). For the URL, username, SSH key path, and client certificate path prompts, submitting a blank value has the same effect as pressing Enter: the current value is kept. There is no way to clear these fields by typing blank text at the prompt. For the access token and password/reference token prompts, there is no current value shown, so submitting a blank value saves an empty value and effectively clears the credential.
  • No confirmation step. Changes are committed immediately after the final prompt (interactive) or after the command runs (non-interactive). There is no "save changes? (y/N)" prompt.
  • The command produces no success output. On success the command exits 0 silently. Run jf config show <server-id> to verify your changes.
  • Editing does not change the server ID. To rename a server, remove it with jf config remove and add a new one with jf config add.
  • jf config edit does not prompt to change which server is the default. Use jf config use <server-id> to change the default server.
  • If you have JFROG_CLI_ENCRYPTION_KEY set, edited credentials are re-encrypted with the same key. If the key has changed since the server was originally configured, re-enter your credentials during the edit so they are encrypted correctly.

Troubleshooting

"Server ID '<server-id>' doesn't exist."

jf config edit only updates a server ID that is already configured. It never creates one. This error appears (exit code 1) when <server-id> doesn't match any configured server.

  • Run jf config show to list configured server IDs and check for typos.
  • Use jf config add <server-id> to create a new server configuration instead.

"the --basic-auth-only option is only supported when username and password/API key are provided"

--basic-auth-only requires --user and --password (or a previously configured username/password) and can't be combined with --access-token. Remove --access-token or switch to username/password authentication.

Frequently Asked Questions

This section provides answers to frequently asked questions.

plusFAQs
Q: How do I edit a JFrog CLI server configuration?

A: Run jf config edit <server-id> and follow the prompts, or pass --interactive=false with the flags for the fields you want to change. See Edit a Server Configuration.

Q: What happens if I run jf config edit non-interactively without passing every field?

A: Any field you don't pass as a flag is cleared and saved as empty, with no warning. Always pass every field you want to keep, and verify with jf config show <server-id> afterward.

Q: What's the difference between jf config edit and jf config add --overwrite?

A: jf config edit patches only the fields you pass, keeping existing values for the rest in interactive mode. jf config add --overwrite replaces the entire configuration entry from scratch.

Q: Can I rename a server configuration with jf config edit?

A: No. Editing doesn't change the server ID. To rename a server, remove it with jf config remove and add a new one with jf config add.

Q: What do I need before I can run jf config edit?

A: JFrog CLI installed on your PATH and at least one server already configured. Run jf config show to list configured server IDs.

Related Topics


What’s Next

After editing, verify your changes with jf config show.

Did this page help you?