Skip to main content

AI-powered engineering assistant embedded directly in your Python projects.

Project description

vibewithai

The intelligent developer SDK for Python.

AI that performs engineering tasks — not a chat wrapper.

PyPI Python License Tests Coverage Typed Ruff


import vibewithai

vibewithai.login("sk-proj-...", "AIza...", "sk-ant-...")   # any keys, any order

result = vibewithai.check()

print(result.score)      # 87
print(result.summary)    # "3 issues found across 12 files (1 at or above high)."

You describe an engineering task. The SDK handles provider selection, context building, token budgeting, retries, and failover.


Why vibewithai

Most AI coding tools are a prompt box with a system message. This is a working SDK with an opinion about how AI should be used on real codebases.

Static analysis runs first AST, Ruff, Bandit and Radon execute locally before any model call. Most questions are answered deterministically, for free. The model is reserved for reasoning that tools genuinely cannot do.
You never name a provider Pass whatever API keys you have. Each is matched to its provider by key shape, verified with a live health check, and the first working one becomes active.
Failover is automatic Rate limited, over quota, or a 5xx? The SDK switches to your next verified provider mid-request. A bad credential never triggers a switch — that would hide a real misconfiguration.
Structured results, not prose Every command returns a CommandResult with a score, typed findings, metrics and token accounting. The CLI is just one renderer.
Nothing runs, nothing is overwritten Generated code is returned as data and never executed. Files are never modified without explicit opt-in, and originals are backed up.
~2 ms import Lazy attribute resolution means the SDK is usable inside pre-commit hooks and editor plugins. A test fails the build if import exceeds 100 ms.

Installation

pip install vibewithai                      # core
pip install "vibewithai[analysis]"          # + Ruff, Bandit, Radon, LibCST  (recommended)

Requires Python 3.11+. Tested on 3.11–3.13 across Linux, macOS and Windows.

Runtime dependencies are deliberately minimal: httpx, platformdirs, rich, typer. No vendor SDKs — all 16 providers are reached over plain HTTP.


Quick start

1. Authenticate

import vibewithai

vibewithai.login(
    "sk-proj-xxxxxxxx",   # OpenAI
    "AIzaSyxxxxxxxx",     # Google Gemini
    "xai-xxxxxxxx",       # xAI Grok
    "sk-ant-xxxxxxxx",    # Anthropic
)

Or keep keys out of your code entirely:

export VIBEWITHAI_OPENAI_API_KEY=sk-proj-...
export ANTHROPIC_API_KEY=sk-ant-...          # conventional vendor variables work too
vibewithai.login()    # environment → stored credentials → local Ollama

Guided terminal setup:

vibewithai init

2. Run a task

result = vibewithai.review("src/app.py")

for finding in result.findings_at_or_above(vibewithai.Severity.HIGH):
    print(f"{finding.location}  [{finding.severity}]  {finding.title}")
    print(f"    {finding.detail}")
    print(f"    via {finding.source} (confidence {finding.confidence})")

finding.source tells you whether a result came from a deterministic tool ("ruff", "bandit") or a model ("ai:openai"), so you always know how much to trust it.

3. Gate on it

result = vibewithai.security()

if not result:                 # falsy only when the tool itself errored
    raise SystemExit(2)
if not result.passed:          # False when blocking findings exist
    raise SystemExit(result.exit_code)

The API

Nineteen commands, grouped by intent. Every one returns a CommandResult.

Understand

vibewithai.check()                    # full quality assessment, scored 0–100
vibewithai.review("src/app.py")       # pull-request style review
vibewithai.explain("src/auth.py")     # what it does and why
vibewithai.ask("Why is login failing?")
vibewithai.chat("How should I structure this service?")

Improve

vibewithai.fix("src/app.py")          # propose corrections
vibewithai.refactor("src/app.py")     # restructure, behaviour preserved
vibewithai.optimize()                 # find real performance problems
vibewithai.comment("src/app.py")      # docstrings where they are missing

Secure and ship

vibewithai.security()                 # vulnerability audit with exploitability reasoning
vibewithai.deploy()                   # production-readiness assessment
vibewithai.debug("KeyError: user_id", traceback=tb)

Create

vibewithai.test("src/app.py")         # generate pytest tests
vibewithai.document()                 # API reference
vibewithai.readme()                   # project README
vibewithai.generate("a FastAPI CRUD API for users")
vibewithai.coverage()                 # measure via pytest --cov

Version control

vibewithai.commit()                   # Conventional Commits message from staged diff
vibewithai.changelog(since="v1.2.0")  # Keep a Changelog entry

Commands that produce files write nothing unless you pass apply=True:

result = vibewithai.fix("src/app.py")
print(result.artifacts["src/app.py"])          # review first
vibewithai.fix("src/app.py", apply=True)       # then apply; original is backed up

Command line

vibewithai                            # welcome screen with detected environment
vibewithai init                       # guided setup
vibewithai doctor                     # diagnose the installation
vibewithai tutorial                   # learn the commands in five minutes

vibewithai check                      # exits 1 on findings at or above `high`
vibewithai review src/app.py
vibewithai security --fail-on medium
vibewithai fix src/app.py --yes

vibewithai check --format json        # machine-readable
vibewithai check --format html > report.html
vibewithai check --changed-only       # only files changed from HEAD

Exit codes: 0 clean · 1 findings at or above the threshold · 2 execution error.


Result objects

result = vibewithai.check()

result.score              # 0–100 quality score
result.status             # Status.WARNING
result.summary            # human-readable paragraph
result.findings           # list[Finding] — severity, location, source, confidence
result.suggestions        # list[Suggestion] — title, rationale, effort
result.metrics            # files, lines, complexity, cache hit rate
result.usage              # prompt/completion/cached token accounting
result.provider           # "openai"
result.execution_time     # seconds

