Tiny local coding CLI with a small tool surface
Project description
oy-cli
AI coding assistant for your shell. Reads files, searches content, and runs commands.
uv tool install oy-cli
oy "add docstrings to public functions"
Examples
# Basic usage
oy "inspect the main module and suggest improvements"
# Work in a specific directory
OY_ROOT=./my-project oy "fix the failing tests"
# Non-interactive mode (CI/pipelines)
echo "update the changelog" | OY_NON_INTERACTIVE=1 oy
# Security audit
oy audit
oy audit "focus on authentication"
Commands
oy "prompt" # Run with a prompt (default)
oy chat # Interactive multi-turn session
oy audit # Security audit against OWASP ASVS/MASVS
oy model # Show current model, pick model from available endpoints
oy --help # Show all commands
Why This Exists
oy is small, auditable, and built around a narrow tool surface.
Design goals: small auditable codebase, minimal tool surface, OpenAI-completions-focused CLI loop, multiple backends behind shims, new session each run, and explicit checkpoints when needed.
Session Text and Prompts
All text that is sent as part of model sessions lives in oy_cli/session_text.toml.
That includes:
- base system prompt text
- interactive/non-interactive prompt suffixes
- audit prompt text
- research-only
/asksuffix - transcript compaction text (
Current todo list, omitted-history note, TOON packed-history note) - built-in tool descriptions exposed to the model
Code that reads and composes this content now lives mainly in oy_cli/runtime.py, with transcript/agent flow in oy_cli/agent.py and CLI entrypoints in oy_cli/cli.py.
Configuration
Environment variables:
| Variable | Purpose |
|---|---|
OY_MODEL |
Override model for this session (bare name or shim:model) |
OY_SHIM |
Force a specific shim: openai, codex, copilot, opencode, opencode-go, or bedrock-mantle |
OY_NON_INTERACTIVE |
Set to 1 to disable approval/checkpoint pauses |
OY_ROOT |
Run against different workspace |
OY_SYSTEM_FILE |
Append extra system instructions |
OY_CONFIG |
Override config path (default: ~/.config/oy/config.json) |
Config file (~/.config/oy/config.json):
{"shim": "openai", "model": "glm-5"}
The shim field pins which backend to use regardless of what else is signed in.
Use oy model <filter> to pick interactively; it merges models from available
signed-in shims into a single list using shim:model prefixes.
On first run, if no model is configured, oy prompts you to pick one from
the available backends. Set OY_MODEL, OY_SHIM, or save a config with
oy model to pin behavior.
Model notes: From testing, glm-5 balances intelligence,
cost, and tool-use ability. kimi-k2.5 is another option.
The Artificial Analysis Comparison of Open Source Models
is a reference.
Requirements
- Python 3.13+
bash- OpenAI API key or compatible endpoint credentials, Codex local auth, Copilot auth, OpenCode auth, or AWS CLI configured for Bedrock Mantle
Installation
uv tool install oy-cli # Preferred
pip install oy-cli # Alternative
Development
For local development, linting, tests, and builds, use uv.
Do not run bare pytest, ruff, or pip install -e . commands in this repo.
uv sync
uv run ruff format .
uv run ruff check .
uv run python -m pytest tests/ -v
uv run oy --help
uv build
See CONTRIBUTING.md for the contributor workflow.
Authentication
OpenAI:
export OPENAI_API_KEY=sk-...
For OpenAI-compatible endpoints:
export OPENAI_BASE_URL=https://your-endpoint.example/v1
export OPENAI_API_KEY=...
Copilot and Codex (OpenAI) creds are introspected
and used, if creds are available oy model will show them in the model list.
AWS Bedrock Mantle: Uses your default AWS profile/region. Supports auto-refresh of stale SSO sessions.
export AWS_PROFILE=my-profile
export AWS_REGION=us-west-2
Troubleshooting
"Missing API credentials" -> Set OPENAI_API_KEY, sign in with codex, authenticate gh for Copilot, run opencode auth, or configure AWS CLI (aws configure) for Bedrock Mantle.
"stdin is not a TTY" -> Piping input disables ask. Set OY_NON_INTERACTIVE=1 to make explicit.
"AWS SSO session is stale" -> Run aws sso login --use-device-code --no-browser.
Security
oy can run shell commands and modify files with your permissions. Treat it like any other local automation tool.
Recommended:
- run in a repo or workspace you trust
- mount only needed directories in containers
- avoid exposing long-lived secrets in the environment
- review generated changes before shipping
Protections: workspace-bound file access for built-in file tools and default SDK credential flows for supported providers.
Links
- Issues - Known issues and audit findings
- Contributing - Development and release notes
License
Apache License 2.0
Project details
Release history Release notifications | RSS feed
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 oy_cli-0.4.3b2.tar.gz.
File metadata
- Download URL: oy_cli-0.4.3b2.tar.gz
- Upload date:
- Size: 66.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b166f36d10afea16c0861c6c189e2854e524588fa2add135f4ef2b5af5973cc1
|
|
| MD5 |
ba151ad93120ea76b9207907821ff999
|
|
| BLAKE2b-256 |
810f37e5b33fb015245610035a293e7179267d01f28836bfee8318f9d329feca
|
Provenance
The following attestation bundles were made for oy_cli-0.4.3b2.tar.gz:
Publisher:
release.yml on wagov-dtt/oy-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oy_cli-0.4.3b2.tar.gz -
Subject digest:
b166f36d10afea16c0861c6c189e2854e524588fa2add135f4ef2b5af5973cc1 - Sigstore transparency entry: 1187792406
- Sigstore integration time:
-
Permalink:
wagov-dtt/oy-cli@0fd063f31fef0b33d212ec7d545c0ca76ff0af67 -
Branch / Tag:
refs/tags/v0.4.3b2 - Owner: https://github.com/wagov-dtt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0fd063f31fef0b33d212ec7d545c0ca76ff0af67 -
Trigger Event:
release
-
Statement type:
File details
Details for the file oy_cli-0.4.3b2-py3-none-any.whl.
File metadata
- Download URL: oy_cli-0.4.3b2-py3-none-any.whl
- Upload date:
- Size: 61.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e591a80f50d06dd14d8840bc4a57e9a8062afb0bea5708904723471a2d791311
|
|
| MD5 |
595f7b0c3bfbf559de1a0d918dfefa2c
|
|
| BLAKE2b-256 |
59192bd067fbabba216b6509f7948b2820bafaa6021dcd9d628d74b2067bd8bd
|
Provenance
The following attestation bundles were made for oy_cli-0.4.3b2-py3-none-any.whl:
Publisher:
release.yml on wagov-dtt/oy-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oy_cli-0.4.3b2-py3-none-any.whl -
Subject digest:
e591a80f50d06dd14d8840bc4a57e9a8062afb0bea5708904723471a2d791311 - Sigstore transparency entry: 1187792442
- Sigstore integration time:
-
Permalink:
wagov-dtt/oy-cli@0fd063f31fef0b33d212ec7d545c0ca76ff0af67 -
Branch / Tag:
refs/tags/v0.4.3b2 - Owner: https://github.com/wagov-dtt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0fd063f31fef0b33d212ec7d545c0ca76ff0af67 -
Trigger Event:
release
-
Statement type: