atmos.theme
The atmos.theme function runs atmos theme through the current Atmos executable. Use it to list the available
terminal themes and show the details and color palette of a theme from automation.
Usage
atmos.theme(
*positionals,
flags = {},
args = [],
working_directory = ...,
env = ...,
output = "stream",
check = True,
)
Subcommands
Pass the subcommand and any positional arguments as strings before the keyword arguments. The call
atmos.theme("show", "Dracula") runs atmos theme show Dracula.
| Subcommand | Purpose |
|---|---|
list | List available terminal themes. |
show | Show details and a preview of a specific theme. |
See the atmos theme command reference for the complete list of subcommands and flags.
Arguments
*positionals(Optional) Strings placed on the command line right after
theme, in order: the subcommand and its positional arguments, such as the theme name forshow. Every value must be a string.flags(Optional) A dictionary of command-line options; see flag translation. A bare key such as
"recommended"becomes--recommended. Thelistsubcommand accepts"recommended".args- (Optional) A list or tuple of strings appended after the flags.
working_directory,env,output,check(Optional) See
atmos.runfor process options and defaults.
Options other than the positionals are keyword-only.
Returns
A result with stdout, stderr, and exit_code. See atmos.run for output and error behavior.
Examples
List the recommended themes
atmos.theme("list", flags = {"recommended": True})
This runs atmos theme list --recommended.
Show one theme
atmos.theme("show", "Dracula")
Capture the theme list
themes = atmos.theme("list", output = "capture")
print(themes.stdout)
Notes
The theme commands print tables and color previews intended for people, so they are mostly useful in a script that
walks a user through choosing a theme. Choosing a theme is done with the settings.terminal.theme setting in
atmos.yaml or the ATMOS_THEME environment variable. The output is not machine-readable data.
Related
atmos.runruns any Atmos command from an argument list.atmos themedocuments every subcommand and flag.- Atmos Automation Language and the script step