result.passed             # quality gate
result.exit_code          # POSIX exit code
result.counts_by_severity # {'critical': 0, 'high': 1, ...}
result.findings_at_or_above(vibewithai.Severity.HIGH)

result.to_dict()          # JSON-serialisable, safe to log
result.to_json()

Render to any format:

from vibewithai.reports import render

open("report.html", "w").write(render(result, "html"))
open("report.md", "w").write(render(result, "markdown"))

Supported providers

All 16 work with an API key alone — no vendor SDKs, no extra dependencies.

Category Providers
Frontier OpenAI · Anthropic Claude · Google Gemini · xAI Grok
Aggregators OpenRouter · Together AI · Fireworks AI · Hugging Face · GitHub Models
Direct DeepSeek · Mistral AI · Cohere · Groq · Perplexity
Enterprise Azure OpenAI
Local Ollama — no key required

Provider selection, key detection and failover are entirely automatic. Adding a new OpenAI-compatible provider is a single entry in providers/specs.py.

Not yet supported: AWS Bedrock, Google Vertex AI and OCI Generative AI require cloud-native request signing (SigV4, service-account JWTs) rather than bearer tokens. Reach those models through OpenRouter or an OpenAI-compatible gateway in the meantime.


Configuration

Layered, highest precedence first: call arguments → environment → project file → user file → defaults.

# vibewithai.toml
default_provider   = "openai"        # omit to use the first verified provider
offline            = false           # true = local static analysis only
max_context_tokens = 12000

[providers.openai]
model = "gpt-4o-mini"

[analysis]
analyzers         = ["ast", "ruff", "bandit", "radon"]
blocking_severity = "high"
exclude           = [".venv", "node_modules", "*_pb2.py"]

[auth]
fallback        = true               # switch providers on rate limits and outages
preferred_order = ["anthropic", "openai"]

[cache]
enabled = true
ttl     = 86400

Credentials are never read from project files — only from environment variables and the user-level credential store — so a key cannot be committed by accident. Full reference: docs/configuration.md.


Enterprise considerations

Security

  • Credentials never leak. API keys are wrapped in a Secret type that masks itself in str(), repr(), f-strings, and refuses to pickle. Independently, a logging filter scrubs credential-shaped text from every record before emission.
  • Nothing is written without consent. Commands that modify the workspace raise ConfirmationRequiredError unless explicitly authorised; originals are backed up; writes outside the project root are refused; every write is atomic.
  • AI output is never executed. Not eval-ed, not exec-ed, not imported.
  • Owner-only credential storage0600 file inside a 0700 directory, with a warning if permissions loosen.
  • Full threat model: SECURITY.md.

Data governance

Any AI command sends a bounded, relevant slice of your code — the file in question plus its direct collaborators — never the whole repository. For codebases that must not leave your network:

offline = true    # local static analysis only; zero network calls

Or run entirely on local models via Ollama.

CI/CD

- run: pip install "vibewithai[analysis]"
- run: vibewithai check --fail-on high --format json > report.json
  env:
    VIBEWITHAI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

Ready-made configurations for GitHub Actions, GitLab CI, Jenkins and Azure DevOps.

Performance

Analysis results are cached against file content digests, so unchanged files are never re-analysed and never re-sent to a model. Independent files are analysed in parallel. Repeat runs on a large repository complete in milliseconds.

Extensibility

from vibewithai.plugins import register

register(provider=my_provider_spec)     # add a provider
register(analyzer=MyAnalyzer())         # add a static check
register(reporter=("sarif", to_sarif))  # add an output format

Plugins are also discovered automatically through the vibewithai.plugins entry-point group.


Documentation

Guide
Installation Platforms, extras, verification
Quick start First run, walkthrough
Configuration Every setting and environment variable
API reference Complete public surface
Architecture Layering and design decisions
Developer guide Adding providers and analyzers
Best practices Getting good results
Troubleshooting Common failures and fixes
FAQ

Project health

Tests 798 passing
Coverage 89%
Type checking mypy --strict, clean
Linting Ruff + Black, clean
Security scan Bandit, clean
Import time ~2 ms
Runtime dependencies 4

Status

0.1.0 — first release. The full pipeline is implemented and tested end to end.

As a first release, the AI-backed commands have had far more automated testing than real-world mileage. Treat their output as a capable reviewer's opinion rather than ground truth — which is exactly why every finding carries a confidence score and a source. Deterministic static analysis is unaffected by this caveat.

Issues and feedback: github.com/ragulraj-d/vibewithai/issues


Contributing

Contributions are welcome — see CONTRIBUTING.md and the Code of Conduct. To report a vulnerability, follow SECURITY.md rather than opening a public issue.

License

MIT

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

vibewithai-0.1.1.tar.gz (212.2 kB view details)

Uploaded Source

Built Distribution

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

vibewithai-0.1.1-py3-none-any.whl (172.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vibewithai-0.1.1.tar.gz
  • Upload date:
  • Size: 212.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for vibewithai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e404f8b1860ec48b81eacd37e0639d15c1d03b63fd15f3456b136ddf39b31a8c
MD5 5f7466ea8a814262c2de8e174e41ab8c
BLAKE2b-256 0ed6237372722e6864c48041f2f5af60dcbc0487e31504334ff26971239375ab

See more details on using hashes here.

File details

Details for the file vibewithai-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: vibewithai-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 172.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for vibewithai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6b0cbfd6ef3df85e940e23be3496f11fc8b3b50d45555aa11ac9288a47e3714e
MD5 7e4548f5ee47a13b235d7d51225fec25
BLAKE2b-256 4777828570b44d9c8e763f6440d10a9550d99ca1f4b98176a02a5f0c539aed1a

See more details on using hashes here.

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