Skip to main content

Gnix

Natural language to shell commands. Local. Private. Free.

Python License Ollama PyPI

Website · PyPI · Dataset


Gnix converts natural language into shell commands, running entirely on your machine.

$ gnix "find all python files modified in the last 7 days"

  │  shell   zsh
  │  model   qwen2.5:0.5b

  ▸  find all python files modified in the last 7 days

  ✦  Command
     find . -name '*.py' -mtime -7

  ▸  Finds all Python files in the current directory modified within the last 7 days.

  run this command? [y/n]: y

Why Gnix

Most AI terminal tools send your commands to a remote server and require a paid API key. Gnix runs the model entirely on your machine — your commands never leave your computer.

Feature Other tools Gnix
Runs locally
No API key required
No internet required
Private by default
Free forever
Built in safety layer
Bash and Zsh support
Choose your own model

Installation

1 — Install Ollama

Gnix uses Ollama to run AI models locally.

curl -fsSL https://ollama.com/install.sh | sh

2 — Pull a model

# Lightweight — works on any machine (400MB)
ollama pull qwen2.5:0.5b

# Better quality — needs 4GB RAM (2.2GB)
ollama pull phi3.5

Browse all available models at ollama.com/library

3 — Install Gnix

pip install gnix

4 — Run

gnix "list all files larger than 1GB"

On first run Gnix will guide you through selecting a model.


Usage

Generate and run a command

gnix "show disk usage of current folder"
gnix "find all log files older than 30 days"
gnix "list all running processes sorted by memory"
gnix "count lines in all python files"
gnix "create a compressed backup of the src folder"

Explain a command

gnix --explain "tar -czf archive.tar.gz /home/user"
gnix --explain "find / -size +1G -type f 2>/dev/null"

Dry run — generate without executing

gnix --dry-run "delete all temp files older than 7 days"

Change model

gnix --set-model

Safety

Gnix has a built in safety layer that detects dangerous commands before they run.

Dangerous commands always require explicit confirmation:

$ gnix "delete everything in the current folder"

  ✦  Command
     rm -rf *

  ▲  WARNING
  This command will recursively delete everything in the current
  directory and cannot be undone.

  type yes to confirm:

Patterns that trigger warnings:

  • Recursive deletion — rm -rf /, rm -rf ~, rm -rf *
  • Disk wiping — dd if=, > /dev/sda
  • Filesystem formatting — mkfs, mke2fs
  • Dangerous permissions — chmod -R 777 /
  • Fork bombs — :(){ :|:& };:
  • Remote script execution — | bash, | sh
  • System file overwriting — > /etc/passwd, > /etc/shadow
  • System shutdown — shutdown, reboot, halt

How It Works

User types natural language
           │
           ▼
    Input validation
           │
           ▼
    Shell detection (bash / zsh)
           │
           ▼
    Local AI model via Ollama
    (runs entirely on your machine)
           │
           ▼
    Generated shell command
           │
           ▼
    Safety checker
    ┌────────┴────────┐
    │                 │
  Safe           Dangerous
    │                 │
    ▼                 ▼
  Explain          Warn user
  command          ask for
    │              confirmation
    ▼                 │
  Ask [y/n] ←────────┘
    │
    ▼
  Execute and show output

Supported Models

Any model available in Ollama works with Gnix. Recommended options:

Model Size RAM needed Quality
qwen2.5:0.5b 400MB 1GB Good for most tasks
qwen2.5:1.5b 1GB 2GB Better quality
phi3.5:latest 2.2GB 4GB Best quality
llama3.2:3b 2GB 4GB Strong at reasoning

Switch models anytime with gnix --set-model.


Project Structure

gnix/
├── gnix/
│   ├── cli.py         — entry point, argument parsing
│   ├── model.py       — Ollama integration, command generation
│   ├── safety.py      — dangerous command detection
│   ├── executor.py    — command execution
│   ├── explain.py     — command explanation
│   ├── config.py      — user config, first run setup
│   └── display.py     — colors, symbols, spinner, UI
├── training/
│   ├── dataset.ipynb  — dataset preparation
│   ├── train.ipynb    — fine-tuning pipeline
│   └── README.md
├── tests/
│   ├── test_safety.py
│   ├── test_model.py
│   ├── test_config.py
│   └── test_executor.py
├── setup.py
└── requirements.txt
└── README.md
└── LICENSE
└── .gitignore

Running Tests

pip install pytest
pytest tests/ -v

Contributing

Contributions are welcome. Open an issue or submit a pull request on GitHub.


License

Apache 2.0 — see LICENSE


Release files for gnix 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gnix 0.1.1
File Size Uploaded
gnix-0.1.1.tar.gz 22.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gnix 0.1.1
File Interpreter ABI Platform
gnix-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 42.0 kB

Release files / gnix-0.1.1.tar.gz

Download URL gnix-0.1.1.tar.gz
Size 22.3 kB
Tags Source
SHA-256 checksum
How to use checksums
53075501bc716d54d096a0328eea09512963f540b4df954b17adbf4a9bc87e69
BLAKE2b-256 checksum
How to use checksums
c1647f262ab1d712701a3981036dbae65742aeb1281021e9ade28b81260a49dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / gnix-0.1.1-py3-none-any.whl

Download URL gnix-0.1.1-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
226abc95289f18f897b5c6c5d6a924c831099d287f7c5e8a897deb7124ccbc5c
BLAKE2b-256 checksum
How to use checksums
b0dbfb5d50f1ff8bc0cab073d098d834c78b8313a8e573f257b91565169f18eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page