Skip to main content

Tiny local coding CLI with a small tool surface

Project description

oy-cli

PyPI

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 /ask suffix
  • transcript compaction text (Current todo list, omitted-history note, 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

License

Apache License 2.0

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

oy_cli-0.4.3b0.tar.gz (71.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oy_cli-0.4.3b0-py3-none-any.whl (58.6 kB view details)

Uploaded Python 3

File details

Details for the file oy_cli-0.4.3b0.tar.gz.

File metadata

  • Download URL: oy_cli-0.4.3b0.tar.gz
  • Upload date:
  • Size: 71.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for oy_cli-0.4.3b0.tar.gz
Algorithm Hash digest
SHA256 da9a3595c29975d4bd34ef8640715bb3666ce6fbeb21f907ac4ccade3394f813
MD5 b704c8a6b7f2b7c2bb5098c4d939ea30
BLAKE2b-256 7be341db71d6d58f9e177ff6beb79a5f80a7df6c835d295ad4e750e0af220255

See more details on using hashes here.

Provenance

The following attestation bundles were made for oy_cli-0.4.3b0.tar.gz:

Publisher: release.yml on wagov-dtt/oy-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file oy_cli-0.4.3b0-py3-none-any.whl.

File metadata

  • Download URL: oy_cli-0.4.3b0-py3-none-any.whl
  • Upload date:
  • Size: 58.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for oy_cli-0.4.3b0-py3-none-any.whl
Algorithm Hash digest
SHA256 36b8c525809f18679aa518976c93f6323ea7d0ede0fb0e5c4edb1f0d52368314
MD5 82f506e2211c30ee284ffced58bee19b
BLAKE2b-256 0a77027fe3ad10aae3c925b823e4d6a9746dd3a3779488e85748c233bc8650ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for oy_cli-0.4.3b0-py3-none-any.whl:

Publisher: release.yml on wagov-dtt/oy-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page