Discover Packages
github.com/xuqingfeng/gist-cli
package
module
Version:
v0.3.0
Opens a new window with list of versions in this module.
Published: Sep 2, 2016
License: MIT
Opens a new window with license information.
Imports: 8
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
gist-cli
中文 | English
安装
go get -u -v github.com/xuqingfeng/gist-cli/cmd/gist
或者直接下载 二进制文件
用法
gist -u=YOUR_USERNAME -t=YOUR_TOKEN -d=DESCRIPTION FILE0 FILE1
或者导出环境变量
# vi ~/.zshrc (.bashrc ...)
# gist
export GIST_CLI_USERNAME="YOUR_USERNAME"
export GIST_CLI_TOKEN="YOUR_TOKEN"
export GIST_CLI_PROXY="YOUR_SOCKS5_PROXY" # socks5://localhost:9742
gist FILE0 FILE1
其他
gist -h
列出所有命令
Expand ▾
Collapse ▴
Documentation
¶
View Source
const (
GIST_API_URL = "https://api.github.com/gists"
GIST_CLI_USERNAME = "GIST_CLI_USERNAME"
GIST_CLI_TOKEN = "GIST_CLI_TOKEN"
GIST_CLI_PROXY = "GIST_CLI_PROXY"
)
func Paste(anonymous, public bool , username, token, description, proxyCfg string , flagArgs []string ) error
Paste is used to upload files to gist.github.com
upload empty files will return error
type Data struct {
Files map[string ]File `json:"files"`
Description string `json:"description"`
Public bool `json:"public"`
}
Data holds client post params
type ErrRet struct {
Message string `json:"message"`
}
ErrRet holds github error return
type File struct {
Content string `json:"content"`
}
File is part of Data
type Ret struct {
Id string `json:"id"`
Url string `json:"url"`
HtmlUrl string `json:"html_url"`
Description string `json:"description"`
Public bool `json:"public"`
}
Ret holds github success return
Source Files
¶
Directories
¶
cmd
Click to show internal directories.
Click to hide internal directories.