Skip to main content

Tiny local coding CLI with a small tool surface

Project description

oy-cli

Tiny local coding CLI for simple shell interactive code editing and auditing.

oy is intentionally small:

  • one-shot Typer CLI, not a full TUI
  • decent progress output, not advanced orchestration
  • one main code file as the implementation target
  • intentionally small and auditable

The point is to keep the tool surface boring, explicit, and easy to audit (most existing tools and agents are large/complex or locked to specific providers).

Design Notes

  • follow OWASP-minded secure defaults
  • prefer the grugbrain.dev philosophy: simple, direct, low-magic solutions
  • run inside a locked-down container with limited filesystem, process, and network permissions if you want to use it safely
  • de-scope advanced surfaces like todos, skills, and MCPs (bash is fine, most tools have good CLI interfaces)

Tool Surface

Initial tools:

  • write: create new files with pathlib
  • edit: modify existing files with pathlib read/write
  • patch: apply unified diffs with patch (via subprocess)
  • list: list directory contents with pathlib
  • read: read files with pathlib
  • grep: search text with subprocess + ripgrep
  • glob: find files and directories with pathlib.glob
  • bash: run shell commands with subprocess via bash -lc as a last resort
  • webfetch: fetch web content with httpx

That is enough for useful local coding work and security audits.

Known Issues

Some LLMs occasionally emit duplicated tool call arguments. oy includes a workaround that detects and recovers from this by hunting for valid JSON around the midpoint of the malformed response.

Requirements

  • Python 3.14+
  • bash
  • patch
  • OPENAI_API_KEY in the environment, OR AWS credentials for automatic Bedrock setup

ripgrep is included as a PyPI dependency. If AWS credentials are available (via AWS_PROFILE, AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY, or ~/.aws/credentials), oy will automatically generate Bedrock tokens. If bash, rg, or patch are missing, oy exits with install guidance instead of silently falling back.

Installation

Preferred:

uv tool install oy-cli

Alternative:

pip install oy-cli

This installs the oy command.

Quick Start using AWS Bedrock (automatic)

If you have AWS credentials configured (via AWS_PROFILE, environment variables, or ~/.aws/credentials), Bedrock is automatically configured:

oy models
oy model moonshotai.kimi-k2.5
oy "inspect this repository and suggest the smallest safe fix"

To manually export Bedrock tokens (for use in other tools or scripts):

eval "$(oy bedrock-token)"

oy models uses the OpenAI SDK with client.models.list(). oy model <id> saves your default model.

With OpenAI-compatible manual creds:

export OPENAI_BASE_URL=https://your-endpoint.example/v1
export OPENAI_API_KEY=...
oy "summarize this project and list the next changes"

With OpenAI's default API endpoint:

export OPENAI_API_KEY=...
oy "summarize this project and list the next changes"

Runtime Behavior

  • simple CLI flow, no REPL and no TUI
  • simple commands: oy "...", oy bedrock-token, oy models, oy model <id>
  • model chooses from a small set of local tools
  • file operations are scoped to the working directory
  • required tools are checked up front
  • indeterminate progress is shown while waiting on API calls
  • default model/tool budgets are intentionally high for longer build-style runs

Model Selection

oy model
oy models
oy model moonshotai.kimi-k2.5

Security

oy can run shell commands and modify files. Treat it like an automation tool with real permissions.

Recommended posture:

  • run it in a container or similarly constrained environment
  • mount only the project/dirs you want it to touch
  • avoid broad host access
  • do not expose secrets you do not want shell commands to inherit

Contributing

Development and release notes live in CONTRIBUTING.md.

License

Licensed under the Apache License 2.0. See LICENSE.

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.1.1.tar.gz (18.0 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.1.1-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file oy_cli-0.1.1.tar.gz.

File metadata

  • Download URL: oy_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 18.0 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.1.1.tar.gz
Algorithm Hash digest
SHA256 7684b4b5310f5ccc1b8af2557b7d63a2dac1d9d31072f27710b2d8d28bb87e8a
MD5 5eabe41fa427078d0916bb003d22be10
BLAKE2b-256 b0ad3f3d4eef9d4cf9b2ec93c7830e1e32b9f95e255b0253d51f6d8119ab58a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for oy_cli-0.1.1.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.1.1-py3-none-any.whl.

File metadata

  • Download URL: oy_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.5 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 92c2d924bbeb69dfe54757d96d7e1d76a3bea6c7cc4fbca8db4296a5bf575abc
MD5 19cc8d60f50c4112e89e634977ecd911
BLAKE2b-256 05d86086d768d9f2aa2a03b1b2649dc5653926ce6958762a1d77602a2a63458a

See more details on using hashes here.

Provenance

The following attestation bundles were made for oy_cli-0.1.1-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