Skip to content

Repository files navigation

Promptix v0.1.0

Promptix is a command-line assistant that converts natural-language instructions into shell commands using OpenAI's gpt-4o-mini model, then asks for confirmation before executing them.

Instead of remembering exact shell syntax, you type what you want to do in plain English, Promptix translates it into a shell command, shows it to you, and executes it only after you confirm.

Features

  • Natural language to shell command: sends your input (plus any accumulated context) to OpenAI's gpt-4o-mini and runs the returned command via subprocess.
  • Context stack: build up multi-step context before issuing a command.
    • Ctrl+N, push the current input onto the context stack
    • Ctrl+B, pop the last context entry
    • Ctrl+O, open the in-app configuration menu
    • Ctrl+C, exit
  • Command confirmation: every generated command is shown and must be confirmed (Y/n) before it runs.
  • Encrypted token storage: your OpenAI API token is encrypted at rest with cryptography (PBKDF2-HMAC key derivation + Fernet), stored under ~/.promptix/token.enc, and protected by a master password you set on first run.
  • In-app configuration menu (via Ctrl+O): change the master password, change the stored token, toggle "remember password" for the session, or delete all stored data.

How it works

On first run, Promptix asks you to set a master password and enter your OpenAI API token; the token is encrypted and saved to ~/.promptix/token.enc. On subsequent runs it prompts for the master password to decrypt the token (unless "remember password" caching is enabled, which caches it in ~/.promptix/password_cache).

Each prompt you type is sent (along with any active context) to OpenAI's chat completions API, which is instructed to return only a single shell command. That command is displayed and executed via subprocess.run only after you confirm.

Installation

Install directly from GitHub:

pip install git+https://github.com/brayandm/promptix

Run it with:

promptix

Development setup

  1. Install pyenv and pipenv.
  2. Install Python 3.12:
    pyenv install
  3. Set the local Python version:
    pyenv local
  4. Install dependencies:
    PIPENV_VENV_IN_PROJECT=1 pipenv install --dev
  5. Install pre-commit hooks:
    pipenv run pre-commit install
  6. Install the package in editable mode:
    pip install -e .
  7. Run the application:
    promptix

Tech stack

Tooling configured in the repo: black, isort, mypy (strict mode), flake8, and pre-commit.

Status

This is an early-stage (v0.1.0) personal/experimental project, expect a small, evolving codebase (currently a single main.py module) rather than a mature, fully documented tool.

About

A CLI that turns natural-language instructions into shell commands using LLMs, with encrypted local storage for your LLM token

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages