https://github.com/JEG2/highline
A higher level command-line oriented interface.
https://github.com/JEG2/highline
Keywords from Contributors
rubygems activerecord mvc activejob rubocop rack sinatra feature-flag crash-reporting code-formatter
Last synced: about 17 hours ago
JSON representation
Repository metadata
A higher level command-line oriented interface.
- Host: GitHub
- URL: https://github.com/JEG2/highline
- Owner: JEG2
- License: other
- Created: 2009-02-02T16:25:53.000Z (over 17 years ago)
- Default Branch: master
- Last Pushed: 2026-03-19T01:39:35.000Z (2 months ago)
- Last Synced: 2026-05-16T01:45:17.640Z (8 days ago)
- Language: Ruby
- Homepage:
- Size: 2.21 MB
- Stars: 1,303
- Watchers: 18
- Forks: 137
- Open Issues: 12
- Releases: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- License: COPYING
- Authors: AUTHORS
README.md
HighLine
Description
Welcome to HighLine.
HighLine was designed to ease the tedious tasks of doing console input and
output with low-level methods like gets and puts. HighLine provides a
robust system for requesting data from a user, without needing to code all the
error checking and validation rules and without needing to convert the typed
Strings into what your program really needs. Just tell HighLine what you're
after, and let it do all the work.
Documentation
See: Rubydoc.info for HighLine.
Specially HighLine and HighLine::Question.
Usage
require 'highline'
# Basic usage
cli = HighLine.new
answer = cli.ask "What do you think?"
puts "You have answered: #{answer}"
# Default answer
cli.ask("Company? ") { |q| q.default = "none" }
## Disable default value hint showing
my_special_default_object = Object.new
cli.ask("Question? ") do |q|
q.default = my_special_default_object
q.default_hint_show = false
end
# Validation
cli.ask("Age? ", Integer) { |q| q.in = 0..105 }
cli.ask("Name? (last, first) ") { |q| q.validate = /\A\w+, ?\w+\Z/ }
## Validation with custom class
class ZeroToTwentyFourValidator
def self.valid?(answer)
(0..24).include? answer.to_i
end
def self.inspect
"(0..24) rule"
end
end
cli.ask("What hour of the day is it?: ", Integer) do |q|
q.validate = ZeroToTwentyFourValidator
end
## Validation with Dry::Types
## `Dry::Types` provides a `valid?` method so it can be used effortlessly
require 'dry-type'
module Types
include Dry.Types
end
cli.ask("Type an integer:", Integer) do |q|
q.validate = Types::Coercible::Integer
end
# Type conversion for answers:
cli.ask("Birthday? ", Date)
cli.ask("Interests? (comma sep list) ", lambda { |str| str.split(/,\s*/) })
# Reading passwords:
cli.ask("Enter your password: ") { |q| q.echo = false }
cli.ask("Enter your password: ") { |q| q.echo = "x" }
# ERb based output (with HighLine's ANSI color tools):
cli.say("This should be <%= color('bold', BOLD) %>!")
# Menus:
cli.choose do |menu|
menu.prompt = "Please choose your favorite programming language? "
menu.choice(:ruby) { cli.say("Good choice!") }
menu.choices(:python, :perl) { cli.say("Not from around here, are you?") }
menu.default = :ruby
end
## Using colored indices on Menus
HighLine::Menu.index_color = :rgb_77bbff # set default index color
cli.choose do |menu|
menu.index_color = :rgb_999999 # override default color of index
# you can also use constants like :blue
menu.prompt = "Please choose your favorite programming language? "
menu.choice(:ruby) { cli.say("Good choice!") }
menu.choices(:python, :perl) { cli.say("Not from around here, are you?") }
end
If you want to save some characters, you can inject/import HighLine methods on Kernel by doing the following. Just be sure to avoid name collisions in the top-level namespace.
require 'highline/import'
say "Now you can use #say directly"
For more examples see the examples/ directory of this project.
Requirements
HighLine from version >= 3.0.0 requires ruby >= 3.0.0
Installing
To install HighLine, use the following command:
$ gem install highline
(Add sudo if you're installing under a POSIX system as root)
If you're using Bundler, add this to your Gemfile:
source "https://rubygems.org"
gem 'highline'
And then run:
$ bundle
If you want to build the gem locally, use the following command from the root of the sources:
$ rake package
You can also build and install directly:
$ rake install
Contributing
- Open an issue
- Fork the repository
- Clone it locally
git clone git@github.com:YOUR-USERNAME/highline.git
- Add the main HighLine repository as the upstream remote
cd highline# to enter the cloned repository directory.git remote add upstream https://github.com/JEG2/highline
- Keep your fork in sync with upstream
git fetch upstreamgit checkout mastergit merge upstream/master
- Create your feature branch
git checkout -b your_branch
- Hack the source code, run the tests and pronto
rake testrake acceptancepronto run
Alternatively, if you're in a Dockerised environment,
don't care about installing anything locally -- just run bin/test instead.
- Commit your changes
git commit -am "Your commit message"
- Push it
git push
- Open a pull request
Details on:
- GitHub Guide to Contributing to Open Source - https://guides.github.com/activities/contributing-to-open-source/
- GitHub issues - https://guides.github.com/features/issues/
- Forking - https://help.github.com/articles/fork-a-repo/
- Cloning - https://help.github.com/articles/cloning-a-repository/
- Adding upstream - https://help.github.com/articles/configuring-a-remote-for-a-fork/
- Syncing your fork - https://help.github.com/articles/syncing-a-fork/
- Branching - https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging
- Commiting - https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository
- Pushing - https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes
The Core HighLine Team
- James Edward Gray II - Author
- Gregory Brown - Core contributor
- Abinoam P. Marques Jr. - Core contributor
For a list of people who have contributed to the codebase, see GitHub's list of contributors.
Owner metadata
- Name: James Edward Gray II
- Login: JEG2
- Email:
- Kind: user
- Description:
- Website: http://graysoftinc.com/
- Location: Edmond, OK, USA
- Twitter:
- Company: Gray Productions Software Inc.
- Icon url: https://avatars.githubusercontent.com/u/5639?u=73f116b401a9e0f28670602dd05335718abecec5&v=4
- Repositories: 150
- Last ynced at: 2023-04-09T06:01:36.058Z
- Profile URL: https://github.com/JEG2
GitHub Events
Total
- Pull request event: 7
- Fork event: 5
- Issues event: 3
- Watch event: 17
- Issue comment event: 13
- Push event: 4
- Create event: 3
Last Year
- Pull request event: 3
- Fork event: 1
- Issues event: 1
- Watch event: 2
- Issue comment event: 5
- Create event: 1
Committers metadata
Last synced: 2 days ago
Total Commits: 1,059
Total Committers: 72
Avg Commits per committer: 14.708
Development Distribution Score (DDS): 0.412
Commits in past year: 1
Committers in past year: 1
Avg Commits per committer in past year: 1.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| Abinoam Praxedes Marques Jr | a****m@g****m | 623 |
| James Gray | j****s@g****t | 151 |
| Gregory Brown | g****n@g****m | 50 |
| Tom Copeland | n****e@n****m | 25 |
| matugm | m****m@g****m | 22 |
| Richard LeBer | r****r@g****m | 18 |
| matrinox | g****1@m****m | 12 |
| Dāvis | d****h@g****m | 10 |
| Justin Collins | j****n@p****m | 10 |
| Mina Nagy Zaki | m****i@g****m | 8 |
| Marcus Stollsteimer | s****r@w****e | 8 |
| Stephen Bannasch | s****h@g****m | 7 |
| Peter Goldstein | p****n@g****m | 6 |
| Thomas Dudziak | t****s@n****m | 5 |
| Aregic | a****c@g****m | 5 |
| Keith Bennett | k****t@v****m | 4 |
| Ana María Martínez Gómez | a****a@m****e | 4 |
| Frederico | f****t@g****m | 4 |
| Lachlan Dowding | l****g@g****m | 4 |
| michael | m****l@i****t | 3 |
| Koichi ITO | k****o@g****m | 3 |
| Kenichi Kamiya | k****1@g****m | 3 |
| Fission Xuiptz | f****z@s****m | 3 |
| Eli Young | e****e@g****m | 3 |
| Aaron D. Gifford | h****/ | 3 |
| Scott Gonyea | s****a@t****m | 3 |
| mmihira | m****w@g****m | 3 |
| Costa Shapiro | c****a@m****m | 2 |
| Chad Gorshing | g****g@g****m | 2 |
| Eric Saxby | s****x@l****g | 2 |
| and 42 more... | ||
Committer domains:
- me.com: 3
- grayproductions.net: 1
- none.com: 1
- presidentbeef.com: 1
- ning.com: 1
- verisign.com: 1
- martinezgomez.name: 1
- iconoclast.net: 1
- softwaremojo.com: 1
- truecar.com: 1
- mouldwarp.com: 1
- livinginthepast.org: 1
- thebrocks.net: 1
- rossmeissl.net: 1
- o2h.cz: 1
- cerner.com: 1
- km4n.com: 1
- ronie.com.br: 1
- qq.com: 1
- tiscali.cz: 1
- detailedbalance.net: 1
- peterhiggins.org: 1
- pobox.com: 1
- atg.auto: 1
- titorenko.net: 1
- kevinlocke.name: 1
- suse.de: 1
- flameeyes.eu: 1
- nilbus.com: 1
- jeffwidman.com: 1
- jc00ke.com: 1
- johnleach.co.uk: 1
Issue and Pull Request metadata
Last synced: 5 days ago
Total issues: 49
Total pull requests: 76
Average time to close issues: over 1 year
Average time to close pull requests: 18 days
Total issue authors: 43
Total pull request authors: 29
Average comments per issue: 4.27
Average comments per pull request: 2.38
Merged pull request: 65
Bot issues: 0
Bot pull requests: 0
Past year issues: 2
Past year pull requests: 1
Past year average time to close issues: 20 days
Past year average time to close pull requests: about 8 hours
Past year issue authors: 2
Past year pull request authors: 1
Past year average comments per issue: 4.5
Past year average comments per pull request: 1.0
Past year merged pull request: 1
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- abinoam (3)
- costa (2)
- jblaine (2)
- tukanos (2)
- maurobender (2)
- satmandu (1)
- Joshfindit (1)
- dantman (1)
- aspyct (1)
- doriantaylor (1)
- esotericpig (1)
- 64kramsystem (1)
- pineapplethief (1)
- guyisra (1)
- Fryguy (1)
Top Pull Request Authors
- abinoam (37)
- koic (3)
- zvkemp (2)
- fredrb (2)
- blipper (2)
- olleolleolle (2)
- davidjkling (2)
- mark-young-atg (2)
- costa (2)
- petergoldstein (2)
- matrinox (2)
- pietromenna (1)
- LinusU (1)
- tukanos (1)
- kevinoid (1)
Top Issue Labels
- feature request (15)
- bug (9)
- question (6)
Top Pull Request Labels
- feature request (4)
- bug (2)
Package metadata
- Total packages: 15
-
Total downloads:
- rubygems: 637,812,157 total
- Total docker downloads: 632,460,042
- Total dependent packages: 1,560 (may contain duplicates)
- Total dependent repositories: 77,935 (may contain duplicates)
- Total versions: 201
- Total maintainers: 4
gem.coop: highline
A high-level IO library that provides validation, type conversion, and more for command-line interfaces. HighLine also includes a complete menu system that can crank out anything from simple list selection to complete shells with just minutes of work.
- Homepage: https://github.com/JEG2/highline
- Documentation: http://www.rubydoc.info/gems/highline/
- Licenses: Ruby
- Latest release: 3.1.2 (published over 1 year ago)
- Last Synced: 2026-05-22T02:31:05.198Z (2 days ago)
- Versions: 72
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 318,935,947 Total
- Docker Downloads: 316,230,021
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Downloads: 0.082%
- Average: 0.12%
- Docker downloads count: 0.4%
- Maintainers (4)
rubygems.org: highline
A high-level IO library that provides validation, type conversion, and more for command-line interfaces. HighLine also includes a complete menu system that can crank out anything from simple list selection to complete shells with just minutes of work.
- Homepage: https://github.com/JEG2/highline
- Documentation: http://www.rubydoc.info/gems/highline/
- Licenses: Ruby
- Latest release: 3.1.2 (published over 1 year ago)
- Last Synced: 2026-05-21T19:01:01.455Z (2 days ago)
- Versions: 72
- Dependent Packages: 1,560
- Dependent Repositories: 77,935
- Downloads: 318,876,210 Total
- Docker Downloads: 316,230,021
-
Rankings:
- Dependent packages count: 0.033%
- Downloads: 0.079%
- Dependent repos count: 0.132%
- Docker downloads count: 0.496%
- Average: 0.774%
- Stargazers count: 1.714%
- Forks count: 2.19%
- Maintainers (4)
proxy.golang.org: github.com/JEG2/highline
- Homepage:
- Documentation: https://pkg.go.dev/github.com/JEG2/highline#section-documentation
- Licenses: other
- Latest release: v3.1.2+incompatible (published over 1 year ago)
- Last Synced: 2026-05-20T03:02:06.524Z (4 days ago)
- Versions: 23
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Stargazers count: 1.836%
- Forks count: 2.329%
- Average: 6.136%
- Dependent packages count: 9.576%
- Dependent repos count: 10.802%
proxy.golang.org: github.com/jeg2/highline
- Homepage:
- Documentation: https://pkg.go.dev/github.com/jeg2/highline#section-documentation
- Licenses: other
- Latest release: v3.1.2+incompatible (published over 1 year ago)
- Last Synced: 2026-05-20T03:02:06.320Z (4 days ago)
- Versions: 23
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Stargazers count: 1.836%
- Forks count: 2.329%
- Average: 6.136%
- Dependent packages count: 9.576%
- Dependent repos count: 10.802%
debian-13: ruby-highline
- Homepage: https://github.com/JEG2/highline
- Documentation: https://packages.debian.org/trixie/ruby-highline
- Licenses: other
- Latest release: 3.1.2-1 (published 3 months ago)
- Last Synced: 2026-03-14T18:09:40.838Z (2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-24.04: ruby-highline
- Homepage: https://github.com/JEG2/highline
- Licenses: other
- Latest release: 3.0.1-1 (published 4 months ago)
- Last Synced: 2026-03-06T15:59:21.440Z (3 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-12: ruby-highline
- Homepage: https://github.com/JEG2/highline
- Documentation: https://packages.debian.org/bookworm/ruby-highline
- Licenses: other
- Latest release: 2.0.3-2 (published 3 months ago)
- Last Synced: 2026-03-13T23:43:29.046Z (2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-24.10: ruby-highline
- Homepage: https://github.com/JEG2/highline
- Licenses: other
- Latest release: 3.0.1-1 (published 3 months ago)
- Last Synced: 2026-03-09T17:06:39.996Z (3 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-23.10: ruby-highline
- Homepage: https://github.com/JEG2/highline
- Licenses: other
- Latest release: 2.0.3-2 (published 3 months ago)
- Last Synced: 2026-03-14T03:14:29.197Z (2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-10: ruby-highline
- Homepage: https://github.com/JEG2/highline
- Documentation: https://packages.debian.org/buster/ruby-highline
- Licenses: other
- Latest release: 1.7.8-1 (published 3 months ago)
- Last Synced: 2026-03-13T19:03:58.304Z (2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-11: ruby-highline
- Homepage: https://github.com/JEG2/highline
- Documentation: https://packages.debian.org/bullseye/ruby-highline
- Licenses: other
- Latest release: 2.0.3-2 (published 3 months ago)
- Last Synced: 2026-03-14T06:23:12.409Z (2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-23.04: ruby-highline
- Homepage: https://github.com/JEG2/highline
- Licenses: other
- Latest release: 2.0.3-2 (published 3 months ago)
- Last Synced: 2026-03-11T18:33:32.268Z (2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-22.04: ruby-highline
- Homepage: https://github.com/JEG2/highline
- Licenses: other
- Latest release: 2.0.3-2 (published 3 months ago)
- Last Synced: 2026-03-13T23:37:28.011Z (2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-20.04: ruby-highline
- Homepage: https://github.com/JEG2/highline
- Licenses: other
- Latest release: 2.0.3-1 (published 3 months ago)
- Last Synced: 2026-03-13T14:28:24.360Z (2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
guix: ruby-highline
HighLine helps you build command-line interfaces
- Homepage: https://github.com/JEG2/highline
- Documentation: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/ruby-xyz.scm#n163
- Licenses: gpl2, ruby
- Latest release: 3.1.2 (published 3 months ago)
- Last Synced: 2026-04-27T16:19:10.987Z (26 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
Dependencies
- flog >= 0 development
- pronto >= 0 development
- pronto-flay >= 0 development
- pronto-poper >= 0 development
- pronto-reek >= 0 development
- pronto-rubocop >= 0 development
- simplecov >= 0 development
- bundler >= 0 development
- minitest >= 0 development
- rake >= 0 development
- actions/checkout v3 composite
- ruby/setup-ruby v1 composite
Score: 32.42081977944957