Skip to content
This repository has been archived by the owner on Jul 14, 2019. It is now read-only.

Generate Scaffolds

Alex Ford edited this page Mar 3, 2014 · 2 revisions

<< home


One of the most tedious tasks in shotgun is having to write command modules and other scripts. Shotgun can't write your applications for you, but it can help. Shotgun has the ability to generate scaffold templates for you if you install it globally.

$ npm install -g shotgun

Once shotgun is installed globally you should have access to a "shotgun" command in the terminal.

Command Module Scaffold

Probably the most common task you'll ever do in shotgun is write command modules. The basics of a command module are pretty simple but it can still get tedious when you have a lot of commands to write. Luckily, you can easily generate a command module scaffold.

$ shotgun cmd

First it will prompt you for the path to save the command module to. Next, it will ask you for a short description of the command which is displayed in the shotgun help menu. Lastly, it will ask you for a usage string that will also show up in the help menu. Once you have supplied the necessary information, it will generate a command module scaffold.

You can the template that it will generate here.

Shell Script Scaffold

The shotgun shell script is a shotgun application itself. You can make shotgun powered shell scripts too! Yes, there's a scaffold for that :)

$ shotgun shellscript

It will prompt you for a path where the script should be created. It will then generate a scaffold script that is ready to be run as a shell script. It will also generate a shotgun_cmds directory if one does not already exist.

You can see the template that it will generate here.


Next up: Publishing Your Command Modules to NPM >>

Clone this wiki locally