Project

p5rb_cli

0.0
The project is in a healthy, maintained state
p5.rb CLI is a command-line tool that allows you to create p5.js-like sketches using Ruby. It provides commands to generate new sketches and run them in a local web server.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

~> 1.3
~> 1.9
 Project Readme

p5.rb CLI

p5.rb CLI is a command-line tool that makes it easy to start creative coding with Ruby, inspired by p5.js. Create interactive animations and visual art using Ruby's simple and elegant syntax.

Installation

gem install p5rb_cli

Usage

After installation, you can use the following commands:

Create a New Sketch

p5rb new <NAME>

This command generates a new p5.rb sketch in the specified directory. The generated sketch includes basic setup and sample code.

Run a Sketch

p5rb run <SCRIPT_FILE>

This command runs the specified sketch on a local server and displays it in your browser. The browser automatically updates when you make changes to your code.

Other Commands

To see detailed usage information:

p5rb help

Sample Code

def setup
  createCanvas(400, 400)
  background(220)
end

def draw
  fill(255, 0, 0)
  circle(mouseX, mouseY, 50)
end

Contributing

Bug reports and pull requests are welcome on GitHub at the p5rb_cli repository.

License

This project is available as open source under the terms of the MIT License.