Autobot is an intelligent, cross-platform Command Line Interface (CLI) agent built in Python for locating, renaming, and moving files/folders across directory trees. It features a persistent interactive REPL shell, tab auto-completion, deterministic slash commands (/), rich dry-run preview action cards, transaction history undo logs, and optional natural language AI processing powered by Local LLMs (Gemma 4B / Qwen 4B) or universal Cloud LLMs (OpenAI, Groq, OpenRouter, DeepSeek, etc.).
Note
Autobot is a complete, self-contained, and deterministic CLI file manager out of the box. All core featuresβincluding the interactive REPL shell, slash commands (/locate, /rename, /move), CLI subcommands, wildcard glob matching, bulk pattern renames, dry-run safety cards, transaction history, and /undoβwork completely offline with zero LLMs, zero API keys, and zero cloud dependencies.
The AI engine is purely an opt-in capability for translating plain English instructions (e.g., "move all invoice PDFs from Downloads to Finance") using local Ollama / LM Studio models or cloud providers. When no AI is configured, Autobot runs at full speed in deterministic mode.
- π Persistent REPL Shell (
autobot βΊ): Continuous terminal session powered byprompt_toolkit. Remembers active workspace, model provider, and undo history across inputs. - β‘ Tab Auto-Completion: Context-aware completion for slash commands (
/loβ/locate,/moβ/move,/hiβ/history) and local filesystem paths. - π¨ CLI Theme: Terminal styling with rounded box borders (
box.ROUNDED), Cyan/Magenta/Slate color palette, and live session status badges. - β‘ Deterministic Slash Commands: Zero-latency commands (
/locate,/rename,/move,/undo,/history,/cd,/key,/model,/models,/status,/help,/clear,/exit). - π Hybrid Search Engine (Wildcard Glob + RapidFuzz): Precision
fnmatchwildcard glob matching (*.png,*invoice*,doc_??.pdf) with 100% precision score, combined with RapidFuzz fuzzy similarity scoring for natural typos (invoceβannual_invoice_2024.pdf). - βοΈ Single & Bulk Pattern Renaming: Rename individual items or apply pattern transformations (
snake_case,kebab-case,camelCase,title_case, prefix/suffix, sequence numbering01,02with dynamic padding). - π€ Safe Case-Preserving Renaming: Safely handles case-only renames (
readme.mdβREADME.md) on case-insensitive filesystems (Windows NTFS/FAT, macOS) using an atomic two-step temporary rename without false collision errors. - π Cross-Volume Safe Relocation: Moves files seamlessly across drives and partitions with
shutil.move. Verifies target directories before moving; if missing, interactively prompts the user (Create destination directory? [y/N]). - π Recursion & Collision Prevention: Prevents moving a directory into itself or its subdirectories (
INVALID_MOVE), and skips existing destination targets to prevent silent file overwrites (COLLISION). - π Action Cards & InquirerPy Confirmations: Displays formatted Rich preview cards and interactive arrow-key confirmation menus (
[β] Execute actions nowvs[β] Cancel operation) before modifying disk. Supports--yes/-yflag for automated scripting. - β©οΈ Transaction History & Undo Subsystem (
/undo,/history): Logs every file operation to~/.autobot/history.json. Review past transactions with/historyand reverse the last batch with/undo, even across different Windows drive letters. Retains un-reversed actions during partial undos. - β³ Live Animated Spinners: Renders Rich animated spinners (
β Searching directory tree...,β AI parsing request...) for fluid visual feedback. - π€ Optional Dual AI Engine (Local Ollama Auto-Discovery & Cloud BYOK):
- Local Models: Automatically queries
/v1/modelsfrom local Ollama or LM Studio to auto-detect installed models (qwen3.5:4b,gemma4,llama3). Switch dynamically with/model listand/model <name>. - Cloud Models: Bring-Your-Own-Key (BYOK) for any OpenAI-compatible provider (OpenAI, Groq, OpenRouter, DeepSeek, Mistral, Together, etc.) with
/key <API_KEY>and persistent configuration in~/.autobot/config.json. - Zero Assumptions: Displays
[No model available]cleanly until an AI engine is configured or detected.
- Local Models: Automatically queries
- Python 3.10 or higher installed on your system.
Clone the repository and install Autobot in editable mode:
git clone https://github.com/0carespal/cliagent.git
cd cliagent
python -m pip install -e .(This registers the autobot and cliagent commands in your system PATH so you can launch it from any terminal folder).
Open PowerShell, CMD, or Bash in any folder on your computer (e.g. Downloads, Documents, or Desktop) and run:
autobotAutobot launches with that directory set as your active workspace!
(Alternatively, without installing globally, run python main.py from the project directory).
- Switch directories on the fly: Type
/cd <path>(e.g./cd "$HOME/Downloads"or/cd ~/Documents). - Smart path aliases: Use standard folder aliases like
Downloads,Documents,Desktop,Picturesdirectly. - Specify root directory in commands: Pass
--start-dir <path>to search external paths without leaving your current workspace.
Run deterministic commands directly from your terminal without entering the interactive shell:
# Locate files with wildcards in Downloads
autobot locate "*.pdf" --start-dir "$HOME/Downloads"
# Move PNG images to Pictures folder
autobot move "*.png" "$HOME/Pictures" --start-dir "$HOME/Downloads"
# Case-preserving rename on Windows or macOS
autobot rename "readme.md" --new-name "README.md"
# Bulk rename with snake_case and dynamic sequence numbering (photo_01.jpg, photo_02.jpg)
autobot rename "*.jpg" --case snake --seq "photo_01" --start-dir "$HOME/Pictures"
# View past transaction batches
autobot history
# Reverse the last file transaction batch
autobot undoWhen connected to a local Ollama server or configured with a Cloud API key, type plain English sentences directly into the autobot βΊ prompt (or via autobot ask "..."):
autobot βΊ find all PNG files in Downloads and move them to Pictures/Screenshots
autobot βΊ rename draft_document.txt to annual_report_2024.txt
autobot βΊ move all reports larger than 10MB to Archive
Autobot analyzes your request, generates a dry-run preview card, and asks for confirmation before executing.
| Slash Command | Description | Example Usage |
|---|---|---|
/locate |
Locates files/folders matching wildcards or fuzzy query | /locate "*.pdf" or /locate "report" --start-dir "$HOME/Downloads" |
/rename |
Renames files/folders (supports bulk, casing, & sequences) | /rename "readme.md" "README.md" or /rename "*.jpg" --case snake --seq "img_01" |
/move |
Moves matching files/folders to a target directory | /move "*.png" "./Pictures" or /move "*.csv" "$HOME/Documents" --start-dir "./data" |
/cd |
Switches current active workspace directory | /cd "$HOME/Downloads" or /cd "Documents" |
/history |
Displays past file transaction sessions and statuses | /history |
/undo |
Reverses the last move or rename transaction session | /undo |
/key |
Views or configures your Cloud LLM API key | /key sk-proj-... |
/model list (or /models) |
Lists all detected local Ollama models and cloud model status | /model list |
/model <name> |
Switches active LLM model (e.g. qwen3.5:4b, gemma4, cloud) |
/model qwen3.5:4b or /model cloud |
/status |
Displays a summary card of active folder, model, and undo stack | /status |
/help |
Displays the interactive command cheat-sheet card | /help |
/clear (or /cls) |
Clears the terminal screen canvas | /clear |
/exit (or exit, quit) |
Exits the Autobot REPL session | /exit |
Because Autobot moves and renames files on your computer, safety guardrails are baked into every layer:
- π Automatic Directory Pruning: Recursive search automatically skips system, cache, and dependency folders (
.git,node_modules,__pycache__,venv,AppData,$Recycle.Bin,System Volume Information,tmp, etc.). Your system files and code repositories are never touched. - π Collision Protection: Before moving or renaming, Autobot verifies whether the destination file already exists. If a conflict is found, the action is flagged as
COLLISIONand skippedβit will never silently overwrite your existing files. - π€ Safe Case-Only Renaming: Changing letter casing on case-insensitive filesystems (Windows NTFS, macOS APFS) such as
file.txtβFILE.TXTis performed via an atomic two-step temporary rename to prevent operating system collisions. - π« Directory Recursion Guard: Autobot detects and prevents attempts to move a directory into itself or one of its child subdirectories (
INVALID_MOVE). - π Missing Target Directory Verification: If a target destination folder does not exist, Autobot will never create it automatically; it pauses and prompts for explicit user consent (
Create destination directory? [y/N]). - π Interactive Action Cards (Dry-Run by Default): All operations present a formatted Rich preview table detailing the source path, destination path, and validation status before prompting for confirmation (
[β] Execute actions nowvs[β] Cancel operation). For scripts, use-yor--yesto proceed without confirmation. - β©οΈ Reversible Transactions (
~/.autobot/history.json): Every executed batch logs its inverse operation. Running/undorestores files to their original locations and names. If any file in a batch cannot be restored, un-reversed records are retained for safety. - π‘ Best Practice: When testing new complex wildcards or bulk patterns for the first time, try them on a sample test folder or review the dry-run action card carefully before confirming execution.
Run natural language commands 100% offline:
- Install and run Ollama or LM Studio.
- Pull your preferred model (e.g.,
qwen3.5:4borgemma4):
ollama run qwen3.5:4b- Autobot automatically connects to
http://localhost:11434/v1and auto-discovers your local models!
Use any OpenAI-compatible provider (OpenAI, Groq, OpenRouter, DeepSeek, Mistral, Together, etc.).
Configure your key directly in the shell (automatically persisted to ~/.autobot/config.json):
autobot βΊ /key sk-your-api-key-here
Windows PowerShell:
$env:LLM_API_KEY="your-api-key-here"
$env:LLM_MODEL="gpt-4o-mini" # Optional: defaults to gpt-4o-mini
$env:LLM_BASE_URL="https://api.openai.com/v1" # Optional: Groq / OpenRouter / etc.Linux / macOS / Bash:
export LLM_API_KEY="your-api-key-here"
export LLM_MODEL="gpt-4o-mini"
export LLM_BASE_URL="https://api.openai.com/v1"Run the full end-to-end integration test suite:
python tests/test_autobot.pycliagent/
βββ assets/
β βββ demo.png # REPL terminal screenshot preview
βββ config.py # System configuration, ignored folders, and LLM endpoints
βββ main.py # Main CLI launcher & Typer subcommand entry point
βββ setup.py # Packaging configuration & console_scripts registration
β
βββ core/
β βββ finder.py # Recursive walker, fnmatch glob, rapidfuzz fuzzy search
β βββ renamer.py # Single/bulk rename, pattern replacement, & case converters
β βββ mover.py # Safe file relocation, recursion guard & directory verification
β βββ safety.py # Rich preview table renderer & JSON transaction undo log
β βββ slash_commands.py # Quote-aware shlex parser & slash command router
β
βββ ai/
β βββ base.py # System prompts & JSON response sanitization
β βββ local_llm.py # Ollama / LM Studio (Gemma/Qwen) HTTP client
β βββ cloud_llm.py # Universal Cloud LLM client (OpenAI, Groq, OpenRouter, etc.)
β βββ intent_parser.py # Unified AI provider router & intent extractor
β
βββ ui/
β βββ theme.py # Antigravity CLI palette, Option A box banner & status spinners
β βββ repl.py # Persistent REPL prompt loop with tab completion
β βββ tables.py # Rich search result and history formatting tables
β βββ interactive.py # InquirerPy interactive confirmation selection dialogs
β
βββ tests/
βββ test_autobot.py # End-to-end automated integration test suite
This project is licensed under the MIT License.
