CLI coding agent with Ollama support
Project description
ocla: CLI Coding Agent
A hobby project implementing an experimental command-line coding agent. Use it to generate code, analyze repositories, and manage development tasks directly from your terminal.
Warning: This is experimental software and may be unstable or incomplete. Use at your own risk. Functionality, performance, and APIs are subject to change without notice.
Features
- Ollama-first; local LLM support.
- OpenAI support for more powerful models.
- Session management and context usage tracking.
- Project-centric storage and configuration.
- Support for Linux & Windows.
Dependencies & Installation
ocla can be installed through uv:
uv pip install --system ocla
Ollama
ocla integrates with Ollama to run models locally.
Download & install ollama, then download a model:
ollama pull qwen3
And start the Ollama API:
ollama serve
Then confirm that we can connect:
ocla model list
You can tweak the ollama_host setting described below to direct ocla to the correct endpoint. By default,
ocla expects ollama to be running at http://localhost:11434. ocla will respect the OLLAMA_HOST
environment variable if ollama_host is not configured.
OpenAI
You will need to configure ocla via the provider and openai_api_key settings described below.
Usage
Simply running ocla will initiate prompt input to give instructions to the agent. Prompts can also
be fed from stdin.
echo "find a bug for me" | ocla
ocla utilizes sessions to iterate on tasks, with a new session automatically created if one
is not already active. By default, running ocla will use the same session as previous invocations.
You can force a new session with the -n flag:
echo "This is a fresh conversation" | ocla -n
The current session is stored in ./.ocla/state.json, and available sessions can be managed:
ocla session list # show all saved sessions
ocla session set <session-name> # make <session-name> the active session.
WARNING: session data itself (including your prompts) is stored in ./.ocla/sessions. Empty this directory
to do a hard delete of your conversations. You should add .ocla to your .gitignore to ensure this
data is never stored in VCS.
By default, ocla will continue to offer prompt interactively until you explicitly quit (q). You can change
this to have ocla read a single prompt then quit with the -pm flag (see prompt_mode below):
echo "how do i define a type in typescript?" | ocla -n -pm ONESHOT
Configuration
ocla supports configuration through three sources, in the following order of precedence (highest to lowest):
- Command-line arguments
- Environment variables
- Configuration file –
.ocla/config.jsonin the current working directory
Each configuration setting specifies which of these sources it supports.
config_file
Path to the config file
- CLI:
N/A - Environment variable:
OCLA_CONFIG_FILE - Config file:
N/A - Default value:
./.ocla/config.json
context_window
Context window size in tokens
- CLI:
N/A - Environment variable:
OCLA_CONTEXT_WINDOW - Config file:
contextWindow - Default value:
16384
log_level
Log level
- CLI:
N/A - Environment variable:
OCLA_LOG_LEVEL - Config file:
logLevel - Default value:
WARNING - Allowed values:
CRITICALERRORWARNINGINFODEBUG
model
The model to use for agent inference. Must be available in the Ollama API
- CLI:
-m --model - Environment variable:
OCLA_MODEL - Config file:
model - Default value:
qwen3
ollama_host
Override the OLLAMA_HOST for the Ollama API
- CLI:
N/A - Environment variable:
OCLA_OLLAMA_HOST - Config file:
ollamaHost - Default value:
N/A
openai_api_key
Override the OPENAI_API_KEY for OpenAI calls. Ocla will fall back to OPENAI_API_KEY.
- CLI:
N/A - Environment variable:
OCLA_OPENAI_API_KEY - Config file:
openaiApiKey - Default value:
N/A
project_context_file
the relative path to a file that gives ocla more context about your project (case-insensitive)
- CLI:
N/A - Environment variable:
OCLA_PROJECT_CONTEXT_FILE - Config file:
projectContextFiles - Default value:
AGENTS.md
prompt_mode
How you want to interact with the assistant
- CLI:
-pm --prompt-mode - Environment variable:
OCLA_PROMPT_MODE - Config file:
promptMode - Default value:
INTERACTIVE - Allowed values:
ONESHOT: The program quits after a single promptINTERACTIVE: You issue prompts until quit
provider
Model provider to use
- CLI:
-p --provider - Environment variable:
OCLA_PROVIDER - Config file:
provider - Default value:
ollama - Allowed values:
ollama: Use local Ollama modelsopenai: Use the OpenAI API
session_dir
Path to the session directory
- CLI:
N/A - Environment variable:
OCLA_SESSION_DIR - Config file:
sessionDir - Default value:
./.ocla/sessions
session_storage_mode
how we store session data on disk
- CLI:
N/A - Environment variable:
OCLA_SESSION_STORAGE_MODE - Config file:
sessionStorageMode - Default value:
COMPRESS - Allowed values:
PLAIN: Plain text (JSON). Can get large.COMPRESS: Compressed via gzip
state_file
Path to the state file
- CLI:
N/A - Environment variable:
OCLA_STATE_FILE - Config file:
stateFile - Default value:
./.ocla/state.json
thinking
Enable & show model thinking. If the model does not support thinking, this has no effect and thinking is disabled.
- CLI:
-t --thinking - Environment variable:
OCLA_THINKING - Config file:
thinking - Default value:
ENABLED - Allowed values:
DISABLED: The model will not think and nothing is shownHIDDEN: The model will think, but thinking output is not displayedENABLED: The model will think and ocla prints this output
tool_permission_mode
How tools request permission to run
- CLI:
N/A - Environment variable:
OCLA_TOOL_PERMISSION_MODE - Config file:
toolPermissionMode - Default value:
DEFAULT - Allowed values:
DEFAULT: Ask for permission for non-trivial toolsALWAYS_ASK: Always ask for permission for all toolsALWAYS_ALLOW: Always run any tool; use with caution
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ocla-0.1.2.tar.gz.
File metadata
- Download URL: ocla-0.1.2.tar.gz
- Upload date:
- Size: 24.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c355f3046eba5a26a6f715b3ddb5e944e5812702580c900adf08cb20dd864a3c
|
|
| MD5 |
cefafa6c9306817e037d421f55ff766c
|
|
| BLAKE2b-256 |
2843a12857e8073ecd695d330370a008d6f24f0ff675fbdd6117d71231fc6a77
|
File details
Details for the file ocla-0.1.2-py3-none-any.whl.
File metadata
- Download URL: ocla-0.1.2-py3-none-any.whl
- Upload date:
- Size: 25.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d4f170141f9f5dffa077c71c588c8d6dd43115a43823859cf06b226b12c71d0
|
|
| MD5 |
1e7a7f4327ebaee6a5e363579bfa8e9c
|
|
| BLAKE2b-256 |
cfdf7355bc2352a1d9d017fd8b65a44d70f4a0c62eb799b707369449e53db7c0
|