summaryrefslogtreecommitdiff
path: root/docs/modules/cli/pages/set-safe-mode.adoc
blob: 66db3565b60a9bb8fdf5107db398af837500576f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
= Set the Safe Mode Using the CLI
:navtitle: Set Safe Mode

When Asciidoctor is invoked via the CLI, the xref:ROOT:safe-modes.adoc[safe mode] is set to `UNSAFE` by default.

== Assign safe mode level

You can change the security level by executing one of the following commands:

`-S`, `--safe-mode=SAFE_MODE`::
Sets the safe mode level of the document according to the assigned level (`UNSAFE`, `SAFE`, `SERVER`, `SECURE`).

`--safe`, `asciidoctor-safe`::
Sets the safe mode level to `SAFE`.
Provided for compatibility with the python AsciiDoc `safe` command.

////
-B, --base-dir=DIR
Base directory containing the document and resources. Defaults to the directory containing the source file, or the working directory if the source is read from a stream. Can be used as a way to chroot the execution of the program.
////

You can also set the xref:api:set-safe-mode.adoc[safe mode from the API] and xref:ROOT:reference-safe-mode.adoc[enable or disable content based on the current safe mode].