A Python CLI for talking to AI models. Inspired by PicoClaw - built with security, extensibility, and cross-platform support in mind.
PyClaw gives you a command-line interface for AI conversations - quick one-off queries, back-and-forth chat sessions, and scheduled tasks. Configuration lives in ~/.pyclaw/config.json and is set up through a guided onboarding flow.
Main use cases:
- Single queries and continuous conversations via Groq
- Scheduled jobs via
cron
- Python 3.8+
pyinputplus- input validation during onboardinggroq- Groq APIkeyring- secure API key storage via OS keychainrequests- LangSearch integration (upcoming)
Query mode - ask one question, get one answer, done.
Chat mode - back-and-forth conversation that remembers context for the session.
Onboarding - walks you through API keys, model settings, tone, response length, and emoji preferences on first run.
Personality system - tone, response length, and emoji usage are saved during onboarding and applied consistently across sessions via a system prompt.
Secure key storage - API keys are stored in your OS keychain via keyring. No plaintext credentials on disk.
Markdown stripping - responses are cleaned up for terminal output. No stray **bold** leaking into your shell.
git clone https://github.com/venkatram-s/pyclaw.git
cd pyclaw
pip install -r requirements.txtRun onboarding first:
python __main__.py onboardIt asks for your API keys, model name, and how you want the AI to behave. Everything gets saved to ~/.pyclaw/config.json. API keys are stored separately in your OS keychain.
| Command | What it does |
|---|---|
python __main__.py onboard |
first-time setup, or reconfigure |
python __main__.py query |
single question, single answer |
python __main__.py chat |
start a conversation |
python __main__.py cron |
manage scheduled tasks |
python __main__.py version |
show version |
python __main__.py help |
show help |
__main__.py parses the command and routes it. onboard.py handles config creation and stores API keys in the OS keychain. ai.py builds the system prompt from your personality settings and makes the API call.
The flow is: command -> __main__.py -> src/ module -> Groq -> output to terminal.
A few known limitations worth being upfront about:
- API rate limits apply (Groq)
- Cron jobs don't survive process restarts yet
- Cron system - scheduled job runner with markdown templates and file output
- LangSearch integration - wire LangSearch into
ai.pyfor web-aware responses - Chat session logging - save conversations to markdown files in
~/.pyclaw/logs/
- Fork the repo
- Create a feature branch
- Open a pull request
Use
pylintorflake8before submitting.
- Status: active
- Maintainer: venkatram-s
- License: GPL v3