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

# Installation

> [!NOTE]
>
> Missing an installation? submit a [new installation](https://github.com/keephq/keep/issues/new?assignees=\&labels=\&projects=\&template=use_case.md\&title=)  request and we will add it as soon as we can.

> [!NOTE]
>
> We recommend to install Keep CLI with Python version 3.11 for optimal compatibility and performance.
> This choice ensures seamless integration with all dependencies, including pyarrow, which currently does not support Python 3.12

> [!TIP]
>
> Need Keep CLI on other versions? Feel free to contact us!

## Clone and install (Option 1)

### Install

First, clone Keep repository:

```shell theme={null}
git clone https://github.com/keephq/keep.git && cd keep
```

Install Keep CLI with `pip`:

```shell theme={null}
# MacOS if python or pip not present:
# brew install python@3.11
# brew install postgresql
pip3.11 install .
```

or with `poetry`:

```shell theme={null}
poetry install
```

From now on, Keep should be installed locally and accessible from your CLI, test it by executing:

```
keep version
```

### Configuration

To get API key, check Keep UI -> your username (bottom left) -> Settings -> API Keys

```
keep config new --url http://backend.my_keep.my_awesome_org.com:backend_port --api-key your_personal_api_key
```

### Test

Now,

```
keep workflow apply -f examples/workflows/query_clickhouse.yml
```

Congrats 🥳 Check your UI for the new workflow uploaded from the YAML file.

## Docker image (Option 2)

### Install

```
docker run -v ${PWD}:/app -v ~/.keep.yaml:/root/.keep.yaml -it us-central1-docker.pkg.dev/keephq/keep/keep-cli keep config new --url http://backend.my_keep.my_awesome_org.com:backend_port --api-key your_personal_api_key
```

### Test

```
docker run -v ${PWD}:/app -v ~/.keep.yaml:/root/.keep.yaml -it us-central1-docker.pkg.dev/keephq/keep/keep-cli workflow apply -f examples/workflows/query_clickhouse.yml
```

## Enable Auto Completion

Keep's CLI supports shell auto-completion, which can make your life a whole lot easier 😌
If you're using zsh

```shell title=~/.zshrc theme={null}
eval "$(_KEEP_COMPLETE=zsh_source keep)"
```

If you're using bash

```bash title=~/.bashrc theme={null}
eval "$(_KEEP_COMPLETE=bash_source keep)"
```

> [!NOTE]
>
> Using eval means that the command is invoked and evaluated every time a shell is started, which can delay shell responsiveness. To speed it up, write the generated script to a file, then source that.


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