Giter Club home page Giter Club logo

tea's Introduction

Gitea Command Line Tool for Go

This project acts as a command line tool for operating one or multiple Gitea instances. It depends on code.gitea.io/sdk client SDK implementation written in Go to interact with the Gitea API implementation.

Installation

Currently no prebuilt binaries are provided. To install, a Go installation is needed.

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:

export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

Usage

First of all, you have to create a token on your personal settings -> application page of your gitea instance. 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:

tea issues
tea releases

If you are inside a git repository hosted on a gitea instance, you don't need to specify the --login and --repo flags!

Compilation

To compile the sources yourself run the following:

go get code.gitea.io/tea
cd "${GOPATH}/src/code.gitea.io/tea"
go build

Contributing

Fork -> Patch -> Push -> Pull Request

Authors

License

This project is under the MIT License. See the LICENSE file for the full license text.

tea's People

Contributors

appleboy avatar lunny avatar noerw avatar root360-andreasulm avatar techknowlogick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tea's Issues

Allow ssh info command to list repositories available

Certain other repository management tools, such as Gitolite, allow a user to see what repositories they have access to by passing info to the SSH command.

For example, ssh [email protected] info

The result is a list of repositories.

This is really useful not only for command-line users but also for quickly verifying what access someone has.

Could Gitea support this?

(Moved from go-gitea/gitea#5124)

tea releases create gives error "You have to indicate a repo or execute the command in a repo" but no repo option allowed

I'm probably doing something stupid but I've successfully done a tea login and was then attempting to create a release with:

tea releases create --title "0.0.1-alpha" --target master --draft --asset myapp.zip

But how do I specify the repo? There is no -r/--repo flag on this command and the preceding login command didn't allow me to specify a repo at the end of the url.

I understandably get the error:
You have to indicate a repo or execute the command in a repo

I'm not sure what "in a repo" means - I'm in the git folder containing my app. Eventually I'll want to do this from the CI.

Any examples of creating a release much appreciated.

FWIW Doing a tea -v gives Tea version 0.1.0-dev

cant go get

as of #5

go get github.com/go-gitea/tea
package github.com/go-gitea/tea: code in directory /home/vtolstov/.cache/go-path/src/github.com/go-gitea/tea expects import "code.gitea.io/tea"

go get code.gitea.io/tea
package code.gitea.io/sdk/gitea: unrecognized import path "code.gitea.io/sdk/gitea" (parse https://code.gitea.io/sdk/gitea?go-get=1: no go-import meta tags ())

Migrate repositories from a HTTP URL, local disk or SSH URL

If we can implement a sub command migrate, that will be helpful.

# migrate from a http URL
tea --login=try migrate https://github.com/go-gitea/tea.git --name=gitea/tea

# migrate from local disk
tea --login=try migrate ./tea.git --name=gitea/tea

# migrate from a SSH URL, clone from ssh and then upload from local disk
tea --login=try migrate [email protected]:go-gitea/tea.git --name=gitea/tea

handle global Flags

While trying to solve #12 with PR #15 several options were discussed.
To move the discussion out of the PR and summarize the available options I create this issue.

The short summary of the problem #12 pointed out is that the current CLI lib does not inherit global flags into several subcommands (see urfave/cli#585)

The currently available options are:

  • switching to Cobra a different CLI lib (suggested by @noerw )
  • creating global flags and use append() to merge subcommand flags with global flags (suggested by @techknowlogick )

To compare both options I created a branch in my fork for each of them:

pulls panic if there is no open pull requests

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x14ece93]

goroutine 1 [running]:
code.gitea.io/tea/cmd.runPulls(0xc000106f20, 0xc0001e2000, 0xc000106f20)
	/Users/quanta/go/src/code.gitea.io/tea/cmd/pulls.go:52 +0x363
github.com/urfave/cli.HandleAction(0x155c680, 0x163e5f8, 0xc000106f20, 0x0, 0xc000086ba0)
	/Users/quanta/go/src/github.com/urfave/cli/app.go:502 +0xbe
github.com/urfave/cli.Command.Run(0x161dc87, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x162e67d, 0x24, 0x0, ...)
	/Users/quanta/go/src/github.com/urfave/cli/command.go:165 +0x420
github.com/urfave/cli.(*App).Run(0xc0001c2380, 0xc0000b6000, 0x4, 0x4, 0x0, 0x0)
	/Users/quanta/go/src/github.com/urfave/cli/app.go:259 +0x6cf
main.main()
	/Users/quanta/go/src/code.gitea.io/tea/main.go:43 +0x264

The reason is: go-gitea/go-sdk#161

expects import "code.gitea.io/tea"

running:
go get github.com/go-gitea/tea

Gives:
package github.com/go-gitea/tea: code in directory C:\Users\<me>\go\src\github.com\go-gitea\tea expects import "code.gitea.io/tea"

The readme doesn't mention how that should get resolved.

I tried:
go get code.gitea.io/tea

This silently returned, but subsequently running the following failed with the same error above:
go install github.com/go-gitea/tea

Can you add a built release of this tool?

support `tea releases create` with asset upload

I'm happy to provide a pull request implementing this functionality, but want to find consensus on the command line interface first.

I'd prefer a command like this:

tea releases create --tag v1.0 --target master -t v1.0 --asset artifact1.zip --asset artifact2

But I saw that in the HTTP API assets are handled in a separate endpoint. Would the API described above be fine anyway?

go get fails

I cant download the package as suggested (go get github.com/go-gitea/tea), it fails with the following error message:

can't load package: package github.com/go-gitea/tea: code in directory /home/norwin/src/github.com/go-gitea/tea expects import "code.gitea.io/tea"

Doing go get code.gitea.io/tea works, but this package seems to not represent the current version from github.

Unified table output

Hi,

currently every function printing information handles the output format on its own.
That the format cannot be changed easily e.g. in case '\t' is not available (see discussion in #13) and is not unified.

IMHO a central function for handling output in different formats (e.g. table, JSON) would improve the output of all functions to look unified.
The central output functions could handle the delimiter.

A first idea is to add function to pring table based output which gets a dictionary like this:

header:
  - col1
  - col2
  - col3
values:
- 
  - c1val1
  - c2val1
  - c3val1
- 
  - c1val2
  - c2val2
  - c3val2

With this information the table output function can generate a header and print the values.
As all values to be printed are known at this stage the output can even be vertically aligned.

  1. What do you think about this idea?

Regards,
Andreas

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.