Created
May 18, 2015 12:56
-
-
Save gtcarlos/f108fc3bcfcd015a0376 to your computer and use it in GitHub Desktop.
Create Github repositories from command line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: UTF-8 | |
user = '<YOUR USERNAME HERE>' | |
puts 'Repository Name:' | |
name = gets.chomp | |
puts 'Repository Description:' | |
description = gets.chomp | |
command = %{curl -u #{user} https://api.github.com/user/repos -d '{"name": "#{name}", "description": "#{description}"}'} | |
puts command | |
system(command) |
TODO: minimal implementation: github_repo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
/usr/bin
or/usr/local/bin
sudo chmod +x /usr/bin/github_repo
$ github_repo
Based on: http://www.flaviobarros.net/2015/05/14/criando-repositorios-no-github-a-partir-shell/