Metadata-Version: 2.4
Name: asksh
Version: 0.2.0
Summary: AI-powered CLI tool that converts natural language into Linux shell commands.
Keywords: ollama,shell,cli,llm,posix
Author: Sergi Soler i Segura
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Utilities
License-File: LICENSE
Requires-Dist: requests>=2.32.5
Requires-Dist: rich>=15.0.0
Requires-Dist: tomli>=2.0.1; python_version < '3.11'
Project-URL: Homepage, https://github.com/srgsol/asksh
Project-URL: Issues, https://github.com/srgsol/asksh/issues
Project-URL: Repository, https://github.com/srgsol/asksh

# asksh

> AI in your terminal: turn plain English into shell commands.

`asksh` is an AI-powered command-line tool that lets you describe what you want in plain English and returns the exact POSIX shell command to run.

You don't need to leave your terminal to get things done. Don't you remember the exact command to compress a directory with `tar`? Just `asksh`.

```bash
$ asksh compress a directory with tar.gz excluding the .cache directory
> tar -czf archive.tar.gz --exclude=<dir>.cache <dir>
```

## Installation

### Ollama server

`asksh` expects an **Ollama** server. [Install Ollama](https://ollama.com/download), then pull a model (defaults match `config.example.toml`):

```bash
ollama pull qwen2.5-coder
```

### Install the CLI

**From PyPI** (once published):

```bash
pip install asksh
# or: uv tool install asksh
```

**From a clone** (development):

```bash
git clone git@github.com:srgsol/asksh.git
cd asksh
uv sync
uv run asksh --help
```

Requires **Python 3.10+**.

### Configuration (optional defaults)

Defaults can live in a TOML file so you do not repeat `--model` / `--base-url` on every run. CLI flags always override the file.

- **Default path:** `$XDG_CONFIG_HOME/asksh/config.toml`, or `~/.config/asksh/config.toml` if `XDG_CONFIG_HOME` is unset.
- **Override path:** set `ASKSH_CONFIG` to another file.

See `config.example.toml` in this repository for supported keys (`model`, `base_url`, `system`, `context`, `interactive_on_no_args`).

## Publishing to PyPI (maintainers)

This project uses [flit](https://flit.pypa.io/) as the build backend. With `flit` installed and PyPI credentials configured:

```bash
uv build
# inspect dist/ then:
flit publish
```

Use [trusted publishing](https://docs.pypi.org/trusted-publishers/) (e.g. GitHub Actions) for releases when possible.

