Skip to main content

A single CLI to connect with OpenAI, Ollama, and more AI providers.

Project description

Tasklin

Tasklin is a versatile Python CLI for leveraging multiple AI providers like OpenAI, Ollama, Anthropic (Claude), and more. It’s designed for developers and creators who want to integrate AI into their workflows, pipelines, or automation, without being limited to “chatting” with AI.

Use it to generate text, process data, or build AI-driven scripts, all directly from your terminal.

Features

  • Single CLI to interact with multiple AI providers
  • Supports OpenAI, Ollama, Anthropic(Claude), DeepSeek and more in the future
  • Returns structured responses with tokens used and execution time
  • Supports sync and async execution
  • Clean error handling for missing models, invalid API keys, etc.
  • Available on PyPI as tasklin

Installation

Clone the repo and install dependencies:

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

Or install directly from PyPI:

pip install tasklin

(Optional) Make the CLI globally executable:

pip install --editable .

Usage

Basic usage:

tasklin --type openai --prompt "Hello AI"

Run with async mode:

tasklin --type openai --prompt "Hello AI" --async-mode

Ollama example (with base URL):

tasklin --type ollama --base-url http://localhost:11434 --model codellama --prompt "Hello"

CLI Options

Option Description
--type AI provider type (openai, ollama)
--prompt Text prompt to send to the AI
--key API key for providers that require authentication
--model Model name to use (defaults vary per provider)
--base-url Base URL for self-hosted providers like Ollama
--async-mode Run asynchronously (flag, no value needed)

Response Structure

All responses are returned as a structured JSON object:

{
  "provider": "openai",
  "model": "gpt-4o-mini",
  "output": "Hello! How can I assist you today?",
  "raw": {...},
  "tokens_used": 17,
  "duration_ms": 543
}

Contributing

We welcome contributions!

  • Add support for new AI providers
  • Improve error handling
  • Enhance async execution and CLI experience

Please fork the repo and submit a pull request.


License

MIT License. Free to use and modify.


PyPI

tasklin is published on PyPI. Install via:

pip install tasklin

Stay up to date with the latest releases and check the package page: https://pypi.org/project/tasklin/

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

tasklin-0.0.2.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

tasklin-0.0.2-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file tasklin-0.0.2.tar.gz.

File metadata

  • Download URL: tasklin-0.0.2.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tasklin-0.0.2.tar.gz
Algorithm Hash digest
SHA256 925b9a468c74786486610c3acdc155935634ba972cfefa46436ebe73d4de723d
MD5 a75a6e8d635d3767bf6acf2b176c3401
BLAKE2b-256 fc513de6159213700c6e3d4f8b70a86c41239078738c4d8906a5d62848b18306

See more details on using hashes here.

File details

Details for the file tasklin-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: tasklin-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tasklin-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 097524ce58eb46a2f46d21b566a3cde6fa3b62bbaf85302a83a01d9841138969
MD5 0df9c8d1cb642d60f40eb6bd0c86009a
BLAKE2b-256 5b140caf6875542183de9e2638080629fce7b5f40e22d4807d2c509f01ff2e9e

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