Skip to main content

ai-linux-assistant

An AI-powered natural-language Linux command-line assistant. Type what you want to do in plain English; it figures out the Bash command, explains it, checks whether it's safe to run automatically, executes it, and explains the result.

ai "find the largest file in this folder"
ai "show my disk usage"
ai "create a folder called projects"
ai "why is my python command failing?"

Not a web app, no Firebase, no login system, no database — a Python package you run from your own terminal.

Install

pip install ai-linux-assistant
export ANTHROPIC_API_KEY=your-key-here

(Not yet published to PyPI — see pyproject.toml to build/install locally with pip install -e ..)

Usage

Single-shot (scriptable):

ai "find the largest file in this folder"
ai --explain "find . -type f -mtime +7 -delete"
ai --history 20

Interactive (remembers context across turns, supports undo):

$ ai
you> find the largest file
  $ find . -type f -exec du -h {} + | sort -rh | head -n 1
  ...
you> now sort them by size
you> undo
you> exit

How it works

natural language
      │
      ▼
NLPEngine            understands intent, generates a command (or a
(AI + NLP)            multi-step plan), explains it, proposes an
                       advisory risk_hint
      │
      ▼
SafetyEngine          independent static analysis of the full command
(Safety/Permission)    string (pipes, redirects, sudo, chained operators,
                        etc). Only this module decides ALLOW / CONFIRM /
                        BLOCK — the AI's own risk_hint can escalate a
                        verdict but never soften one
      │
      ▼
CommandExecutor        runs the approved command, captures stdout/
(Linux Execution)       stderr/exit code, analyzes the result, and
                        suggests a next step on failure
      │
      ▼
back into NLPEngine's ConversationContext, so follow-up turns
("why did that fail?", "undo that") have something to reason about

Read-only commands (ls, pwd, df, cat, grep, ...) run automatically. Commands that change something (mkdir, rm, mv, chmod, sudo, package installs, ...) ask for confirmation first. Catastrophic commands (rm -rf /, fork bombs, raw disk writes, piping a remote script straight into bash, ...) are refused outright.

Project layout

ai_linux_assistant/
    nlp/        AI + Natural Language — intent, command generation,
                explanations, context, master prompts
    safety/     Safety/Permission Engine — command risk analysis,
                confirmation system, dangerous-command detection
                (core/ is Member 2's real submitted engine; engine.py
                adapts it into the app's ALLOW/CONFIRM/BLOCK contract)
    executor/   Linux Execution + Smart Features — subprocess execution,
                output analysis, suggestions, multi-step runs, history
    cli.py      CLI + Packaging — terminal interface tying the above
                together
tests/          unit tests per module + end-to-end integration tests

See INTEGRATION.md for how each module's work was combined and what's still outstanding.

Development

pip install -e ".[dev]"
python3 -m pytest tests/ -v

Development and testing

python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
python3 -m pytest -v

CLI

ai --version
ai --help
ai "show my disk usage"
ai --explain "ls -la"
ai --history 20

Modifying commands require confirmation in an interactive terminal. --yes is an explicit opt-in for automation; critical BLOCK decisions are never bypassed.

Build package

python3 -m pip install --upgrade build
python3 -m build

The generated wheel and source distribution in dist/ can be tested locally before any PyPI upload.

Metadata

Release files for ai-linux-assistant 0.1.0

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

Source distribution (sdist)

Source distribution for ai-linux-assistant 0.1.0
File Size Uploaded Provenance
ai_linux_assistant-0.1.0.tar.gz 44.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ai-linux-assistant 0.1.0
File Interpreter ABI Platform
ai_linux_assistant-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 92.6 kB

Release files / ai_linux_assistant-0.1.0.tar.gz

Download URL ai_linux_assistant-0.1.0.tar.gz
Size 44.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a2eaffaabe438d3411974788c0e0ab8f2582c54bb346fb2495b828c91faed630
BLAKE2b-256 checksum
How to use checksums
e03e0af597ca8b1c9f97ceb0bdf208f99eb1f52fcc3836214b8818143ab9c0d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

Release files / ai_linux_assistant-0.1.0-py3-none-any.whl

Download URL ai_linux_assistant-0.1.0-py3-none-any.whl
Size 48.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95478c1d13cea4d3103ef6d0e84f6371562bd144d3aa15d8a64bec48e5bed09f
BLAKE2b-256 checksum
How to use checksums
e1ea84e1fd014769d35122005e937a7768a0787fa3dd4c66c1daa6d55fe7e430
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

Security for ai-linux-assistant 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ai_linux_assistant-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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