Skip to main content

An autonomous AI coding agent that runs in your terminal.

Project description

SamCode CLI

PyPI version Python Version License: MIT

SamCode CLI is a powerful, autonomous AI coding agent that runs directly in your terminal. Similar to Claude Code and GitHub Copilot Workspace, it reads your project structure, writes and edits code, executes terminal commands, and fixes its own errors—all while keeping your workflow secure and efficient.

✨ Key Features

  • 🤖 Autonomous Agentic Loop: The agent thinks in steps. It reads files, writes code, runs commands, and automatically fixes terminal errors or reviews its own code for bugs.
  • 🌐 Universal AI Support: Connect to 15+ providers (OpenAI, Anthropic, Google Gemini, Ollama, Groq, etc.) with dynamic model fetching.
  • 📄 Universal Document Reader: Upload and analyze PDFs, Word docs, Excel sheets, PowerPoint presentations, and images directly in the chat.
  • 🔍 Live Web Search: Use /searchweb to open your browser and let the AI synthesize answers from live search results.
  • Project Scaffolding: Use /init to instantly scaffold projects for React, Next.js, Django, Spring Boot, Flutter, Rust, and more.
  • 🌿 Native Git Integration: A full interactive Git workflow (/git) to commit, push, pull, branch, and stash without leaving the agent.
  • 📦 Auto Dependency Installation: Automatically detects missing packages and installs them with your approval.
  • 🔒 Path Sandboxing: The agent is restricted to your workspace and asks for explicit permission before accessing files outside the current directory.
  • ⌨️ Advanced Shortcuts: Emacs-style navigation (Ctrl+A, Ctrl+W, Home/End) in the prompt for fast typing.
  • Caveman Mode: Save tokens with ultra-concise, grunt-like AI responses.

🚀 Installation

Install SamCode CLI globally from PyPI using pip:

pip install samcode-cli

Commands Reference

🤖 Core & AI

Command Description
/connect Configure AI provider and API key interactively.
/models Dynamically fetch and select models from your provider.
/caveman Cycle through token-saving modes (OFF ➔ BASIC ➔ ULTRA).
/deps Toggle auto-approve for dependency installations.
/aboutme Information about the developer and SamCode.

📂 Files & Documents

Command Description
/upload <path> Upload & extract documents (PDF, DOCX, XLSX, PPTX, Images).
/clear-uploads Clear uploaded documents from the session context.
/read-file <path> Read any file using the universal document reader.

🌐 Web & Scaffolding

Command Description
/searchweb <query> Search the web (opens browser) & get an AI-synthesized answer.
/init <name> Scaffold a new project (React, Django, Spring, Flutter, etc.).

🌿 Git Operations

Command Description
/git Open the interactive Git menu (Status, Commit, Push, Pull, Branches, Diff, Stash).

⚙️ System

Command Description
/help Show all available commands.
/clear Clear the terminal screen.
/exit Exit SamCode CLI.

⌨️ Keyboard Shortcuts

**SamCode CLI uses **prompt_toolkit to provide a rich input experience. The following shortcuts work directly in the prompt:

  • Ctrl + A : Select all text
  • Ctrl + W : Delete word backward
  • Ctrl + U : Clear line backward
  • Ctrl + K : Delete to end of line
  • Home / End : Jump to start/end of line
  • Shift + Home/End : Select to start/end of line
  • Ctrl + Left/Right : Jump by word

🛡️ Safety & Security

  • Path Sandboxing **: By default, the agent cannot read, write, or execute commands outside the directory where you launched **samcode. If it needs to, it will pause and ask for your explicit permission.
  • User Approval **: All file modifications, terminal commands, and dependency installations require your confirmation before execution (unless auto-approve is enabled via **/deps).
  • Self-Review : After writing code, the agent automatically reviews its own work to catch syntax errors or logical bugs before moving on.

Requirements

  • Python 3.8 or higher
  • An API key for your chosen AI provider (OpenAI, Anthropic, Google, etc.)
  • Internet connection (except when using local Ollama models)

📝 License

**This project is licensed under the MIT License. See the **LICENSE file for details.


Developed by Magra Houssem Eddine


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

samcode_cli-1.0.5.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

samcode_cli-1.0.5-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file samcode_cli-1.0.5.tar.gz.

File metadata

  • Download URL: samcode_cli-1.0.5.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for samcode_cli-1.0.5.tar.gz
Algorithm Hash digest
SHA256 3e9abed2ff29a645b17577e8f5988683f02d6f3141bc88ace0aa57354f5b44fd
MD5 07a78986759dc272cf1af5bc3a8102b9
BLAKE2b-256 da8a6ca1bc27808a6b5ca7ff1e812173b53ad567b5d50024ed110d351d8f6573

See more details on using hashes here.

File details

Details for the file samcode_cli-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: samcode_cli-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for samcode_cli-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 176ce9720d934f891d56a98eea18ac96c22bcf9490d3ce2aa1131702a9a5aa7b
MD5 95ab008a495fd27289b4e4e2b8059090
BLAKE2b-256 3a9c2a7035ec58b30d84a07b5ecab2372fa51db841b2f306bf9e8dd407a40a4d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page