Delete a permission target with jf rt permission-target-delete

Permanently delete an Artifactory permission target using jf rt permission-target-delete.

Permanently delete a permission target from the JFrog Platform.

Prerequisites

  • JFrog CLI installed and configured (jf config add)
  • Admin privileges on the Artifactory instance
  • An existing permission target to delete. To create one, see jf rt permission-target-create

Synopsis

jf rt permission-target-delete <permission-target-name> [options]

Aliases: rt ptdel

📘

Note

The CLI --help output displays the alias form (jf rt ptdel) as the command name. Both permission-target-delete and ptdel are fully equivalent.

Arguments

ArgumentRequiredDescription
<permission-target-name>YesName of the permission target to remove

Options

FlagDefaultDescription
--access-tokenJFrog access token
--client-cert-key-pathPrivate key file for the client certificate in PEM format
--client-cert-pathClient certificate file in PEM format
--passwordJFrog password
--quiet$CISet to true to skip the delete confirmation message. Defaults to true when the CI environment variable is set to any non-empty value. Otherwise, it defaults to false.
--server-idServer ID configured using the jf config command
--ssh-key-pathSSH key file path
--ssh-passphraseSSH key passphrase
--urlJFrog Artifactory URL (example: https://acme.jfrog.io/artifactory)
--userJFrog username

Examples

Delete a Permission Target (Interactive)

Run without --quiet in a terminal to see a confirmation prompt before deletion.

To delete a permission target interactively:

  • Run:
jf rt permission-target-delete <permission-target-name>

Where:

  • <permission-target-name>: Name of the permission target to remove (see Arguments).

Full example:

jf rt permission-target-delete my-permission-target

Expected output:

[Info] Deleting permission target...
Delete the permission target 'my-permission-target'? (y/N): y
[Info] Done deleting permission target.

Enter y to confirm or N (or press Enter) to cancel without making any changes.

🚧

Warning

This action permanently removes the permission target. You cannot undo it.


Delete a Permission Target (Non-Interactive)

Use --quiet to suppress the confirmation prompt — required for CI pipelines and scripts.

To delete a permission target without a confirmation prompt:

  • Run:
jf rt permission-target-delete <permission-target-name> --quiet

Full example:

jf rt permission-target-delete my-permission-target --quiet

Expected output:

[Info] Deleting permission target...
[Info] Done deleting permission target.
🚧

Warning

This action permanently removes the permission target. You cannot undo it.


Delete a Permission Target That Does Not Exist

If the named permission target is not found, the command exits with code 1 and prints an error.

To handle a missing permission target (example):

  • Run:
jf rt permission-target-delete <permission-target-name> --quiet

Full example:

jf rt permission-target-delete nonexistent-target --quiet

Expected output:

[Info] Deleting permission target...
[Error] server response: 404
{"errors":[{"status":404,"message":"Permission target 'nonexistent-target' does not exist"}]}

Use the exit code in scripts to detect this condition:

Full example:

jf rt permission-target-delete my-target --quiet
if [ $? -ne 0 ]; then
  echo "Delete failed — target may not exist"
fi

View command usage

To view command usage:

  • Run:
jf rt permission-target-delete --help

Expected output:

Name:
  jf rt ptdel - Permanently delete a permission target.

Usage:
  jf rt ptdel <permission target name>

Arguments:
  permission target name
    Specifies the permission target that should be removed.

Options:
  --quiet    [Default: $CI] Set to true to skip the delete confirmation message.
  ...

Important Notes

  • Irreversible: Deleting a permission target immediately removes access control rules. Users and groups governed by this target lose their permissions instantly.
  • --quiet default: Defaults to true when the CI environment variable is set to any non-empty value. Otherwise, it defaults to false. The CLI does not detect whether stdin is a TTY. If --quiet is not set and CI is not set, the command always prompts for confirmation and reads from stdin, even in a non-interactive script. If stdin has no input available (for example, < /dev/null), the prompt reads an empty answer, which is treated as "no" and the permission target is not deleted. To ensure deletion proceeds without a prompt, pass --quiet (or --quiet=true) explicitly, or set the CI environment variable.
  • Confirmation prompt: In an interactive terminal (without --quiet), the CLI asks:
    Delete the permission target '<name>'? (y/N):
    Enter y to proceed or N to abort. The deletion is not performed until you confirm.
  • Requires admin privileges on the Artifactory instance.
  • If the permission target does not exist, the command exits with code 1 and returns a 404 server error. See Delete a Permission Target That Does Not Exist for the exact error format.
  • The CLI emits [Info] Deleting permission target... immediately before contacting the server. If an error follows this line, the deletion did not occur.
  • The error response includes a Trace ID in an [Info] line preceding the error. Provide this ID when raising a support ticket.

Related Commands

CommandDescription
jf rt permission-target-template (rt ptt)Create a JSON template interactively for use with create or update
jf rt permission-target-create (rt ptc)Create a new permission target from a template file
jf rt permission-target-update (rt ptu)Replace an existing permission target from a template file

Frequently Asked Questions

This section provides answers to frequently asked questions.

plusFAQs
Q: How do I permanently delete a permission target?

A: Run jf rt permission-target-delete <permission-target-name>. In a terminal, the CLI asks for confirmation first. See Examples for interactive and non-interactive usage.

Q: What happens if I delete a permission target that doesn't exist?

A: The command exits with code 1 and returns a 404 server error. See Delete a Permission Target That Does Not Exist for the exact error format.

Q: What is the difference between running this command with and without --quiet?

A: Without --quiet, the CLI prompts for confirmation before deleting. With --quiet, the confirmation prompt is skipped, which is required for CI pipelines and scripts. See Important Notes.

Q: What permissions do I need to delete a permission target?

A: You need admin privileges on the Artifactory instance. See Prerequisites.

Q: Can I undo a permission target deletion?

A: No. Deletion is permanent and immediately removes the access control rules for that target. To restore access, create a new permission target with jf rt permission-target-create.

Related Topics



What’s Next

To create a new permission target, start with the template command.

Did this page help you?