Add gitea-vet #121

Merged
zeripath merged 10 commits from 6543/tea:add-gitea-vet into master 2020-04-28 13:02:28 +00:00
2 changed files with 31 additions and 24 deletions
Showing only changes of commit 8221fce3ec - Show all commits

View File

@ -1,36 +1,31 @@
# Gitea Command Line Tool for Go
# <img alt='' src='https://gitea.com/repo-avatars/550-80a3a8c2ab0e2c2d69f296b7f8582485' height="40"/> *T E A*
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Release](https://raster.shields.io/badge/dynamic/json.svg?label=release&url=https://gitea.com/api/v1/repos/gitea/tea/releases&query=$[0].tag_name)](https://gitea.com/gitea/tea/releases)
[![Build Status](https://drone.gitea.com/api/badges/gitea/tea/status.svg)](https://drone.gitea.com/gitea/tea)
[![Join the chat at https://img.shields.io/discord/322538954119184384.svg](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/Gitea)
[![Go Report Card](https://goreportcard.com/badge/code.gitea.io/tea)](https://goreportcard.com/report/code.gitea.io/tea)
[![GoDoc](https://godoc.org/code.gitea.io/tea?status.svg)](https://godoc.org/code.gitea.io/tea)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Release](https://raster.shields.io/badge/dynamic/json.svg?label=release&url=https://gitea.com/api/v1/repos/gitea/tea/releases&query=$[0].tag_name)](https://gitea.com/gitea/tea/releases) [![Build Status](https://drone.gitea.com/api/badges/gitea/tea/status.svg)](https://drone.gitea.com/gitea/tea) [![Join the chat at https://img.shields.io/discord/322538954119184384.svg](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/Gitea) [![Go Report Card](https://goreportcard.com/badge/code.gitea.io/tea)](https://goreportcard.com/report/code.gitea.io/tea) [![GoDoc](https://godoc.org/code.gitea.io/tea?status.svg)](https://godoc.org/code.gitea.io/tea)
This project acts as a command line tool for operating one or multiple Gitea instances. It depends on [code.gitea.io/sdk](https://code.gitea.io/sdk) client SDK implementation written in Go to interact with
the Gitea API implementation.
## The official CLI interface for gitea
Tea is a command line tool for interacting on one or more Gitea instances.
It uses [code.gitea.io/sdk](https://code.gitea.io/sdk) and interacts with the Gitea API
![demo gif](https://dl.gitea.io/screenshots/tea_demo.gif)
## Installation
Currently no prebuilt binaries are provided.
To install, a Go installation is needed.
You can use the prebuilt binaries from [dl.gitea.io](https://dl.gitea.io/tea/)
To install from source, go 1.12 or newer is required:
```sh
go get code.gitea.io/tea
go install code.gitea.io/tea
```
If the `tea` executable is not found, you might need to set up your `$GOPATH` and `$PATH` variables first:
```sh
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
```
If you have `brew` installed, you can install tea version via:
Or if you have `brew` installed, you can install `tea` via:
```sh
brew tap gitea/tap https://gitea.com/gitea/homebrew-gitea
brew install --devel tea
brew install tea
```
## Usage
@ -42,23 +37,32 @@ Use this token to login with `tea`:
tea login add --name=try --url=https://try.gitea.io --token=xxxxxx
```
Now you can use the `tea` commands:
Now you can use the following `tea` subcommands.
Detailed usage information is available via `tea <command> --help`.
```sh
tea issues
tea releases
login Log in to a Gitea server
logout Log out from a Gitea server
issues List, create and update issues
pulls List, checkout and clean pull requests
releases Create releases
repos Operate with repositories
labels Manage issue labels
times Operate on tracked times of a repositorys issues and pulls
open Open something of the repository on web browser
```
To fetch issues from different repos, use the `--remote` flag (when inside a gitea repository directory) or `--login` & `--repo` flags.
## Compilation
Make sure you have installed a current go version.
To compile the sources yourself run the following:
```sh
go get code.gitea.io/tea
cd "${GOPATH}/src/code.gitea.io/tea"
go build
git clone https://gitea.com/gitea/tea.git
cd tea
make
```
## Contributing

View File

@ -81,6 +81,9 @@ func readSSHPrivKey(keyFile string) (sig ssh.Signer, err error) {
sig, err = ssh.ParsePrivateKey(sshKey)
if err != nil {
pass, err := promptPass(keyFile)
if err != nil {
return nil, err
}
sig, err = ssh.ParsePrivateKeyWithPassphrase(sshKey, []byte(pass))
if err != nil {
return nil, err