> ## Documentation Index
> Fetch the complete documentation index at: https://askmarvin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Marvin CLI

> Run typed operations from stdin and inspect configuration

The `marvin` command is installed with the package.

```bash theme={null}
marvin --help
marvin version
marvin x --help
```

## Process stdin

`x` supports `extract`, `cast`, and `generate`. Disable the default console handler when you need JSON output for a pipeline.

```bash theme={null}
export MARVIN_ENABLE_DEFAULT_PRINT_HANDLER=false
printf 'one, two, three' | marvin x -t int
printf 'forty two' | marvin x -o cast -t int
printf 'fictional space stations' | marvin x -o generate -t str -n 3
```

`extract -t int` returns a list of integers; `generate -t str -n 3` returns a list of three strings. Do not use `list[int]` unless you want each extracted item to be a list.

| Option | Purpose |
| - | - |
| `-o`, `--operation` | `extract` (default), `cast`, or `generate` |
| `-t`, `--type` | Target Python type; evaluated as a Python expression |
| `-i`, `--instructions` | Additional extraction instructions |
| `-n`, `--n` | Number of generated items |

`x` does not support `DEBUG` logging. Use an ordinary log level such as `INFO`.

## Configuration and database

```bash theme={null}
marvin config get agent_model
marvin db status
marvin db history
marvin db upgrade
```

See [configuration](https://askmarvin.ai/guides/configuration.md) and [database migrations](https://askmarvin.ai/guides/database-migrations.md). `MARVIN_AGENT_MODEL` selects the model; there is no `MARVIN_AI_PROVIDER` setting.

To preview documentation from a source checkout, use the command in the [docs README](https://github.com/PrefectHQ/marvin/blob/main/docs/README.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.