Skip to main content

AI-powered natural language → terminal command converter

Project description

Yoki CLI — AI-Powered Terminal Tool

Yoki is a powerful CLI tool that allows you to run AI-powered commands directly from your terminal. It connects to Gemini / OpenAI API to generate code, scripts, or automate tasks, providing a smart terminal experience.

⚠️ Note: Yoki is online only. It requires an internet connection and a valid API key.


Features

  • 💡 Generate code, scripts, or automation tasks via terminal.
  • 🌐 Fully online, powered by Gemini / OpenAI API.
  • 🖥️ Works on Windows, Linux, and Mac.
  • 🛠️ Modular design—easily add new commands.
  • 📦 Simple installation and environment setup.

Table of Contents

  1. Prerequisites
  2. Installation
  3. Environment Setup
  4. Running Yoki
  5. Commands
  6. Adding New Commands
  7. Contributing
  8. Folder Structure
  9. Troubleshooting
  10. License

Prerequisites

  • Python 3.10+
  • Git installed
  • Internet connection
  • OpenAI or Gemini API key

Check Python version:

python --version

Check Git version:

git --version

Installation

Step 1: Clone the Repository

git clone https://github.com/onipinaka/yoki.git
cd yoki

Step 2: Create a Python Virtual Environment

Linux / Mac:

python3 -m venv venv
source venv/bin/activate

Windows (PowerShell):

python -m venv venv
.\venv\Scripts\Activate.ps1

Step 3: Install Dependencies

Upgrade pip first:

pip install --upgrade pip

Install dependencies:

pip install -r requirements.txt

requirements.txt should include:

openai>=1.8.0
requests>=2.31.0
click>=8.1.7
rich>=13.5.2
python-dotenv>=1.0.0
tabulate>=0.9.0
aiohttp>=3.9.0

Environment Setup

Step 4: Configure API Key

  1. Create a .env file in the root directory:
OPENAI_API_KEY=your_openai_api_key_here
  1. Load the API key in Python:
from dotenv import load_dotenv
import os

load_dotenv()
api_key = os.getenv("OPENAI_API_KEY")

This ensures your API key is secure and not hardcoded.


Running Yoki CLI

Run the CLI:

python yoki.py

Running Commands

You can run AI commands directly:

yoki "generate a Python script to read CSV files"
yoki "summarize this text"
yoki "translate this text to French"
  • Commands are interpreted and executed online using Gemini / OpenAI.
  • You must have a valid API key in .env.

Available Commands

Command Description
help Lists all available commands
list Shows all registered commands
generate AI-generated scripts or code
summarize Summarize text input
translate Translate text to another language
example Example command to test functionality

Commands can accept flags:

yoki "generate --lang python --task read_csv"
yoki "translate --lang French 'Hello World'"

Adding New Commands

  1. Go to the commands/ folder.
  2. Create a Python file, e.g., my_command.py.
  3. Add a function named run(args):
def run(args):
    print("Hello from my new command!", args)
  1. Import and register your command in commands/__init__.py.
  2. Run it via CLI:
yoki "my_command arg1 arg2"

Contributing

  1. Fork the repository.
  2. Create a new branch:
git checkout -b feature/my-new-command
  1. Add new commands under commands/.
  2. Update README.md if needed.
  3. Test your command:
python yoki.py "my-new-command test"
  1. Commit your changes:
git add .
git commit -m "Add my new command"
git push origin feature/my-new-command
  1. Open a Pull Request.

Follow PEP8 style and ensure your code works with the online API.


Folder Structure

yoki/
│
├── yoki.py             # Main CLI entry point
├── commands/           # Built-in commands
│   ├── __init__.py     # Imports and registers commands
│   └── example.py      # Example command
├── requirements.txt    # Python dependencies
├── README.md           # This file
└── .env                # OpenAI API key

Troubleshooting

  • Command not found: Make sure your command is registered in commands/__init__.py.
  • API key errors: Check .env file and ensure key is valid.
  • No internet connection: Yoki requires online mode; AI commands won't work offline.
  • Dependency errors: Run pip install -r requirements.txt again.

License

MIT License © 2025 [Your Name]


Notes

  • Designed for developers and AI enthusiasts.
  • Fully online; works with Gemini / OpenAI API.
  • Modular, easy to extend, and beginner-friendly.
  • Cross-platform support for Windows, Linux, and Mac.

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

yoki_terminal-1.0.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

yoki_terminal-1.0.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file yoki_terminal-1.0.0.tar.gz.

File metadata

  • Download URL: yoki_terminal-1.0.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for yoki_terminal-1.0.0.tar.gz
Algorithm Hash digest
SHA256 651b33970de24a78f497338819cb067d9c48f0ad7bac7fa3189b0dd88250687c
MD5 09ec1befc399289f9d1fc0c4ea8c5959
BLAKE2b-256 b98ded9cd7c3214c1636dfb06571a2110f8384a569f1a7eaeb7b9be28d66514a

See more details on using hashes here.

File details

Details for the file yoki_terminal-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: yoki_terminal-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for yoki_terminal-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 866ba3ea7cbc6cf89c67257a7454071cf1ca31dc9b684211141fc1b5ea5979b6
MD5 85b3c2e588da2b7677dceaa3b50069d5
BLAKE2b-256 f8d5397a98a65f6824e3a49a35f98852829c3a43fd9f1ab5f70d0dd58a66712e

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