> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/sast-and-sca/ocular/interpreter.md).

# Ocular Interpreter

The Ocular shell can be used as a script interpreter, that is, in non-interactive mode.

## Basic Usage <a href="#basic-usage" id="basic-usage"></a>

Ocular can be used in non-interactive mode. You would execute commands and operations via a script that you specify as an argument instead of manually typing them after the Ocular prompt. Ocular runs the commands in your script and exits when done.

For example, let's say you have a file named `test.sc` with the following contents:

```
@main def exec(cpgFile: String, outFile: String) = {
   importCpg(cpgFile)
   cpg.namespace.name.l |> outFile
}
```

![](/files/DfHDmRpYn5HJOmhRtTva) ![](/files/P5vj8JOtHNJWVEvAqKym)

You can include Scala code in `test.sc` and use the `|>` operator to pipe output into files. The script is then run as follows:

```
sl ocular -- --script test.sc --params cpgFile=/src.path.zip,outFile=output.log
```

![](/files/DfHDmRpYn5HJOmhRtTva) ![](/files/P5vj8JOtHNJWVEvAqKym)

## Importing Additional Scripts <a href="#importing-additional-scripts" id="importing-additional-scripts"></a>

If your script depends on code from one or more additional scripts, you can use the `--import` parameter, which accepts a comma-separated list of input scripts:

```
sl ocular -- --script test.sc --params cpgFile=/src.path.zip,outFile=output.log --import scripts/hello.sc
```

![](/files/CRrxFX9wuboXxDrdB2dv)

![](/files/DfHDmRpYn5HJOmhRtTva) ![](/files/P5vj8JOtHNJWVEvAqKym)
