Metadata-Version: 2.4
Name: cmdify
Version: 0.3.1
Summary: Cmdify - A tool to translate natural language to shell commands using LLMs
Project-URL: Homepage, https://github.com/jonte/cmdify
Project-URL: Issues, https://github.com/jonte/cmdify/issues
Author-email: Jonte <jonte@example.com>
License: MIT License
        
        Copyright (c) 2024 Jonte
        
        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.
        
        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.
License-File: LICENSE
Requires-Python: >=3.9
Requires-Dist: litellm
Requires-Dist: pyperclip
Description-Content-Type: text/markdown

# cmdify

Cmdify - A tool to translate natural language to shell commands using LLMs.

## Installation

```bash
pip install cmdify
```

## Usage

You can use `cmdify` (or the short alias `ctr` if installed):

```bash
cmdify "Remove everything under the directory foo/"
# or
ctr "Remove everything under the directory foo/"
```

The command will be printed to the console and copied to your clipboard.

## Configuration

Set your OpenAI API key:
```bash
export OPENAI_API_KEY=sk-...
```

Or configure a local endpoint (e.g., vLLM, LMStudio). You can set this via the command line:

```bash
cmdify --set-config -local_endpoint=http://127.0.0.1:1234/v1 -model=openai/qwen3-30b-a3b
```

To see all available configuration options, run:

```bash
cmdify --set-config -h
```

Common options:
*   `local_endpoint`: URL for your local LLM server.
*   `model`: Model name to use.
*   `command_history`: Number of recent shell commands to include in context (default: 3).
*   `prefer-local`: If set to `true`, forces use of the local endpoint even if `OPENAI_API_KEY` is set.

Example of setting command history size:
```bash
cmdify --set-config -command_history=5
```

Alternatively, you can manually edit `~/.cmdify_config.json`:
```json
{
  "local_endpoint": "http://localhost:8000/v1",
  "model": "hosted_vllm/...",
  "command_history": 5
}
```
