An open API service indexing awesome lists of open source software.

https://github.com/guelfoweb/ollamactl

CLI tool to interact with Ollama local and cloud backends.
https://github.com/guelfoweb/ollamactl

client cloud local ollama terminal

Last synced: 3 months ago
JSON representation

CLI tool to interact with Ollama local and cloud backends.

Awesome Lists containing this project

README

          

# ollamactl

`ollamactl` is a command-line tool to interact with **Ollama local instances** and **Ollama Cloud** using a **profiles-based** approach.

The core idea is simple:

- each **profile** represents a complete configuration (backend, model, options)
- you can create **multiple profiles**
- each terminal can use a different profile
- profiles can be chained together using standard Unix pipes

This makes it easy to make **different models talk to each other**, or to run the same prompt against different backends.

---

## What ollamactl can do

- talk to **local Ollama** instances
- talk to **Ollama Cloud**
- manage multiple **profiles**
- run chat queries from:
- command line
- stdin
- instruction files
- override parameters (like temperature) at runtime
- compose multiple models using pipes

There are **no background services**, **no agents**, and **no hidden state**.

---

## Requirements

- Python >= 3.9
- Ollama installed (for local profiles)
- Ollama Cloud [API KEY](https://ollama.com/settings/keys) (for cloud profiles)

---

## Installation

### Development (editable)

```bash
pip install -e .
```

### Production (recommended, with pipx)

```bash
pipx install .
```

Or from GitHub:

```bash
pipx install git+https://github.com/guelfoweb/ollamactl.git
```

---

## The profiles concept

A **profile** is a JSON file that defines:

- backend (`local` or `cloud`)
- model name
- connection details (host or API key)
- default options (for example temperature)

Profiles are stored in:

```text
~/.ollama_cli/profiles/
```

Each profile is independent.

---

## Managing profiles

### List profiles

```bash
ollamactl profile list
```

### Create a new profile (interactive)

```bash
ollamactl profile init NAME
```

You will be asked:

1. local or cloud
2. connection details
3. model selection

### Show a profile

```bash
ollamactl profile show NAME
```

(API keys are masked)

### Remove a profile

```bash
ollamactl profile remove NAME
```

---

## Basic chat usage

### Use a profile with an inline prompt

```bash
ollamactl --profile local "who are you?"
```

### Use stdin as input

```bash
echo "long text" | ollamactl --profile cloud "summarize it"
```

### Interactive mode

```bash
ollamactl --profile local
>> explain TCP briefly
```

---

## Instruction files (-f / --file)

The `-f` option lets you store **instructions** in a file.

In this mode:
- the file contains *what to do*
- stdin contains *what to operate on*

### Example

```bash
cat script.py | ollamactl --profile local -f prompt.txt
```

`prompt.txt`:

```text
Analyze the following code line by line.
Explain what each function does.
```

The model receives:

```

INPUT:

```

---

## Temperature

Each profile has a default temperature.

You can override it at runtime:

```bash
ollamactl --profile cloud --temperature 0.2 "explain TCP"
```

- lower values = more deterministic
- higher values = more variation

Overrides are **not saved**.

---

## Web search (cloud only)

```bash
ollamactl --profile cloud websearch "latest linux kernel vulnerabilities"
```

If used with a local profile, the command exits with a clear error.

---

## Making models talk to each other

Because `ollamactl` uses stdin/stdout, profiles can be chained:

```bash
ollamactl --profile local "analyze this code" \
| ollamactl --profile cloud "summarize the findings"
```

This is intentional and follows standard Unix composition.

---

## Configuration and security

- profiles are stored as plain JSON files
- API keys are stored locally
- file permissions are restricted (`600`)
- no keyring or encryption is used by default

---

## Design philosophy

- profiles instead of global state
- explicit over implicit
- stdin/stdout as the composition mechanism
- no automatic agents
- no background processes

`ollamactl` is designed to be predictable, scriptable, and easy to reason about.