Skip to content

Add support for specifying the output directory from the command line#3101

Open
lewisjared wants to merge 1 commit into
ESMValGroup:mainfrom
lewisjared:cli-session-name
Open

Add support for specifying the output directory from the command line#3101
lewisjared wants to merge 1 commit into
ESMValGroup:mainfrom
lewisjared:cli-session-name

Conversation

@lewisjared
Copy link
Copy Markdown

@lewisjared lewisjared commented Jun 5, 2026

Description

Adds support for a --session_name CLI argument to allow users to specify the session name.
This allows the ability to write results to a fixed and known directory.

Closes #3100


Before you get started

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number pull requests:

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jun 5, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Member

@bouweandela bouweandela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @lewisjared! This is a feature that several people have asked about over the years.

Comment thread esmvalcore/_main.py
Comment on lines +629 to +630
**kwargs:
Command line arguments to override configuration parameters.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't render correctly when running esmvaltool run --help:

NAME
    esmvaltool run - Execute an ESMValTool recipe.

SYNOPSIS
    esmvaltool run RECIPE <flags>

DESCRIPTION
    `esmvaltool run` executes the given recipe. To see a list of available
    recipes or create a local copy of any of them, use the
    `esmvaltool recipes` command group.

    A list of possible flags is given here:
    https://docs.esmvaltool.org/projects/ESMValCore/en/latest/quickstart/configure.html#configuration-options

POSITIONAL ARGUMENTS
    RECIPE
        Path to the recipe to run.

FLAGS
    -s, --session_name=SESSION_NAME
        Type: Optional[]
        Default: None
        Name of the session output subdirectory (relative to the configured ``output_dir``). When given, this value is used instead of the default ``<recipe.stem>_<timestamp>``.

        If the given name already exists, a suffix is added to the session name to avoid overwriting existing data. **kwargs: Command line arguments to override configuration parameters.
    Additional flags are accepted.

NOTES
    You can also use flags syntax for POSITIONAL ARGUMENTS

@bouweandela bouweandela added the enhancement New feature or request label Jun 5, 2026
@bouweandela bouweandela changed the title Adds support for passing session_name to the CLI Add support for specifying the output directory from the command line Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Passing session_name via the CLI

3 participants