CARVIEW |
Select Language
HTTP/2 200
date: Fri, 25 Jul 2025 00:44:49 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-robots-tag: none
etag: W/"fbe95e1c4323bf2e9db91490f84e5a44"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=0ZSiwfKbJDAECYs%2F%2FtIBNOTc6xWtJdFXX9mvGGQD1VOLIphBYLGqbb6jGw%2FBsEwZhvS%2FiP0iNAbV2K%2Bu3PTry830yOqI9xRrucMPPG7a1wODhalJTh6IudrqZsS6bcw8i7QWAil4BRYufB%2BLRltpUZVXDmEbQrCXg62D6jc5BOJnxG1HjwG7eM2Xmm%2FpowhWknC632sghNbZdGGlMnK9IdW9VTH9rX%2FW1Tg9cN12qyStKbIUlt5Q7SWdj90M6xDLtnQCHDtcGCL85rRmjL15mQ%3D%3D--wO8dqRc2xF4xyG4O--qPMSwxi43kaB2dhye9SkJw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.736771224.1753404289; Path=/; Domain=github.com; Expires=Sat, 25 Jul 2026 00:44:49 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sat, 25 Jul 2026 00:44:49 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: BFFE:B7ECB:533E9:82342:6882D380
Home · davetron5000/gli Wiki · GitHub
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 106
Home
Alan W. Smith edited this page Jan 25, 2014
·
18 revisions
GLI lets you create command-suite (i.e. git-like) style applications in Ruby very easily.
Install if you need to:
> gem install gli
The simplest way to get started is to create a scaffold project. For example, a command-suite app named "todo" that has the commands "list", "add" and "complete" is created with:
> gli init todo list add complete
A new ./todo
directory is created containing the app. View the basic output of the scaffold with:
> cd todo
> bundle exec bin/todo help
Which will output:
NAME
todo - Describe your application here
SYNOPSIS
todo [global options] command [command options] [arguments...]
VERSION
0.0.1
GLOBAL OPTIONS
-f, --flagname=The name of the argument - Describe some flag here (default: the default)
--help - Show this message
-s, --[no-]switch - Describe some switch here
COMMANDS
add - Describe add here
complete - Describe complete here
help - Shows a list of commands or help for one command
list - Describe list here
> bin/todo help list
NAME
list - Describe list here
SYNOPSIS
todo [global options] list [command options] Describe arguments to list here
COMMAND OPTIONS
-f arg - Describe a flag to list (default: default)
-s - Describe a switch to list
As you can see, a lot of work has been done fore you, in terms of help output and command-line parsing. This is the point of GLI. All you need to do is fill in your app-specific logic.
The scaffold project that was created in ./todo
comes with:
- executable in
./todo/bin/todo
. This file demonstrates most of what you need to describe your command line interface. - an empty test in
./todo/test/default_test.rb
that can bootstrap your tests as well as a basic feature file infeatures
that you can run via aruba to do BDD-style tests - a
./todo.gemspec
shell - a README shell
- Rakefile that can generate RDoc, package your Gem, and run tests
- A
Gemfile
suitable for use with Bundler to manage development-time dependencies
See Features for a longer list of GLI's features. Also, see an Example of a gli program.
- Reference - List of all DSL methods for GLI
- Subcommands - How to create subcommands
- Controlling Help Output - More details on the various options available for controlling the output of the auto-generated help commands
- Declaring flags and switches - more details on the options available for declaring flags and switches
- Changelog - What's new in each version
- Contributing - How to contribute patches
- Developing - How to set up your development environment for GLI
- RubyDoc
- Source
You can’t perform that action at this time.