Complete guide for using PygubuAI - AI-powered workflow tools for Pygubu.
git clone https://github.com/Teycir/PygubuAI.git
cd PygubuAI
pip install -e .This installs PygubuAI as a Python package with CLI commands available system-wide.
Verify installation:
pygubu-create --version
pygubu-register listFor systems where pip installation doesn't work:
./install.shThis copies scripts to ~/bin/ or /usr/local/bin/.
pip install -e ".[dev]"
make pre-commit-install
make testpip uninstall pygubuai # For pip install
./uninstall.sh # For shell script install# Create a simple app
pygubu-create myapp 'login form with username and password'
# Navigate and run
cd myapp
python myapp.py# List available templates
pygubu-template list
# Create from template
pygubu-template myapp login# Scan for projects
pygubu-register scan ~/projects
# Set active project
pygubu-register active myapp
# List all projects
pygubu-register listCreate new projects from natural language descriptions.
Syntax:
pygubu-create <name> '<description>'Examples:
pygubu-create todo 'todo app with entry, button, and list'
pygubu-create calc 'calculator with number pad and display'
pygubu-create form 'data entry form with name, email, and submit'Supported widgets:
- Labels, Entries, Buttons
- Lists (Treeview), Text areas
- Dropdowns (Combobox), Checkboxes
- Sliders, Progress bars, Tabs
Create projects from pre-built templates.
Syntax:
pygubu-template <name> <template>
pygubu-template listAvailable templates:
login- Login form with username/passwordcrud- CRUD interface with list and formsettings- Settings dialog with tabsdashboard- Dashboard with metricswizard- Multi-step wizard
Examples:
pygubu-template myapp login
pygubu-template admin crud
pygubu-template config settingsManage project registry for AI context.
Commands:
pygubu-register list # List all projects
pygubu-register active <name> # Set active project
pygubu-register add <path> # Add project manually
pygubu-register scan <directory> # Auto-discover projects
pygubu-register remove <name> # Remove projectExamples:
pygubu-register scan ~/projects
pygubu-register active myapp
pygubu-register listWorkflow automation and monitoring.
Commands:
pygubu-ai-workflow watch <project> # Watch for UI changes
pygubu-ai-workflow status <project> # Show project statusConvert existing tkinter code to pygubu format.
Syntax:
tkinter-to-pygubu <file>.pyExample:
tkinter-to-pygubu legacy_app.pyDescribe your UI in plain English:
pygubu-create app 'search interface with text entry, search button, and results list'PygubuAI detects widgets and creates:
.uifile (Pygubu XML).pyfile (Python application)README.md(Documentation)
PygubuAI recognizes these patterns:
| Description | Detected Widget |
|---|---|
| "button", "submit", "click" | ttk.Button |
| "entry", "input", "field" | ttk.Entry |
| "list", "table", "tree" | ttk.Treeview |
| "dropdown", "select", "combo" | ttk.Combobox |
| "checkbox", "check" | ttk.Checkbutton |
| "text area", "multiline" | tk.Text |
| "label", "title", "heading" | ttk.Label |
Special contexts trigger pre-configured layouts:
- "login" → username label, entry, password label, entry, button
- "form" → label, entry, entry, button
- "search" → entry, button, treeview
All projects are tracked in ~/.pygubu-registry.json:
{
"projects": [
{
"name": "myapp",
"path": "/home/user/projects/myapp",
"ui_file": "myapp.ui",
"py_file": "myapp.py"
}
],
"active_project": "myapp"
}This enables:
- Access projects from any directory
- AI context awareness across sessions
- Quick project switching
Use @pygubu-context prompt in AI chats for automatic context loading.
Example conversation:
You: @pygubu-context Add a menu bar to my project
AI: [Loads active project context and suggests changes]
You: Change button color to blue
AI: [Updates the active project's UI file]
Creates a professional login form:
- Username label and entry
- Password label and entry (with show/hide)
- Login button
- Remember me checkbox
pygubu-template myapp loginFull CRUD interface:
- List view (Treeview)
- Add/Edit/Delete buttons
- Form fields
- Search functionality
pygubu-template admin crudTabbed settings dialog:
- Multiple tabs (General, Advanced, About)
- Various input types
- Save/Cancel buttons
pygubu-template config settingsMetrics dashboard:
- Multiple frames for widgets
- Labels for metrics
- Progress indicators
pygubu-template app dashboardMulti-step wizard:
- Step navigation
- Back/Next/Finish buttons
- Progress indicator
pygubu-template setup wizardTerminal 1: Watch for changes
pygubu-ai-workflow watch myappTerminal 2: Visual editing
pygubu-designer myapp/myapp.uiAI Chat:
"I added a menu bar in the designer, update the Python code"
The watch mode detects UI changes and prompts for code synchronization.
# Convert legacy code
tkinter-to-pygubu old_app.py
# Register the project
cd old_app
pygubu-register add .
# Modernize with AI
# In AI chat: "Modernize the UI with ttk widgets"# Create initial project
pygubu-create app 'simple calculator'
# Register it
pygubu-register active app
# Iterate with AI
# "Add memory functions"
# "Add scientific mode"
# "Improve layout"Problem: pygubu-create: command not found
Solution:
# Verify installation
pip list | grep pygubuai
# Reinstall
pip install -e .
# Check PATH
echo $PATH | grep -o "[^:]*bin"Problem: ModuleNotFoundError: No module named 'pygubu'
Solution:
pip install pygubu pygubu-designerProblem: FileNotFoundError: myapp.ui
Solution:
- Ensure you're in the project directory
- Check file exists:
ls *.ui - Verify path in Python file
Problem: Projects not showing in registry
Solution:
# Rescan projects
pygubu-register scan ~/projects
# Manually add
pygubu-register add /path/to/projectProblem: Scripts don't work on Windows
Solution:
- Use pip installation (preferred)
- Use Python directly:
python -m pygubuai.create - Check Python is in PATH
- Use pip installation - More reliable than shell scripts
- Register projects - Enable AI context awareness
- Use templates - Faster than creating from scratch
- Iterate with AI - Describe changes in natural language
- Version control - Commit both .ui and .py files
- Test frequently - Run
python myapp.pyafter changes
- Read Developer Guide for contributing
- Check Quick Reference for command cheat sheet
- Explore examples/ for sample projects
Need help? Open an issue on GitHub or check the documentation.