• This repository has been archived on 10/Feb/2024
  • Stars
    star
    151
  • Rank 246,057 (Top 5 %)
  • Language
    Go
  • License
    MIT License
  • Created about 2 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

:octocat: Use multiple GitHub accounts with the gh cli.

gh-profile

Build Go Report Card

Work with multiple GitHub accounts using the gh cli.

gh-profile demo

Installation

gh extension install gabe565/gh-profile

Usage

See the generated usage docs, or see a summary of each subcommand below.

Note As of v2.26.0, the gh cli now uses secure auth tokens by default. Secure auth tokens are not yet supported by gh-profile, so when logging into GitHub, make sure to run:
gh auth login --insecure-storage

  • gh profile create [NAME]: Creates a new profile.

    Details

    Aliases: c, new, add

    Params:

    • NAME is optional. If not set, command will run interactively.

    Example:

    $ gh profile create example
    ✨ Creating profile: example
    πŸ”§ Activating global profile: example
  • gh profile switch [NAME] [--local-dir]: Activates a profile.

    Details

    Aliases: activate, active, sw, s

    Params:

    • NAME is optional. If not set, command will run interactively.
      • If set to -, gh-profile will switch back to the previous profile.
    • --local-dir/-l activates the profile only for the current directory.
      • For this to work, you must install a per-directory env tool like direnv.

    Example:

    $ gh profile switch example
    πŸ”§ Activating global profile: example
  • gh profile rename [NAME] [NEW_NAME]: Renames a profile.

    Details

    Aliases: mv

    Params:

    • NAME and NEW_NAME are optional. If not set, command will run interactively.

    Example:

    $ gh profile rename example example2
    🚚 Renaming profile: example to example2
    πŸ”§ Activating global profile: example2
  • gh profile list: Lists all profiles. Active profile will be bold with a green check.

    Details

    Aliases: ls, l

    Example:

    $ gh profile list
    βœ“ example
      gabe565
  • gh profile remove [NAME]: Removes a profile.

    Details

    Aliases: delete, rm, d

    Params:

    • NAME is optional. If not set, command will run interactively.

    Example:

    $ gh profile remove example2
    πŸ”₯ Removing profile: example2
  • gh profile show: Prints the active profile name. If no profile is active, nothing will be printed. Useful as a prompt element.

    Details

    Example:

    $ gh profile show
    example

Prompt Element

gh profile show is useful for displaying the current profile in your shell's prompt. This command will work for any prompt, but configuration with Powerlevel10k is provided below.

Powerlevel10k

Powerlevel10k ships with a custom formatter for git repositories. This formatter can be easily modified to show the current profile.

  1. Edit ~/.p10k.zsh.
  2. Find the my_git_formatter function
  3. Find the line local res
  4. Add the following below that line:
        local profile="$(gh profile show 2>/dev/null)"
        [[ -n "$profile" ]] && res+="$profile "

Now, the current profile will be shown when you are in a git repo!

Example

Before After
Before After

More Repositories

1

CastSponsorSkip

⏭️ Skip YouTube ads and sponsorships on all local Google Cast devices
Go
289
star
2

ascii-movie

🌌 Star Wars SSH + Telnet server written in Go
Go
185
star
3

charts

☸️ A collection of Helm charts, based on the bjw-s common library chart.
YAML
93
star
4

popup-backdrop-filter

JavaScript
44
star
5

linuxserver-mod-vuetorrent

Docker mod that installs VueTorrent to the LinuxServer.io qBittorrent images
Dockerfile
41
star
6

esphome-configs

πŸ’Ύ A collection of my personal ESPHome configs and packages.
YAML
27
star
7

gones

πŸ•ΉοΈ An NES emulator written in Go.
Go
17
star
8

nightscout-menu-bar

🩸 Display live blood sugar data from Nightscout in your system menu bar
Go
17
star
9

domain-watch

πŸ”” Get notified about domain changes as they happen.
Go
17
star
10

docker-obico

Pre-built Docker images for Obico server
16
star
11

ascii-telnet-rust

🌌 Star Wars telnet server written in Rust
Rust
14
star
12

home-ops

HomeOps driven by Kubernetes and GitOps using Flux
CSS
14
star
13

mnemonic-ninja

πŸ”’ Website to convert between a number and its corresponding word to aid in memorization
Vue
13
star
14

pyruckus

πŸ“Ά Python client for Ruckus Unleashed routers
Python
11
star
15

pre-commit-fluxcd

Pre-Commit hooks for FluxCD GitOps repos
Go
11
star
16

transsmute

πŸ“° Build RSS feeds for websites that don't provide them.
Go
9
star
17

portfolio

πŸ‘¨β€πŸ’» My personal portfolio website
Go
8
star
18

streamdeck-stopwatch

⏱️ A stopwatch plugin for the Elgato Stream Deck
JavaScript
6
star
19

relax-sounds

😌 Website that streams or casts relaxing soundscapes.
Vue
5
star
20

setup-helm-docs-action

Action that installs Helm Docs, a tool for automatically generating markdown documentation for Helm charts
5
star
21

matrimony

πŸ’’ Selfhosted wedding site
Vue
4
star
22

materialflux

πŸ“° Material-UI frontend for Miniflux
Vue
4
star
23

go-spinners

Spinners for use in terminal Go apps
Go
4
star
24

docker-nightscout

Nightscout CGM Remote Monitor Docker Container
Dockerfile
3
star
25

pwgen-go

Command line phassphrase generator written in Go
Go
3
star
26

streamdeck-nightscout

🩸 A Nightscout plugin for the Elgato Stream Deck
JavaScript
3
star
27

geoip-cache-proxy

A GeoIP database caching proxy.
Go
2
star
28

docker-vuetorrent

VueTorrent Docker container
Dockerfile
2
star
29

docker-cloudnativepg-vecto.rs

CloudNativePG conatiner images with pgvecto.rs
Dockerfile
2
star
30

ruckus-mock-ssh

Mock SSH server written in Go that mocks a subset of Ruckus SSH commands and responses.
Go
1
star
31

scaffold

πŸ—οΈ Generate an opinionated Laravel site
Go
1
star
32

docker-borgmatic

Dockerfile
1
star
33

docker-khinsider

Container images for obskyr/khinsider
Dockerfile
1
star
34

template-kubernetes-apps-markdown

Automatically generate a repo listing for Kubernetes GitOps repos
Go
1
star
35

submarine-cable-map-downloader

Download full-resolution versions of Telegeography Submarine Cable Maps
Go
1
star
36

renovate-config

1
star
37

docker-pixlet

Docker container with Tidbyt's Pixlet cli tool
Dockerfile
1
star
38

cli-of-life

Play Conway's Game of Life in your terminal
Go
1
star
39

homebrew-tap

gabe565 Homebrew Tap
Ruby
1
star
40

docker-stable-diffusion

Dockerfile
1
star
41

external-dns-dynamic-ip

Simple cron job that fixes external-dns when running behind a NAT with MetalLB
Shell
1
star
42

patrol

πŸ•΅οΈ Website to randomly pick a game role
SCSS
1
star