Skip to content

Instantly share code, notes, and snippets.

@gtcarlos
Created May 18, 2015 12:56
Show Gist options
  • Save gtcarlos/f108fc3bcfcd015a0376 to your computer and use it in GitHub Desktop.
Save gtcarlos/f108fc3bcfcd015a0376 to your computer and use it in GitHub Desktop.
Create Github repositories from command line
#!/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)
@gtcarlos
Copy link
Author

Usage:

  • Move this script to /usr/bin or /usr/local/bin
  • Change with your Github username
  • With root access allow it to execute: sudo chmod +x /usr/bin/github_repo
  • Run at command line terminal $ github_repo
  • Fill desired repository name
  • Fill desired repository description
  • Provide your password
  • Done 😄

Based on: http://www.flaviobarros.net/2015/05/14/criando-repositorios-no-github-a-partir-shell/

@gtcarlos
Copy link
Author

TODO: minimal implementation: github_repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment