Skip to content

ReallyDev/PiForge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PiForge

AI Coding Builder for Raspberry Pi


Overview

PiForge is a local AI-powered coding workspace that runs on a Raspberry Pi.

It lets you:

  • generate project files from prompts
  • edit code from the browser
  • run safe commands
  • build Raspberry Pi, Python, and AI projects faster

PiForge runs locally in your browser, so once it is set up, you can access it on your Pi at:

http://localhost:8080

What PiForge Can Be Used For

PiForge is built for people who want to create projects quickly without starting from nothing.

Common uses:

  • Raspberry Pi GPIO projects
  • motor and sensor control apps
  • Flask and FastAPI apps
  • AI and automation tools
  • project scaffolding for Python apps
  • testing ideas before building larger systems

Examples:

  • a motor control app for a conveyor
  • a dashboard for live sensor data
  • a camera-based inspection project
  • a starter backend for an automation system

Installation Guide

These steps start from the point where the PiForge-raspberry-pi5.zip file is already downloaded into your Downloads folder.

1. Open Terminal

Open a terminal window on your Raspberry Pi.

2. Go to Downloads

cd ~/Downloads

3. Unzip PiForge

unzip PiForge-raspberry-pi5.zip

This creates a folder named:

PiForge

4. Move PiForge to a better project location

This keeps the app out of Downloads and avoids setup issues.

mkdir -p ~/projects
rm -rf ~/projects/PiForge
cp -r ~/Downloads/PiForge ~/projects/PiForge
cd ~/projects/PiForge

5. Create a Python virtual environment

python3 -m venv .venv

6. Activate the virtual environment

source .venv/bin/activate

7. Install dependencies

python -m pip install --upgrade pip
python -m pip install -r requirements.txt

8. Create the environment file

cp .env.example .env

9. Start PiForge

python app.py

10. Open PiForge in your browser

http://localhost:8080

If you are using another device on the same network, use your Pi's local IP address instead.


How to Keep PiForge Running Constantly

The best way to keep PiForge running in the background and automatically start it when the Raspberry Pi boots is with a systemd service.

1. Create the service file

sudo nano /etc/systemd/system/piforge.service

2. Paste this into the file

Replace benp if your Raspberry Pi username is different.

[Unit]
Description=PiForge AI Coding Builder
After=network.target

[Service]
User=benp
WorkingDirectory=/home/benp/projects/PiForge
ExecStart=/home/benp/projects/PiForge/.venv/bin/python /home/benp/projects/PiForge/app.py
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target

3. Save and exit

  • Press Ctrl + X
  • Press Y
  • Press Enter

4. Reload systemd

sudo systemctl daemon-reload

5. Enable PiForge on startup

sudo systemctl enable piforge

6. Start PiForge now

sudo systemctl start piforge

7. Check service status

sudo systemctl status piforge

If everything is working, PiForge will now:

  • start automatically every time the Pi boots
  • restart itself if it crashes
  • keep running in the background

Helpful service commands

Restart PiForge:

sudo systemctl restart piforge

Stop PiForge:

sudo systemctl stop piforge

View live logs:

journalctl -u piforge -f

How to Use PiForge

1. Open the app

Go to:

http://localhost:8080

2. Create a new project

Enter a project name and create it.

Your generated projects are stored inside:

~/projects/PiForge/projects/

3. Enter a prompt

Tell PiForge what you want to build.

Examples:

Build a Flask dashboard for inventory tracking
Create a Raspberry Pi motor control app using GPIO
Build a FastAPI backend for a sensor system
Create a starter project for AI image inspection

4. Let PiForge generate files

PiForge will:

  • create the project structure
  • generate starter code
  • write files into the project folder

5. Edit and improve the code

You can then:

  • open files in the interface
  • update them manually
  • give more prompts to improve the project

Examples:

Add error handling
Improve logging
Add comments to explain the code

6. Run commands

PiForge supports safe command execution for common development tasks.

Examples:

python main.py
pip install gpiozero
npm install

How PiForge Works

PiForge has three main parts.

Web Interface

The frontend runs in your browser and gives you a simple place to create projects and send prompts.

AI Project Generator

The backend takes your prompt, plans the files needed, and generates starter code.

Local Tool System

PiForge can create folders, write files, edit code, and run safe development commands.

This makes it more than a chatbot. It acts like a lightweight project builder on your Raspberry Pi.


Example Project Ideas

PiForge works well for:

  • GPIO control scripts
  • AI-assisted automation tools
  • motor control systems
  • Coral-based computer vision projects
  • dashboards for sensors or inventory
  • quick Python app prototypes
  • educational coding projects

Troubleshooting

PiForge does not open in the browser

Make sure the service is running:

sudo systemctl status piforge

Restart the service

sudo systemctl restart piforge

Reinstall dependencies

From the project folder:

cd ~/projects/PiForge
source .venv/bin/activate
python -m pip install -r requirements.txt

Port 8080 is already being used

Check what is using it:

lsof -i :8080

Summary

PiForge turns a Raspberry Pi into a local AI coding workspace.

With it, you can:

  • go from idea to starter project fast
  • generate and edit code locally
  • build Raspberry Pi and automation projects more efficiently
  • keep the app running all the time with systemd

PiForge is a practical starting point for developers, students, and makers who want a simple AI-assisted coding environment on Raspberry Pi.

About

PiForge is a local AI-powered coding workspace that runs on a Raspberry Pi.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors