Metadata-Version: 2.4
Name: shell-ask
Version: 0.2.1
Summary: Plain English in, Linux command out: confirm, run, interpret, powered by a local or remote LLM.
Author: Solomon Berhe
License-Expression: MIT
Project-URL: Homepage, https://se4cps.github.io/lab/comp-175/
Keywords: ollama,llm,cli,linux,shell,teaching
Classifier: Environment :: Console
Classifier: Intended Audience :: Education
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: System :: Shells
Classifier: Topic :: Education
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# ask-cli

Plain English in, Linux command out: confirm, run, interpret. Works with a
local model (via [Ollama](https://ollama.com)) or a remote one (Groq,
OpenAI, Anthropic) — you choose. Python packaging of the original `ask.sh`
used in COMP-175 (System Admin & Security), Module 15 (AI in the Terminal).

## Install

```bash
pip install .
```

This installs an `ask` command on your PATH.

## Choosing a provider

```bash
ask --list-providers
```

```
supported providers:
  ollama     Ollama (local)   default model: llama3.2:3b  (local, no key)
  groq       Groq (remote)    default model: llama-3.1-8b-instant  (needs $GROQ_API_KEY)
  openai     OpenAI (remote)  default model: gpt-4o-mini  (needs $OPENAI_API_KEY)
  anthropic  Anthropic (remote) default model: claude-haiku-5-5  (needs $ANTHROPIC_API_KEY)
```

Default is `ollama` (fully local, no API key, no data leaves your machine).
Pick a remote one with `--provider` (or set `$ASK_PROVIDER` so you don't have
to repeat it), and `--model` (or `$ASK_MODEL`) to override the default model
for that provider.

### Local (default) — Ollama

```bash
curl -fsSL https://ollama.com/install.sh | sh
ollama pull llama3.2:3b
ask how much disk space is free
```

### Remote — Groq, OpenAI, or Anthropic

```bash
export GROQ_API_KEY=gsk_...
ask --provider groq how much disk space is free

export OPENAI_API_KEY=sk-...
ask --provider openai --model gpt-4o-mini who am I logged in as

export ANTHROPIC_API_KEY=sk-ant-...
ask --provider anthropic show hidden files too
```

## Usage

```bash
ask how much disk space is free
ask show hidden files too
ask who am I logged in as
```

The tool asks the chosen model to translate your request into one Linux
command plus a short explanation, flags anything destructive (`rm`, `dd`,
`mkfs`, `shutdown`, `reboot`), asks for confirmation before running it, then
asks the model to interpret the command's output in plain English.

## Development

```bash
pip install -e .
ask how much disk space is free
```
