Skip to content

Drift CLI

A terminal-native, safety-first AI assistant that integrates directly into your shell.
Powered by local LLMs via Ollama โ€” no cloud dependency, full privacy. Running `drift` with no arguments now opens a rich help dashboard with grouped commands, slash action panels, and flag summaries.


๐Ÿš€ What is Drift?

Drift turns plain English into safe, executable shell commands. Just describe what you want, no fancy syntax needed:

$ drift find all python files modified in the last 7 days

โ•ญโ”€ Plan โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚  Summary: Find recently modified Python files               โ”‚
โ”‚  Risk: ๐ŸŸข LOW                                              โ”‚
โ”‚                                                              โ”‚
โ”‚  $ find . -type f -name '*.py' -mtime -7                   โ”‚
โ”‚    โ†’ Search for .py files modified within 7 days            โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
Execute? [y/N]:

Then Drift:

  1. Queries a local LLM (via Ollama โ€” no cloud, no API keys)
  2. Generates a structured execution plan with risk assessment
  3. Shows a dry-run preview with color-coded risk badges
  4. Asks for confirmation before executing anything
  5. Takes a file snapshot so you can drift undo if needed

๐Ÿ›ก Safety First

Every command goes through a three-layer safety pipeline before it can run:

Layer What It Does
Blocklist 60+ regex patterns block dangerous commands (rm -rf /, fork bombs, disk wipes)
Risk Scoring Commands get a LOW / MEDIUM / HIGH risk badge
Confirmation You always review and confirm before execution

Plus: snapshot-based undo for every file-modifying operation.

โšก Quick Start

# Install
git clone https://github.com/a-elhaag/drift-cli.git
cd drift-cli
pip install -e .

# Make sure Ollama is running
ollama pull qwen2.5-coder:1.5b

# Just use natural language queries:
drift what is the time now
drift compress all logs older than 7 days
drift explain tar -czf archive.tar.gz src/
drift doctor

Get started View on GitHub

โœจ Key Features

  • ๐Ÿง  Natural Language โ†’ Shell

Just describe what you want in plain Englishโ€”no syntax needed. Drift generates the right command.

drift compress all logs older than 7 days drift what is the time now drift show me all python files on my laptop

  • ๐Ÿ›ก Safety Engine

Blocklist, risk scoring, dry-run previews, and mandatory confirmation for dangerous ops.

  • ๐Ÿ’พ Undo System

Every file-modifying command creates a snapshot. Roll back anytime with drift undo.

  • ๐Ÿ’ก Memory System

Learns tool preferences, shows usage stats, and surfaces insights via drift memory show, drift memory stats, and drift memory insights.

  • โšก Slash Commands

/git, /commit, /status, /clean, /lint, /tips, and more โ€” all captured in Slash commands.

  • ๐Ÿ”’ Local-First & Private

Runs entirely on your machine via Ollama. Your data never leaves your computer.

๐Ÿงฐ System & personalization

Use Drift's management commands to keep your environment healthy and your preferences portable.

  • drift doctor verifies Ollama, pulls the default qwen2.5-coder:1.5b model if missing, and reports ~/.drift status.
  • drift config interactively edits model settings, toggles auto-install/start/pull, and changes snapshot or idle behavior.
  • drift setup, drift update, and drift uninstall reboot the wizard, self-update the git clone + pip install, or tear down Drift/Ollama entirely.
  • drift memory export/import moves personalization between machines, drift memory projects lists per-project data, and drift memory reset/insights keep you in control.

Read the Command reference and Slash commands for the full CLI surface.

Built with GitHub Copilot

Drift CLI was built entirely with GitHub Copilot as a development partner โ€” from architecture design to security hardening. Read the full story