Skip to main content

A fully autonomous terminal AI agent — multi-model routing, persistent memory, real tool execution

Project description

English | 中文

🤖 PawnLogic

License: MIT Version PyPI CI Python 3.10+ Platform

A fully autonomous terminal AI agent — multi-model routing, persistent memory, real tool execution, and session management. Built for developers and security researchers.

⚡ Quick Start

Option A — pip install (recommended)

pip install pawnlogic
pawn   # first run launches the API configuration wizard

Option B — from source

git clone https://github.com/john0123412/PawnLogic.git && cd PawnLogic
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt
python main.py   # first run launches the API configuration wizard

Global pawn command:

chmod +x pawn.sh && ln -sf "$(pwd)/pawn.sh" ~/.local/bin/pawn

CLI usage:

pawn                              # interactive mode
pawn --eval "your prompt"         # single execution then exit
pawn --eval "prompt" --json       # JSON output (for scripting)

What's New in v0.0.5

  • --eval / --json / --session CLI flags — non-interactive single-shot execution, JSON output for pipelines, resume a named session
  • Sandbox security hardening — all interpreted languages (Python/bash/node/go) now execute in isolated tmpdir; added RLIMIT_FSIZE (64 MB) write limit
  • MCP auto-retry — external tool calls retry up to 3× with exponential backoff on timeout/connection errors
  • Session checkpoint — mid-turn autosave every 5 iterations; OperationalError retry on SQLite writes
  • Key display masking — unified mask_key() across /keys, /provider list, and /model

Key Capabilities

Capability Description
🔀 Dynamic Provider System Built-in DeepSeek / OpenAI / Anthropic + add any OpenAI-compatible API via /provider
🧠 Persistent Memory SQLite session history, RAG knowledge base, cross-session full-text search
🛠️ Real Tool Execution Shell, code sandbox (8 languages), web fetch, file ops, Docker containers
👁️ Vision Feed screenshots to gpt-4o or claude-sonnet for analysis
📋 Spec-Driven Planning Agent outputs <plan> XML before every action — no blind execution
💬 Session Management Tag, search, link, and export conversations with /chat commands
🔐 CTF / Pwn Toolchain GDB automation, ROP chain building, libc leak resolution, Docker isolation

Supported Models

Provider Aliases Best For
DeepSeek ds-v4-flash ds-v4-pro Fast default, flagship reasoning
OpenAI gpt-4o gpt-4.1 o3 Vision, code, complex reasoning
Anthropic claude-sonnet claude-haiku Balanced, fast low-cost

Custom providers added via /provider fetch appear automatically in /model and Tab completion.

Provider Management

/provider              # open interactive TUI panel
/provider add <name> <base_url> <ENV_KEY> [anthropic]
/provider fetch <name> # auto-discover models with interactive multi-select
/provider list         # show all providers and key status
/provider test <model> # test connectivity

All keys are stored in ~/.pawnlogic/.env. Provider configs (no keys) go to ~/.pawnlogic/custom_providers.json.

Quick Command Reference

/model [alias]          # switch model
/mode                   # toggle USER / DEV output mode
/chat find <keyword>    # full-text search across all sessions
/think <prompt>         # single deep-reasoning turn
/compact                # summarize + clear context
/undo [n]               # roll back last n turns
/deep                   # switch to deep mode (32k tokens, 50 iter)
/init_project           # initialize GSD engineering pipeline
/pwnenv                 # check CTF toolchain integrity
/keys                   # show API key status for all providers

MCP Tool Integration

cp mcp_configs.example.json ~/.pawnlogic/mcp_configs.json
# edit mcp_configs.json, add TAVILY_API_KEY= etc. to ~/.pawnlogic/.env
python main.py   # MCP servers load automatically

Supported MCP servers: Tavily (search), Playwright (browser automation), Filesystem (file bridge).

Data Layout

All runtime data and API keys are stored in ~/.pawnlogic/never in the project directory.

~/.pawnlogic/
├── .env                    # ALL API keys (LLM providers + MCP tools)
├── custom_providers.json   # user-added provider configs (no keys)
├── mcp_configs.json        # MCP server declarations
├── pawn.db                 # sessions, messages, knowledge base
├── global_skills.md        # GSA skill archive
├── workspace/              # per-session working directories
└── logs/                   # audit logs

The project directory contains no secrets and is safe to commit or share.

Documentation

Document Description
README.md This page
README_CN.md 中文版
GUIDE_EN.md Full reference — commands, architecture, FAQ
GUIDE_CN.md 完整参考手册 — 命令、架构、常见问题
CHANGELOG.md Version history and release notes
CONTRIBUTING.md How to contribute, add providers, run tests
SECURITY.md Vulnerability reporting policy

Support

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

pawnlogic-0.0.5.tar.gz (799.1 kB view details)

Uploaded Source

Built Distribution

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

pawnlogic-0.0.5-py3-none-any.whl (810.2 kB view details)

Uploaded Python 3

File details

Details for the file pawnlogic-0.0.5.tar.gz.

File metadata

  • Download URL: pawnlogic-0.0.5.tar.gz
  • Upload date:
  • Size: 799.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for pawnlogic-0.0.5.tar.gz
Algorithm Hash digest
SHA256 bd64050f5ec518be24283d24c5a58fb582f9d27aa39c4fef62e754e79237a216
MD5 a27e5bd34768e3b3bfab154df96011c8
BLAKE2b-256 5173a4b1ee9a097a35cd2264f4dfbe5ae1355267ee92e4084d8638ea1d26f600

See more details on using hashes here.

File details

Details for the file pawnlogic-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: pawnlogic-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 810.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for pawnlogic-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8b55cf0662a3c940b9091fe719ff2da7d00d31a796ced6493866b1e48f0cbe19
MD5 88f31d23cce6079f058f7f2260bdb93e
BLAKE2b-256 c05c2a27ffb4e714bc5f1870476fb6bf949aa6b14081917b037a1bbcd97f78a2

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