Skip to main content

A tiny bot built for simplicity

Project description

Pico Bot

A lightweight terminal-based AI assistant for simple, interactive chat.

Features

  • Terminal-based chat interface for quick, interactive use
  • OpenAI integration powered by LangChain
  • Conversation memory to preserve context during a session
  • Safe local file access limited to the project root
  • File tools for reading, writing, editing, moving, and deleting within the project root
  • Recursive directory listing support with config.toml customization and git-like ignore patterns to reduce noise, token usage, and accidental exposure of unneeded files
  • Accurate cost tracking with cached input token support, down to 6 decimal places

Usage

picobot

Type exit or quit to leave the session.

Screenshot

File Analysis

File Analysis

File Editing

File Editing

Installation

Requirements

  • Python 3.12 (tested)
  • An OpenAI API key

For Users

Install Pico Bot from PyPI:

pip install picobot

For Development

Clone the repository and install in editable mode:

git clone git@github.com:ngpeijiun/picobot.git
cd picobot
python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -e .

Configuration

Set your OpenAI API key in your environment:

export OPENAI_API_KEY="your_api_key"

On Windows PowerShell:

$env:OPENAI_API_KEY="your_api_key"

config.toml

You can place a config.toml file in your Pico Bot user config directory. Pico Bot reads it from:

On Linux and macOS:

~/.config/picobot/config.toml

On Windows:

C:\Users\<YourName>\.config\picobot\config.toml

Pico Bot uses this file to configure list_dir defaults.

Example:

[list_dir]
ignore = [".git/", ".venv/", "__pycache__/", "dist/"]
max_depth = 4
max_entries = 500

Notes:

  • ".venv" ignores both a file named .venv and a directory named .venv/
  • ".venv/" ignores only the directory .venv/

Safety

The read_file and list_dir tools only allow access to files inside the project root directory. This helps prevent path traversal outside the repository.

The list_dir tool supports simple gitignore-like ignore patterns to reduce noise, token usage, and accidental exposure of unneeded files. This is intended for convenience only; it is not a security boundary and should not be relied on to protect secrets.

Backward Compatibility

See Backward Compatibility for legacy config support. This backward compatibility will be dropped in the official 1.0 release.

Release Notes

See Release Notes for recent changes and version history.

Roadmap

  • Add more tools
  • Add tests
  • Improve configuration and error handling

License

MIT

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

picobot-0.4.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

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

picobot-0.4-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file picobot-0.4.tar.gz.

File metadata

  • Download URL: picobot-0.4.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for picobot-0.4.tar.gz
Algorithm Hash digest
SHA256 4c49b63b02376f505722cad8e1d40a6f89bfde2b3f02220d82c04faccac50d80
MD5 2ec092c2995a195e11bd880d28481c82
BLAKE2b-256 1227e6bbc7dd098e7eebb42bfd95ec4d53c330a4b02a9e9a5995450bf6c8e026

See more details on using hashes here.

File details

Details for the file picobot-0.4-py3-none-any.whl.

File metadata

  • Download URL: picobot-0.4-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for picobot-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 19122515a1893c9c79e6435d70436f1aca53b4bb6c024180ab4fcf41b0e214a4
MD5 0f646c078e77a941a4f09f3fe9b30e1d
BLAKE2b-256 123b41013bec65cceddb95dd42ca20b8ebe4bd36f2e6a8e746bade5950d85f5d

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