Metadata-Version: 2.4
Name: tasklin
Version: 0.0.3
Summary: A single CLI to connect with OpenAI, Ollama, and more AI providers.
Author-email: jetroni <jetronsaiti@gmail.com>, FehmiHavziu <femi.havziu123@gmail.com>
License: MIT License
        
        Copyright (c) 2025 jetroni, Femi3211
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        Additional Clause:
        This software may not be used for commercial purposes without explicit written permission from the authors.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer>=0.9
Requires-Dist: click>=8.1
Requires-Dist: rich>=13.0
Requires-Dist: openai>=1.0.0
Requires-Dist: anthropic>=0.64.0
Requires-Dist: pydantic>=1.10.22
Dynamic: license-file

# Tasklin

![PyPI](https://img.shields.io/pypi/v/tasklin)
![Python Version](https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2Fjetroni%2Ftasklin%2Frefs%2Fheads%2Fmaster%2Fpyproject.toml&query=%24.project.requires-python&label=python)
![License](https://img.shields.io/badge/license-MIT-blue)
![Build](https://img.shields.io/github/actions/workflow/status/jetroni/tasklin/publish.yml)

Tasklin is a Python CLI for integrating multiple AI providers into scripts, pipelines, or automation workflows. It’s built for developers who want structured AI outputs for tasks, processing, or data generation, without being limited to interactive chat.

Website: [https://tasklin.dev](https://tasklin.dev)

---

## Features

* Single CLI for multiple AI providers
* Supports **OpenAI**, **Ollama**, **Anthropic (Claude)**, **DeepSeek**, and more
* Returns structured responses including tokens used and execution time
* Supports **sync** and **async** execution
* Clean error handling for missing models, invalid API keys, etc.
* Cross-platform
* Installable from **PyPI** as `tasklin`

---

## Installation

Clone the repo and install dependencies:

```bash
git clone https://github.com/jetroni/tasklin.git
cd tasklin
python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -r requirements.txt
```

Or install directly from PyPI:

```bash
pip install tasklin
```

(Optional) Make the CLI globally executable:

```bash
pip install --editable .
```

---

## Usage

Basic example:

```bash
tasklin "Generate a report from this data" --type openai --key MY_KEY
```

Ollama example (self-hosted):

```bash
tasklin "Run analysis" --type ollama --base-url http://localhost:11434 --model codellama
```

> ⚠️ Async mode is planned but not implemented yet.

---

## CLI Options

| Option         | Description                                    |
|----------------|------------------------------------------------|
| `--type`       | AI provider type (openai, ollama, etc.)        |
| `--key`        | API key for authenticated providers            |
| `--model`      | Model name (default varies per provider)       |
| `--base-url`   | Base URL for self-hosted providers             |
| `--async-mode` | Run asynchronously (flag, no value needed)     |
| `"prompt"`     | Your actual input/prompt (positional argument) |

---

## Response Structure

All responses are returned as a structured JSON object:

```json
{
  "provider": "openai",
  "model": "gpt-4o-mini",
  "output": "Task output here",
  "raw": {...},
  "tokens_used": 17,
  "duration_ms": 543
}
```

---

## Contributing

Contributions are welcome:

* Add new AI providers
* Improve error handling
* Enhance async execution and CLI experience

Fork the repo and submit a pull request.

---

## PyPI

Install via:

```bash
pip install tasklin
```

Latest releases: [https://pypi.org/project/tasklin/](https://pypi.org/project/tasklin/)

