Getting started with Banana

Banana is a generic scaffolding system allowing the creation of any kind of app. It allows for rapidly getting started on new projects and streamlines the maintenance of existing projects.

Banana is language agnostic. It can generate projects in any language (Python, Nodejs, Ruby, Java, C#, etc.)

Banana by itself doesn’t make any decisions. Every decision is made by generators which are basically plugins in the Banana environment. Its easy to create a new generator to match any workflow. Banana is always the right choice for your scaffolding needs.

Here are some common use cases:

  • Rapidly create a new project
  • Create new sections of a project, like a new controller with unit tests
  • Create modules or packages
  • Bootstrapping new services
  • Enforcing standards, best practices and code styles
  • Promote new projects by letting users get started with a sample app

Getting started

ba is the Banana command line utility allowing the creation of projects utilizing scaffolding templates (referred to as generators). Yo and the generators used are installed using pip.

Installing ba and some generators

First thing is to install ba using pip:

pip install banana

Then install the needed generator(s). Generators are pip packages named banana-XYZ. Search for them on our website or on PyPI. To install the Lambda generator:

pip install banana-lambda

Basic scaffolding

We’ll use banana-lambda in our examples below. Replace lambda with the name of your generator for the same result.

To scaffold a new project, run:

ba lambda

Most generators will ask a series of questions to customize its templates for your new project. To see which options are available, use the help command:

ba lambda --help

A lot of generators rely on specific tools and technologies. Make sure to visit the generator’s site to learn about running and maintaining the new app. Easily access a generator’s home page by running:

TODO

pip home banana-lambda

Generators scaffolding complex frameworks are likely to provide additional generators to scaffold smaller parts of a project. These generators are usually referred to as sub-generators, and are accessed as generator:sub-generator.

Take generator-angular as an example. Once the full angular app has been generated, other features can be added. To add a new controller to the project, run the controller sub-generator:

ba angular:controller MyNewController

Other ba commands

Other than the basics covered in the previous section, ba is also a fully interactive tool. Simply typing ba in a terminal will provide a list of options to manage everything related to the generators: run, update, install, help and other utilities.

ba also provides the following commands.

  • ba --help Access the full help screen
  • ba --generators List every installed generators
  • ba --version Get the version

Creating a generator

See Authoring.