<commit_before># Octonaut

A little CLI sugar for the GitHub API, built with [gli][] and [Octokit][].

**Still early. Rapidly evolving.** Why not [help out][contributing]?

### Why not `hub`?

[hub][] is great, you should use it. But hub focuses mostly on smoothing the
git workflow for GitHub and most commands are in the context of a GitHub
repository.

Octonaut is more general purpose CLI for the GitHub API. Oh and [plugins][].

### Installation

Install via Rubygems:

```
gem install octonaut
```

### Example usage
```
$ octonaut
NAME
    octonaut - Octokit-powered CLI for GitHub

SYNOPSIS
    octonaut [global options] command [command options] [arguments...]

GLOBAL OPTIONS
    -a, --[no-]auto_traversal      - Automatically fetch all pages of paginated results
    --help                         - Show this message
    -n, --[no-]netrc               - Use .netrc file for authentication
    -p, --password=arg             - GitHub password (default: ********)
    -t, --oauth_token, --token=arg - GitHub API token (default: ********)
    -u, --login=arg                - GitHub login (default: none)

COMMANDS
    browse              - Browse resource on github.com
    follow              - Follow a user
    followers           - View followers for a user
    following           - View who a user is following
    follows             - Check to see if a user follows another
    help                - Shows a list of commands or help for one command
    langs, languages    - Display languages for a repo
    me                  - View your profile
    repo, repository    - Display details for a repository
    repos, repositories - List repositories for a user or organization
    say                 - An plugin method
    unfollow            - Unfollow a user
    user, whois         - View profile for a user
```

View a user's profile:

```
$ octonaut whois cloudhead
       ID 40774
   JOINED 2008-12-16T15:09:49Z
    LOGIN cloudhead
     NAME <NAME>
  COMPANY SoundCloud, Ltd.
 LOCATION Berlin
FOLLOWERS 2347
FOLLOWING 48
 HIREABLE true
      URL http://twitter.com/cloudhead
```

Browse a user on github.com in your default browser:

```
$ octonaut browse cloudhead
```

List followers:
```
$ octonaut followers pengwynn
krisbulman
camdub
cglee
nextmat
zachinglis
seaofclouds
njonsson
davidnorth
polomasta
webiest
mchelen
brogers
marclove
adamstac
marshall
asenchi
piyush
rmetzler
nileshtrivedi
sferik
jimmybaker
jnunemaker
peterberkenbosch
leah
jakestutzman
nkabbara
etagwerker
vagostino
johan--
bry4n
...
```

Follow a user:
```
$ octonaut follow linus
Followed linus.
```

Unfollow a user:
```
$ octonaut unfollow pengwynn
Unfollowed pengwynn.
```

## Extend with plugins

Octonaut makes it simple to extend the CLI with new commands just by adding
some Ruby files to `~/.octonaut/plugins`:

```
$ cat ~/.octonaut/plugins/test.rb
module Octonaut

  desc 'An plugin method'
  arg_name 'text'
  command :say do |c|
    c.action do |global,options,args|
      puts @client.say args.shift
    end
  end
end

$ octonaut say "hello from plugins"

           MMM.           .MMM
           MMMMMMMMMMMMMMMMMMM
           MMMMMMMMMMMMMMMMMMM      ____________________
          MMMMMMMMMMMMMMMMMMMMM    |                    |
         MMMMMMMMMMMMMMMMMMMMMMM   | hello from plugins |
        MMMMMMMMMMMMMMMMMMMMMMMM   |_   ________________|<commit_msg>Update README with config, plugins changes<commit_after># Octonaut

A little CLI sugar for the GitHub API, built with [gli][] and [Octokit][].

**Still early. Rapidly evolving.** Why not [help out][contributing]?

### Why not `hub`?

[hub][] is great, you should use it. But hub focuses mostly on smoothing the
git workflow for GitHub and most commands are in the context of a GitHub
repository.

Octonaut is more general purpose CLI for the GitHub API. Oh and [plugins][].

### Installation

Install via Rubygems:

```
gem install octonaut
```

### Example usage
```
$ octonaut
NAME
    octonaut - Octokit-powered CLI for GitHub

SYNOPSIS
    octonaut [global options] command [command options] [arguments...]

GLOBAL OPTIONS
    -a, --[no-]auto_traversal      - Automatically fetch all pages of paginated results
    --help                         - Show this message
    -n, --[no-]netrc               - Use .netrc file for authentication
    --netrc-file=arg               - .netrc file for authentication (default: none)
    -p, --password=arg             - GitHub password (default: ********)
    -t, --oauth_token, --token=arg - GitHub API token (default: ********)
    -u, --login=arg                - GitHub login (default: none)

COMMANDS
    browse              - Browse resource on github.com
    follow              - Follow a user
    followers           - View followers for a user
    following           - View who a user is following
    follows             - Check to see if a user follows another
    help                - Shows a list of commands or help for one command
    initconfig          - Initialize the config file using current global options
    langs, languages    - Display languages for a repo
    me                  - View your profile
    repo, repository    - Display details for a repository
    repos, repositories - List repositories for a user or organization
    unfollow            - Unfollow a user
    user, whois         - View profile for a user
```

View a user's profile:

```
$ octonaut whois cloudhead
       ID 40774
   JOINED 2008-12-16T15:09:49Z
    LOGIN cloudhead
     NAME <NAME>
  COMPANY SoundCloud, Ltd.
 LOCATION Berlin
FOLLOWERS 2347
FOLLOWING 48
 HIREABLE true
      URL http://twitter.com/cloudhead
```

Browse a user on github.com in your default browser:

```
$ octonaut browse cloudhead
```

List followers:
```
$ octonaut followers pengwynn
krisbulman
camdub
cglee
nextmat
zachinglis
seaofclouds
njonsson
davidnorth
polomasta
webiest
mchelen
brogers
marclove
adamstac
marshall
asenchi
piyush
rmetzler
nileshtrivedi
sferik
jimmybaker
jnunemaker
peterberkenbosch
leah
jakestutzman
nkabbara
etagwerker
vagostino
johan--
bry4n
...
```

Follow a user:
```
$ octonaut follow linus
Followed linus.
```

Unfollow a user:
```
$ octonaut unfollow pengwynn
Unfollowed pengwynn.
```

## Extend with plugins

Octonaut makes it simple to extend the CLI with new commands just by adding
some Ruby files to `~/.octonaut/plugins`:

```
$ cat ~/.octonaut_plugins/test.rb
module Octonaut

  desc 'An plugin method'
  arg_name 'text'
  command :say do |c|
    c.action do |global,options,args|
      puts @client.say args.shift
    end
  end
end

$ export OCTONAUT_PLUGINS_PATH=~./octonaut_plugins
$ octonaut say "hello from plugins"

           MMM.           .MMM
           MMMMMMMMMMMMMMMMMMM
           MMMMMMMMMMMMMMMMMMM      ____________________
          MMMMMMMMMMMMMMMMMMMMM    |                    |
         MMMMMMMMMMMMMMMMMMMMMMM   | hello from plugins |
        MMMMMMMMMMMMMMMMMMMMMMMM   |_   ________________|
{'fraction_non_alphanumeric': 0.07854984894259819, 'fraction_numerical': 0.007480937994533161, 'mean_word_length': 2.5128852956038403, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 10, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6284229', 'n_tokens_mistral': 2247, 'n_tokens_neox': 2085, 'n_words': 755}