Add Examples to CLI
See original GitHub issueI’ve got some examples so far, but most of them are more ‘unit tests’ to make sure it all works.
It would be great if the CLI could run a “Example Viewer” mode before generating a new sketch. Such as:
canvas-sketch --new --examples
The browser will list a thumbnail grid with examples, and clicking one will generate it from the template and start the server on that file.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Command Line Interface (CLI) Examples - Globus Docs
The following examples are all written for a Bash shell. If you are running another shell you may need to modify the non...
Read more >How to Add CLI command to Connect applications
To add new CLI command first open AppBuilder (it opens automatically when new project created) and switch to the Printing tab. In the...
Read more >Let's Build a CLI | Command Line Interface Tutorial by ...
To start, when we say "CLI" or "command line utility," we're talking about a program that we can run at the command line...
Read more >What is a command-line interface (CLI)? - TechTarget
What is a command-line interface? A command-line interface (CLI) is a text-based user interface (UI) used to run programs, manage computer files and ......
Read more >Build Command-Line Interfaces With Python's argparse
To add arguments and options to an argparse CLI, you'll use the .add_argument() method of your ArgumentParser instance. Note that the method is ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’ve started stubbing out a very basic Preact frontend that holds some of the examples. The
feature/websitebranch has some of that work-in-progress.You can test it here: https://competent-beaver-2ad4cc.netlify.com/
I haven’t bothered with any fancy design yet – will likely do a generative/interactive Canvas background using
canvas-sketchitself.While doing this, I’m realizing it’s really awesome to have a “sketchbook” that can collect all the sketches in a single folder, and most of the code I’m writing for the website could be pulled into the
canvas-sketch-clitool as well. For example,canvas-sketch foo.jscould run a single sketch, orcanvas-sketchbook src/*.jscould wrap all the sketches insrc/folder with a similar interface as in the website. The sketchbook (during dev) could easily have a “Add New Sketch” button (WebSockets that connect to node server) and some other handy features.Still figuring out the best way to structure all that – ideally it should be re-usable enough that the
canvas-sketchwebsite itself can use thecanvas-sketch-cli… 😄Thanks!
I think the online Examples viewer will show code + result, but also a “Copy Code” button that simply copies it to clipboard.
The tool should already be ready to accept clipboard contents (and install any dependencies) like this: