Skip to main content

Bub it. Build it.

Project description

Bub - Bub it. Build it.

Release Build status Commit activity License

Bub is an AI-powered CLI tool that helps you build, develop, and manage projects using natural language commands. With access to file operations, command execution, and intelligent reasoning, Bub acts as your coding assistant.

Installation

# Install from PyPI (when available)
pip install bub

# Or install from source
git clone https://github.com/psiace/bub.git
cd bub
uv sync
uv run bub --help

Quick Start

1. Set up your API key

Bub supports multiple AI providers through Any-LLM. Configure provider and model:

# For OpenAI
export BUB_PROVIDER="openai"
export BUB_MODEL_NAME="gpt-4"
export BUB_API_KEY="sk-..."

# For Anthropic
export BUB_PROVIDER="anthropic"
export BUB_MODEL_NAME="claude-3-sonnet-20240229"
export BUB_API_KEY="your-anthropic-key"

2. Start using Bub

# Interactive chat mode
bub chat

# Run a single command
bub run "Create a Python script that prints 'Hello, World!'"

# Specify workspace and model
bub chat --workspace /path/to/project --model gpt-4

# Get help
bub --help

Usage Examples

# Create files
bub run "Create a README.md for a Python project"

# Code assistance
bub run "Add error handling to my main.py file"

# Project setup
bub run "Initialize a new FastAPI project with basic structure"

# Code review
bub run "Review my code and suggest improvements"

Configuration

Bub can be configured via environment variables or a .env file:

BUB_API_KEY=your-api-key-here
BUB_MODEL=gpt-4                    # AI model to use
BUB_API_BASE=https://api.custom.ai # Custom API endpoint
BUB_MAX_TOKENS=4000               # Maximum response tokens
BUB_WORKSPACE_PATH=/path/to/work  # Default workspace
BUB_SYSTEM_PROMPT="custom prompt" # Custom system prompt

Custom System Prompt with BUB.md

You can customize Bub's behavior by creating a BUB.md file in your workspace. This file will be automatically read and used as the system prompt, allowing you to define project-specific instructions, coding standards, and behavior guidelines.

Example BUB.md:

# Project Assistant

You are a Python development assistant for this specific project.

## Guidelines
- Follow PEP 8 style guidelines
- Use type hints for all functions
- Write comprehensive tests with pytest
- Focus on security and performance

## Project Structure
- `/src` - Main source code
- `/tests` - Test files
- `/docs` - Documentation

When making changes, always run tests first.

The BUB.md file takes precedence over the BUB_SYSTEM_PROMPT environment variable, making it easy to share consistent AI behavior across your development team.

Development

# Clone the repository
git clone https://github.com/psiace/bub.git
cd bub

# Install dependencies
uv sync --dev

# Run tests
just test

# Run linting and type checking
just check

# Build documentation
just docs

If you don't have just installed, you can use uv run just instead of just.

Contributing

Contributions are welcome! Please read CONTRIBUTING.md for guidelines.

Links

License

This project is licensed under the Apache-2.0 License - see the LICENSE file for details.

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

bub-0.1.1.tar.gz (912.0 kB view details)

Uploaded Source

Built Distribution

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

bub-0.1.1-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

Details for the file bub-0.1.1.tar.gz.

File metadata

  • Download URL: bub-0.1.1.tar.gz
  • Upload date:
  • Size: 912.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for bub-0.1.1.tar.gz
Algorithm Hash digest
SHA256 74a1042a576d3477a4c3a0e06478353ecb08990d9db5e3850000717c07801f16
MD5 3883764ddbe14d64d2b1fd90e1bab4bf
BLAKE2b-256 0f2c7a5fb5ffdb45315f12bb54c8226eacadae594895ef37ad9b2850daebe498

See more details on using hashes here.

File details

Details for the file bub-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: bub-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 29.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for bub-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 82531b3e344dcb8272446f0dce740af02e66d9f532c169185ef5e9eb332e9b95
MD5 7322dc3e6956a959e8d9100fec9aa0a8
BLAKE2b-256 312f5819b5cd059df110385fe10c7a84d871e8e7271f470fb8ea77da6d305782

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