p5-cli icon indicating copy to clipboard operation
p5-cli copied to clipboard

Define CLI functionality

Open kadamwhite opened this issue 10 years ago • 3 comments

@brysonian Tagging you and anybody else from the p5 team to help brainstorm: I'm making enough progress mocking up a quick, node-based CLI that I think it's worth defining what functionality I should add for an MVP.

My initial instincts are to define these commands:

  • p5 create
    • à la Famous, run p5 create <name> to generate an empty project
    • p5 create --sketch="existingfile.js" to create a project around an existing sketch? How useful would this be?
  • p5 server (p5 run?)
    • Run a basic web server in the current directory, for use with projects that have already been created

What else is essential for the first round?

kadamwhite avatar May 28 '15 04:05 kadamwhite

This is great news! i think those two are the most important. As much as I prefer server, is run more inline with processing and therefore a better option?

I'm not sure how useful the --create flag would be, i guess i can't think of a case where it would be too useful. I do think that serve could work with a single js file (ala famous) or a normal directory that includes and index and all that. Maybe that would be a useful distinction for separate serve and run commands?

brysonian avatar May 28 '15 07:05 brysonian

Thanks for the input, @brysonian. I began working on p5 serve last night, I'm hoping to have it set up to work in the two ways you indicate. I'm going to start by making it one command that will do both things as I experiment, but we should revisit whether serve and run should be two sep. commands later!

kadamwhite avatar May 29 '15 21:05 kadamwhite

So excited about this. I poked around with electron this morning and pretty quickly got a p5 app packaged as a mac app https://dl.dropboxusercontent.com/u/57593/reactive-spokes.zip I'll take a look at maybe integrating this into the cli, and perhaps building an electron app to provide a GUI version of all this wonderfulness.

brysonian avatar May 30 '15 17:05 brysonian