Skip to content
Build command line applications per project with ease
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
examples
features
lib
.gitignore
.travis.yml
CHANGELOG.md
Gemfile
LICENSE
README.md
Runfile
TODO.md
cucumber.yml
demo.gif
runfile.gemspec

README.md

Runfile - If Rake and Docopt had a baby

Gem Version Build Status BCH compliance Maintainability


A beautiful command line application framework.
Rake-inspired, Docopt inside.


Runfile lets you create command line applications in a way similar to Rake, but with the full power of Docopt command line options.

You create a Runfile, and execute commands with run command arguments -and --flags.

Runfile Demo

Learn More in the Wiki


Upgrade Notice:
If you are upgrading to 0.9.x - the name command was replaced with title.


Install

$ gem install runfile

Quick Start

$ run new        # create a new Runfile
$ run --help     # show the usage patterns
$ vi Runfile     # edit the Runfile

Example

The most minimal Runfile looks like this:

usage  "greet <name>"
action :greet do |args|
  puts "Hello #{args['<name>']}" 
end

You can then run it by executing this command:

$ run greet Luke
Hello Luke

Executing run without parameters, will show the usage patterns:

$ run
Usage:
  run greet <name>
  run (-h|--help|--version)

Executing run --help will show the full help document (docopt)

$ run --help
Runfile 0.0.0

Usage:
  run greet <name>
  run (-h|--help|--version)

Options:
  -h --help
      Show this screen

  --version
      Show version

Runfile per project or global Runfiles

In addition to the per project Runfile files, it is also possible to create global runfiles that are accessible to you only or to anybody on the system.

When you execute run, we will look for files in this order:

  • Runfile in the current directory
  • *.runfile in the current directory
  • ~/runfile/**/*.runfile
  • /etc/runfile/**/*.runfile

When you execute run!, we will ignore any local Runfile and only search for global (named) runfiles.

Read more in the Runfile Location and Filename wiki page

Documentation

You can’t perform that action at this time.