Metadata-Version: 2.4
Name: linaix
Version: 0.1.4
Summary: Cross-platform command generator from natural language (Linux/macOS/Windows)
Home-page: https://github.com/AdirAli/linaix
Author: Adir Ali Yerima
Maintainer: Adir Ali Yerima
License: MIT
Project-URL: Homepage, https://github.com/AdirAli/linaix
Project-URL: Repository, https://github.com/AdirAli/linaix
Project-URL: Documentation, https://github.com/AdirAli/linaix#readme
Project-URL: Bug Tracker, https://github.com/AdirAli/linaix/issues
Keywords: terminal,linux,nlp,cli
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: license
Requires-Dist: google-genai>=1.0.0
Requires-Dist: openai>=1.0.0
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: pytest-cov>=2.0; extra == "dev"
Requires-Dist: black>=21.0; extra == "dev"
Requires-Dist: flake8>=3.8; extra == "dev"
Requires-Dist: mypy>=0.800; extra == "dev"
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# LinAIx

> Simple, safe, cross-platform command generation from natural language

Describe what you want in plain English — LinAIx generates the appropriate shell command for your OS and runs it after confirmation.

---

## 🚀 Installation

```bash
pip install linaix
```

## ⚙️ Setup

Choose a provider and configure your API key:

```bash
# Google Gemini
linaix --set-google-key YOUR_API_KEY

# OpenAI ChatGPT
linaix --set-openai-key YOUR_API_KEY
```

Or use environment variables:
```bash
export GOOGLE_API_KEY=your_key
export OPENAI_API_KEY=your_key
```

## 📖 Usage

**Basic usage** (requires confirmation):
```bash
linaix --provider google --model gemini-1.5-flash "list all python files"
```

**Quick examples**:
```bash
# Preview without running
linaix --provider google --model gemini-1.5-flash --dry-run "create backup directory"

# Skip confirmation prompt
linaix --provider openai --model gpt-4o-mini --yes "show disk usage"

# Set timeout
linaix --provider google --model gemini-1.5-flash --timeout 60 "find large files"

# Specify shell (auto-detects by default)
linaix --provider google --model gemini-1.5-flash --shell powershell "list processes"
```

**Available options**:
- `--provider` — `google` or `openai` (default: `google`)
- `--model` — Model name (required, e.g., `gemini-1.5-flash`, `gpt-4o-mini`)
- `--shell` — `auto`, `bash`, `zsh`, `powershell`, `cmd` (default: `auto`)
- `--dry-run` — Show command without executing
- `--yes` — Skip confirmation prompt
- `--timeout` — Command timeout in seconds (default: 30)

## 🔒 Safety Features

- ✅ Single command only (no pipes, redirects, or chaining)
- ✅ Confirmation required before execution (unless `--yes`)
- ✅ Blocks dangerous commands (`rm`, `dd`, `shutdown`, etc.)
- ✅ Detects suspicious patterns (`rm -rf /`, fork bombs, etc.)
- ✅ Input validation and sanitization

## 🛠️ Configuration

Config file: `~/.linaix/config.json`

```json
{
  "provider": "google",
  "google_api_key": "your_key_here",
  "openai_api_key": ""
}
```

## 🐛 Troubleshooting

| Issue | Solution |
|-------|----------|
| "No API key" error | Run `linaix --set-google-key YOUR_KEY` or set environment variable |
| "Permission denied" | Check PATH or reinstall: `pip install --force-reinstall linaix` |
| Command not found | Add Python Scripts to PATH (Windows) or restart terminal |

## 📝 License

MIT

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.


<div align="center">


[![GitHub stars](https://img.shields.io/github/stars/AdirAli/linaix?style=social)](https://github.com/AdirAli/linaix)
[![GitHub forks](https://img.shields.io/github/forks/AdirAli/linaix?style=social)](https://github.com/AdirAli/linaix)
[![GitHub issues](https://img.shields.io/github/issues/AdirAli/linaix)](https://github.com/AdirAli/linaix/issues)

</div>
