knqyf263 / pet

Simple command-line snippet manager
MIT License
4.41k stars 222 forks source link

Add support for GitHub Enterprise gist sync #237

Closed howmuch515 closed 7 months ago

howmuch515 commented 7 months ago

Is there a way to synchronize my snippets to the gist on GitHub Enterprise Server? If not, I would be pleased if synchronization with GitHub Enterprise Server could be achieved with a configuration like the following.

[General]
  snippetfile = "path/to/snippet" # specify snippet directory
  editor = "vim"                  # your favorite text editor
  column = 40                     # column size for list command
  selectcmd = "fzf"               # selector command for edit command (fzf or peco)
  backend = "ghe"                # specify backend service to sync snippets (gist or gitlab, default: gist)
  sortby  = "description"         # specify how snippets get sorted (recency (default), -recency, description, -description, command, -command, output, -output)
  cmd = ["sh", "-c"]              # specify the command to execute the snippet with

[GHE]
  url = "https://example.com"
  file_name = "pet-snippet.toml"  # specify gist file name
  access_token = ""               # your access token
  gist_id = ""                    # Gist ID
  public = false                  # public or priate
  auto_sync = false               # sync automatically when editing snippets