Skip to content

9v2/pyclaw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🦞 PyClaw

your own personal AI assistant β€” the python claw.

Python 3.11+ License: MIT

a fully async, extensible AI assistant that lives in your terminal and telegram. powered by (Gemini, OpenAI, Anthropic, etc. ) routing.


✨ features

  • Telegram bot gateway β€” Chat with your AI from anywhere, with photo analysis and file sharing.
  • Terminal chat β€” Interactive CLI with streaming responses
  • Tool system β€” File operations, shell commands, web search, config management, cron jobs
  • Skills β€” Extensible skill system with installable .md skill packs
  • Identity β€” Persistent personality via SOUL.md and AGENTS.md templates
  • Memory β€” Daily notes + curated long-term memory
  • Reactions β€” Auto-reactions and emoji reactions on telegram (minimal/massive modes)
  • Network resilience β€” Auto-reconnect with exponential backoff on connection loss
  • Multi-model β€” Switch between gemini models on the fly

πŸ“¦ installation

requirements

  • python 3.11+
  • pip (or pipx for isolated install)
  • a google AI api key (get one here)
  • a telegram bot token (from @BotFather) β€” optional, for telegram gateway

linux / macOS

git clone https://github.com/9v2/pyclaw.git
cd pyclaw
python -m venv .venv
source .venv/bin/activate
pip install -e .

windows (WSL recommended)

# install WSL if not already
wsl --install

# then inside WSL:
git clone https://github.com/9v2/pyclaw.git
cd pyclaw
python3 -m venv .venv
source .venv/bin/activate
pip install -e .

windows (native)

git clone https://github.com/9v2/pyclaw.git
cd pyclaw
python -m venv .venv
.venv\Scripts\activate
pip install -e .

Note

the telegram gateway uses unix signals for graceful shutdown. on native windows, use WSL for the gateway. the CLI works fine on native windows.

πŸš€ quick start

# first-time setup β€” walks you through auth, model selection, telegram, and skills
pyclaw onboard

# start chatting
pyclaw agent

# launch telegram bot
pyclaw gateway

πŸ“‹ CLI commands

command description
pyclaw onboard first-time setup wizard
pyclaw agent interactive AI chat in terminal
pyclaw gateway telegram bot (interactive menu with start/stop/restart)
pyclaw config show display current config
pyclaw config set KEY VALUE set a config value
pyclaw config reset reset config to defaults
pyclaw models list and switch AI models
pyclaw skills list list installed skills
pyclaw skills install URL install a skill from a .md URL

βš™οΈ configuration

config lives at ~/.pyclaw/config.json. key sections:

section keys description
auth google_api_key google AI API key
agent model, temperature, max_tokens model and generation settings
gateway telegram_bot_token, allowed_users, reaction_mode telegram bot settings
search provider, perplexity_api_key, brave_api_key web search provider
workspace path workspace directory (default: ~/.pyclaw/workspace)

reaction modes

# no auto-reactions (default)
pyclaw config set gateway.reaction_mode null

# react on greetings + completion
pyclaw config set gateway.reaction_mode minimal

# react on every message
pyclaw config set gateway.reaction_mode massive

🧠 skills

skills are markdown files that extend the AI's capabilities. they live in ~/.pyclaw/workspace/skills/<name>/SKILL.md and are injected into the system prompt.

# install a skill from a URL
pyclaw skills install https://example.com/skill.md

# list installed skills
pyclaw skills list

built-in skills: tmux, shell, file_management

πŸ›  available tools

the AI has access to these tools:

tool description
run_command execute shell commands
write_file create/overwrite files
read_file read file contents
list_directory list directory contents
web_search search the web (brave/perplexity)
read_webpage fetch and read a URL
send_reaction react to messages with emoji
get_config / set_config read/write config
update_identity update SOUL.md / AGENTS.md
cron tools schedule recurring tasks

πŸ— architecture

~/.pyclaw/
β”œβ”€β”€ config.json          # all settings
β”œβ”€β”€ SOUL.md              # AI personality & rules
β”œβ”€β”€ AGENTS.md            # behavioral guidelines
β”œβ”€β”€ MEMORY.md            # curated long-term memory
β”œβ”€β”€ memory/              # daily notes (YYYY-MM-DD.md)
β”œβ”€β”€ workspace/
β”‚   β”œβ”€β”€ skills/          # installed skills
β”‚   β”œβ”€β”€ images/          # generated images
β”‚   β”œβ”€β”€ files/           # generated files
β”‚   └── temp/            # temporary files
└── gateway.log          # telegram gateway logs
pyclaw/
β”œβ”€β”€ agent/               # core AI agent, providers, tools, identity
β”œβ”€β”€ auth/                # google OAuth
β”œβ”€β”€ cli/                 # click CLI commands
β”œβ”€β”€ config/              # config management, defaults, models
β”œβ”€β”€ gateway/             # telegram bot gateway
└── skills/              # built-in skill templates

πŸ”’ security

  • confirmation prompts for destructive commands (rm, kill, etc.)
  • blocked patterns β€” configurable command blocklist
  • allowed users β€” restrict telegram bot to specific user IDs
  • safe commands β€” whitelist for auto-approved commands (ls, cat, echo, etc.)

🀝 contributing

Contributions are welcome! Feel free to open issues, suggest features, or submit pull requests.

  1. Fork the repo
  2. Create your branch (git checkout -b feature/cool-thing)
  3. Commit your changes (git commit -m 'add cool thing')
  4. Push to the branch (git push origin feature/cool-thing)
  5. Open a Pull Request

If you find PyClaw useful, give it a ⭐ β€” it helps others discover the project!

πŸ“„ license

MIT

About

Pyclaw, your own personal Python AI assistant.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages