├── screenshot.png ├── README.md ├── LICENSE └── gh-userfetch /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheepla/gh-userfetch/HEAD/screenshot.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | 6 | # 👨‍💻 gh-userfetch 7 | 8 | An extension for [GitHub CLI](https://github.com/cli/cli) to show your GitHub profile inspired by [dylanaraps/neofetch](https://github.com/dylanaraps/neofetch) . 9 | 10 | 11 | 12 | ## Usage 13 | 14 | Just run `gh userfetch` but needs authentication with GitHub host: `gh auth login`. 15 | 16 | ## Installation 17 | 18 | Requires [GitHub CLI](https://github.com/cli/cli) v2.0.0+ and [stedolan/jq](https://github.com/stedolan/jq). 19 | 20 | ```bash 21 | gh extension install sheepla/gh-userfetch 22 | ``` 23 | 24 | ## TODO 25 | 26 | - [ ] configureable color 27 | - [ ] show profile image instead of octocat logo 28 | 29 | ## Contributing 30 | 31 | Welcome! 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Sheepla 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /gh-userfetch: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o nounset 4 | set -o errexit 5 | 6 | readonly COLOR_BG_BLACK="\033[40;1m" 7 | readonly COLOR_FG_BLACK="\033[30m" 8 | readonly COLOR_FG_HIGHLIGHT="\033[34;1m" 9 | readonly COLOR_NONE="\033[m" 10 | readonly INDICATOR="➤" 11 | 12 | readonly LOGO=" 13 | ${COLOR_BG_BLACK} ${COLOR_NONE} 14 | ${COLOR_BG_BLACK} !!;;;!!!! ${COLOR_NONE} 15 | ${COLOR_BG_BLACK} ;iii!! !i!ii; ${COLOR_NONE} 16 | ${COLOR_BG_BLACK} !VV! !VV! ${COLOR_NONE} 17 | ${COLOR_BG_BLACK} ;U! !U! ${COLOR_NONE} 18 | ${COLOR_BG_BLACK} b! ib ${COLOR_NONE} 19 | ${COLOR_BG_BLACK} ;B !b!ii! !Vi!b; B; ${COLOR_NONE} 20 | ${COLOR_BG_BLACK} !b b !VV!!;;!!iV; b b! ${COLOR_NONE} 21 | ${COLOR_BG_BLACK} B i V b ${COLOR_NONE} 22 | ${COLOR_BG_BLACK} i! Vi VV !i ${COLOR_NONE} 23 | ${COLOR_BG_BLACK} U Vi !i U ${COLOR_NONE} 24 | ${COLOR_BG_BLACK} U B Vi!i;!!;;!;!V!iU! i U ${COLOR_NONE} 25 | ${COLOR_BG_BLACK} U b !B V!V; ;U!V b! U U ${COLOR_NONE} 26 | ${COLOR_BG_BLACK} ii U; U U;##b b !U b ;V !i ${COLOR_NONE} 27 | ${COLOR_BG_BLACK} B b;!B b!V! !V!U b;;b B ${COLOR_NONE} 28 | ${COLOR_BG_BLACK} !b iViV!i; ;iiVVVV b! ${COLOR_NONE} 29 | ${COLOR_BG_BLACK} ;B !ii!VbUUiibUbV!ii! B; ${COLOR_NONE} 30 | ${COLOR_BG_BLACK} bi ib ${COLOR_NONE} 31 | ${COLOR_BG_BLACK} ;Ui iU; ${COLOR_NONE} 32 | ${COLOR_BG_BLACK} !VV! !VV! ${COLOR_NONE} 33 | ${COLOR_BG_BLACK} ;ii!!! ii!ii ${COLOR_NONE} 34 | ${COLOR_BG_BLACK} !!;;!;!! ${COLOR_NONE} 35 | ${COLOR_BG_BLACK} ${COLOR_NONE} 36 | " 37 | 38 | readonly JSON_KEYS=( 39 | "company" 40 | "blog" 41 | "location" 42 | "email" 43 | "twitter_username" 44 | "public_repos" 45 | "public_gists" 46 | "followers" 47 | "following" 48 | "created_at" 49 | "updated_at" 50 | ) 51 | 52 | function _main() { 53 | paste -d " " <(echo -e "${LOGO}") <(gh api "user" | _print_info) 54 | } 55 | 56 | function _get_value() { 57 | jq -r ".${1}"