Metadata-Version: 2.4
Name: askai-py
Version: 0.1.0
Summary: CLI for one-shot, stateless questions to an LLM.
Author: Peconi Federico
Author-email: Peconi Federico <fpswe@tuta.io>
License-Expression: MIT
License-File: LICENSE
Requires-Dist: platformdirs>=4.9.6
Requires-Dist: typer>=0.24.1
Requires-Python: >=3.12
Project-URL: Homepage, https://codeberg.org/peconif/askai
Project-URL: Repository, https://codeberg.org/peconif/askai
Project-URL: Issues, https://codeberg.org/peconif/askai/issues
Project-URL: GitHub Mirror, https://github.com/arbiter1elegantiae/askai
Description-Content-Type: text/markdown

# Askai

> Development happens on [Codeberg](https://codeberg.org/peconif/askai).
> GitHub is a read-only mirror for discovery — please open issues and pull requests on Codeberg.

CLI for one-shot, stateless questions to an LLM.

Meant for engineers living inside terminals, `askai` aims to fill those small information gaps that typically pop up while working, such as:
- commands syntax / flag names;
- tiny code examples;
- quick conceptual clarifications.
Instead of wasting time switching to a browser or a dedicated AI app, simply:
```bash
askai "What does set -euo pipefail do?"
```
will return a concise, fluff-free answer from your favorite model, minimizing distractions and speeding up your workflow.

## Installation

Install with [`pipx`](https://pypa.github.io/pipx/) (recommended):

```bash
pipx install askai-py
```

Or with [`uv`](https://docs.astral.sh/uv/):

```bash
uv tool install askai-py
```

Then set your Groq API key (Groq is the default backend):

```bash
export GROQ_API_KEY="your-key"
askai "How to rename a branch in Git?"
```

## Backends

askai supports two backends:

- **`groq`** (default) — API adapter calling Groq's OpenAI-compatible endpoint. Requires `GROQ_API_KEY`.
- **`codex`** — CLI adapter wrapping the Codex CLI. Requires a local Codex installation.

Switch backend:

```bash
askai config set backend codex
askai doctor
```

### Adding a Backend

Contributions for new backends are welcome. To add one, you need to:

1. Implement the `BackendAdapter` protocol in `src/askai/backends/`
2. Register it in `build_backend_adapters()` (`src/askai/backends/__init__.py`)
3. Add the backend name to `KNOWN_BACKENDS` (`src/askai/config.py`)
4. Add tests under `tests/`
5. Document it in `docs/CLI_CONTRACT.md`

## Corporate VPN / Proxy (Self-Signed Certificates)

If you are behind a corporate VPN or intercepting proxy, set `ASKAI_CA_BUNDLE` to your company's CA certificate so askai trusts the TLS connection:

```bash
export ASKAI_CA_BUNDLE=/path/to/company-ca.pem
askai "List Tmux useful commands"
```

This adds your CA as a trust root alongside the system defaults, so normal HTTPS still works.
