# run

## Usage

`prism run` is used to execute your Prism project.

```
Usage: prism run [OPTIONS]                                                                                         
                                                                                                                    
 Run your Prism project. This is the CLI equivalent of calling PrismProject.run(...) in your Python script.         
                                                                                                                    
 Examples:                                                                                                          
                                                                                                                    
  • prism run                                                                                                       
  • prism run -t task01.Task01 -t task02.Task02                                                                     
  • prism run -t task01.Task01 --all-downstream                                                                     
  • prism run --runtime-ctx '{"hi": 1}'                                                                             
                                                                                                                    
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│    --project-id                TEXT                                 Project ID.                                  │
│    --project-name              TEXT                                 Project name.                                │
│    --project-version           TEXT                                 Project version.                             │
│    --connector                 TEXT                                 Import path to the connector instances to    │
│                                                                     use for your project. These can be accessed  │
│                                                                     at runtime CurrentRun.conn(...).             │
│    --concurrency               INTEGER                              Number of threads to use when running tasks. │
│                                                                     Default is 1 (i.e., single-threaded)         │
│ *  --tasks-dir                 TEXT                                 Directory containing tasks. Default is the   │
│                                                                     "tasks" folder in the current directory.     │
│                                                                     [required]                                   │
│    --package-lookups           TEXT                                 Additional directories / modules to look     │
│                                                                     within when importing modules and functions  │
│                                                                     in your code. The tasks_dir and its parent   │
│                                                                     are automatically added to this list.        │
│    --task                  -t  TEXT                                 Task ID to run. If not specified, then all   │
│                                                                     tasks are run. Tasks are retrieved from the  │
│                                                                     tasks_dir path specified in the PrismProject │
│                                                                     instance. You can specify multiple tasks     │
│                                                                     with as follows: -t <your_first_task> -t     │
│                                                                     <your_second_task>.                          │
│    --runtime-ctx           -c  TEXT                                 Runtime context as a dictionary. Must be a   │
│                                                                     valid JSON. These overwrite variables in the │
│                                                                     PrismProject context                         │
│    --all-tasks-upstream    -u                                       Execute all tasks upstream of tasks          │
│                                                                     specified with --task                        │
│    --all-tasks-downstream  -d                                       Execute all tasks downstream of tasks        │
│                                                                     specified with --task                        │
│    --on-success            -s  TEXT                                 Callback to run if the job succeeds. Use     │
│                                                                     import paths to specify the callback. You    │
│                                                                     can specify multiple callbacks as follows:   │
│                                                                     -s <callback1> -s <callback2>                │
│    --on-failure            -f  TEXT                                 Callback to run if the job fails. Use import │
│                                                                     paths to specify the callback. You can       │
│                                                                     specify multiple callbacks as follows: -f    │
│                                                                     <callback1> -f <callback2>                   │
│    --full-refresh                                                   Run all the tasks, regardless of whether or  │
│                                                                     not they are already done                    │
│    --log-level             -l  [info|warning|error|debug|critical]  Set the log level                            │
│    --disable-rich-logging                                           Disable default logging behavior, whereby    │
│                                                                     logs are beautified in the console with the  │
│                                                                     rich package.                                │
│    --log-file                  TEXT                                 File in which to save the logs. Default is   │
│                                                                     None.                                        │
│    --help                                                           Show this message and exit.                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

The CLI arguments are largely the same as the arguments used to instantiate the [`PrismProject`](https://docs.runprism.com/fundamentals/prismproject-api) and call the [`PrismProject.run()`](https://docs.runprism.com/fundamentals/prismproject-api/prismproject-.run) method. One difference, however is that `--runtime-ctx` should be a *string*, not a JSON. For example:

```
prism run --runtime-ctx '{"hi": 1}'
```

Prism converts this string to a JSON prior to actually executing the project.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.runprism.com/cli/run.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
