From 0869c15a6cc8f72b16e56375c52e7bf7d7328474 Mon Sep 17 00:00:00 2001 From: jolheiser Date: Fri, 1 Sep 2023 15:34:13 +0000 Subject: [PATCH] Initial CLI docs (#565) As title, then we could potentially start ingesting these in the docs repo as they are expanded. Reviewed-on: https://gitea.com/gitea/tea/pulls/565 Reviewed-by: Lunny Xiao Co-authored-by: jolheiser Co-committed-by: jolheiser --- .gitea/workflows/test-pr.yml | 1 + Makefile | 13 + cmd/docs.go | 56 ++ docs/CLI.md | 1298 ++++++++++++++++++++++++++++++++++ main.go | 1 + 5 files changed, 1369 insertions(+) create mode 100644 cmd/docs.go create mode 100644 docs/CLI.md diff --git a/.gitea/workflows/test-pr.yml b/.gitea/workflows/test-pr.yml index d6a660f..8cef22f 100644 --- a/.gitea/workflows/test-pr.yml +++ b/.gitea/workflows/test-pr.yml @@ -20,6 +20,7 @@ jobs: make lint make fmt-check make misspell-check + make docs-check make build env: GOPROXY: https://goproxy.io,direct diff --git a/Makefile b/Makefile index 689d13e..e2b252a 100644 --- a/Makefile +++ b/Makefile @@ -87,6 +87,19 @@ fmt-check: exit 1; \ fi; +.PHONY: docs +docs: + $(GO) run . docs --out docs/CLI.md + +.PHONY: docs-check +docs-check: + @DIFF=$$($(GO) run . docs | diff docs/CLI.md -); \ + if [ -n "$$DIFF" ]; then \ + echo "Please run 'make docs' and commit the result:"; \ + echo "$$DIFF"; \ + exit 1; \ + fi; + .PHONY: test test: $(GO) test -tags='sqlite sqlite_unlock_notify' $(PACKAGES) diff --git a/cmd/docs.go b/cmd/docs.go new file mode 100644 index 0000000..6a0f9f2 --- /dev/null +++ b/cmd/docs.go @@ -0,0 +1,56 @@ +// Copyright 2023 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package cmd + +import ( + "fmt" + "os" + "path/filepath" + + "github.com/urfave/cli/v2" +) + +// CmdDocs generates markdown for tea +var CmdDocs = cli.Command{ + Name: "docs", + Hidden: true, + Description: "Generate CLI docs", + Action: runDocs, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "out", + Usage: "Path to output docs to, otherwise prints to stdout", + Aliases: []string{"o"}, + }, + }, +} + +func runDocs(ctx *cli.Context) error { + md, err := ctx.App.ToMarkdown() + if err != nil { + return err + } + + outPath := ctx.String("out") + if outPath == "" { + fmt.Print(md) + return nil + } + + if err := os.MkdirAll(filepath.Dir(outPath), os.ModePerm); err != nil { + return err + } + + fi, err := os.Create(outPath) + if err != nil { + return err + } + defer fi.Close() + if _, err := fi.WriteString(md); err != nil { + return err + } + + return nil +} diff --git a/docs/CLI.md b/docs/CLI.md new file mode 100644 index 0000000..1435b28 --- /dev/null +++ b/docs/CLI.md @@ -0,0 +1,1298 @@ +# NAME + +tea - command line tool to interact with Gitea + +# SYNOPSIS + +tea + +``` +[--help|-h] +[--version|-v] +``` + +# DESCRIPTION + +tea is a productivity helper for Gitea. It can be used to manage most entities on +one or multiple Gitea instances & provides local helpers like 'tea pr checkout'. + +tea tries to make use of context provided by the repository in $PWD if available. +tea works best in a upstream/fork workflow, when the local main branch tracks the +upstream repo. tea assumes that local git state is published on the remote before +doing operations with tea. Configuration is persisted in $XDG_CONFIG_HOME/tea. + + +**Usage**: + +``` +tea [GLOBAL OPTIONS] command [COMMAND OPTIONS] [ARGUMENTS...] +``` + +# GLOBAL OPTIONS + +**--help, -h**: show help + +**--version, -v**: print the version + + +# COMMANDS + +## logins, login + +Log in to a Gitea server + +### list, ls + +List Gitea logins + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +### add + +Add a Gitea login + +**--insecure, -i**: Disable TLS verification + +**--name, -n**="": Login name + +**--no-version-check, --nv**: Do not check version of Gitea instance + +**--password, --pwd**="": Password for basic auth (will create token) + +**--ssh-agent-key, -a**="": Use SSH public key or SSH fingerprint to login (needs a running ssh-agent with ssh key loaded) + +**--ssh-agent-principal, -c**="": Use SSH certificate with specified principal to login (needs a running ssh-agent with certificate loaded) + +**--ssh-key, -s**="": Path to a SSH key/certificate to use, overrides auto-discovery + +**--token, -t**="": Access token. Can be obtained from Settings > Applications + +**--url, -u**="": Server URL (default: https://gitea.com) + +**--user**="": User for basic auth (will create token) + +### edit, e + +Edit Gitea logins + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +### delete, rm + +Remove a Gitea login + +### default + +Get or Set Default Login + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +## logout + +Log out from a Gitea server + +## shellcompletion, autocomplete + +Install shell completion for tea + +**--install**: Persist in shell config instead of printing commands + +## whoami + +Show current logged in user + +## issues, issue, i + +List, create and update issues + +**--assignee, -a**="": + +**--author, -A**="": + +**--comments**: Whether to display comments (will prompt if not provided & run interactively) + +**--fields, -f**="": Comma-separated list of fields to print. Available values: + index,state,kind,author,author-id,url,title,body,created,updated,deadline,assignees,milestone,labels,comments,owner,repo + (default: index,title,state,author,milestone,labels,owner,repo) + +**--from, -F**="": Filter by activity after this date + +**--keyword, -k**="": Filter by search string + +**--kind, -K**="": Whether to return `issues`, `pulls`, or `all` (you can use this to apply advanced search filters to PRs) + +**--labels, -L**="": Comma-separated list of labels to match issues against. + + + +**--limit, --lm**="": specify limit of items per page + +**--login, -l**="": Use a different Gitea Login. Optional + +**--mentions, -M**="": + +**--milestones, -m**="": Comma-separated list of milestones to match issues against. + + + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--owner, --org**="": + +**--page, -p**="": specify page, default is 1 + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +**--state**="": Filter by state (all|open|closed) + +**--until, -u**="": Filter by activity before this date + +### list, ls + +List issues of the repository + +**--assignee, -a**="": + +**--author, -A**="": + +**--fields, -f**="": Comma-separated list of fields to print. Available values: + index,state,kind,author,author-id,url,title,body,created,updated,deadline,assignees,milestone,labels,comments,owner,repo + (default: index,title,state,author,milestone,labels,owner,repo) + +**--from, -F**="": Filter by activity after this date + +**--keyword, -k**="": Filter by search string + +**--kind, -K**="": Whether to return `issues`, `pulls`, or `all` (you can use this to apply advanced search filters to PRs) + +**--labels, -L**="": Comma-separated list of labels to match issues against. + + + +**--limit, --lm**="": specify limit of items per page + +**--login, -l**="": Use a different Gitea Login. Optional + +**--mentions, -M**="": + +**--milestones, -m**="": Comma-separated list of milestones to match issues against. + + + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--owner, --org**="": + +**--page, -p**="": specify page, default is 1 + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +**--state**="": Filter by state (all|open|closed) + +**--until, -u**="": Filter by activity before this date + +### create, c + +Create an issue on repository + +**--assignees, -a**="": Comma-separated list of usernames to assign + +**--deadline, -D**="": Deadline timestamp to assign + +**--description, -d**="": + +**--labels, -L**="": Comma-separated list of labels to assign + +**--login, -l**="": Use a different Gitea Login. Optional + +**--milestone, -m**="": Milestone to assign + +**--referenced-version, -v**="": commit-hash or tag name to assign + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +**--title, -t**="": + +### edit, e + +Edit one or more issues + +**--add-assignees, -a**="": Comma-separated list of usernames to assign + +**--add-labels, -L**="": Comma-separated list of labels to assign. Takes precedence over --remove-labels + +**--deadline, -D**="": Deadline timestamp to assign + +**--description, -d**="": + +**--login, -l**="": Use a different Gitea Login. Optional + +**--milestone, -m**="": Milestone to assign + +**--referenced-version, -v**="": commit-hash or tag name to assign + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--remove-labels**="": Comma-separated list of labels to remove + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +**--title, -t**="": + +### reopen, open + +Change state of one or more issues to 'open' + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +### close + +Change state of one ore more issues to 'closed' + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +## pulls, pull, pr + +Manage and checkout pull requests + +**--comments**: Whether to display comments (will prompt if not provided & run interactively) + +**--fields, -f**="": Comma-separated list of fields to print. Available values: + index,state,author,author-id,url,title,body,mergeable,base,base-commit,head,diff,patch,created,updated,deadline,assignees,milestone,labels,comments + (default: index,title,state,author,milestone,updated,labels) + +**--limit, --lm**="": specify limit of items per page + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--page, -p**="": specify page, default is 1 + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +**--state**="": Filter by state (all|open|closed) + +### list, ls + +List pull requests of the repository + +**--fields, -f**="": Comma-separated list of fields to print. Available values: + index,state,author,author-id,url,title,body,mergeable,base,base-commit,head,diff,patch,created,updated,deadline,assignees,milestone,labels,comments + (default: index,title,state,author,milestone,updated,labels) + +**--limit, --lm**="": specify limit of items per page + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--page, -p**="": specify page, default is 1 + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +**--state**="": Filter by state (all|open|closed) + +### checkout, co + +Locally check out the given PR + +**--branch, -b**: Create a local branch if it doesn't exist yet + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +### clean + +Deletes local & remote feature-branches for a closed pull request + +**--ignore-sha**: Find the local branch by name instead of commit hash (less precise) + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +### create, c + +Create a pull-request + +**--allow-maintainer-edits, --edits**: Enable maintainers to push to the base branch of created pull + +**--assignees, -a**="": Comma-separated list of usernames to assign + +**--base, -b**="": Branch name of the PR target (default is repos default branch) + +**--deadline, -D**="": Deadline timestamp to assign + +**--description, -d**="": + +**--head**="": Branch name of the PR source (default is current one). To specify a different head repo, use : + +**--labels, -L**="": Comma-separated list of labels to assign + +**--login, -l**="": Use a different Gitea Login. Optional + +**--milestone, -m**="": Milestone to assign + +**--referenced-version, -v**="": commit-hash or tag name to assign + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +**--title, -t**="": + +### close + +Change state of one or more pull requests to 'closed' + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +### reopen, open + +Change state of one or more pull requests to 'open' + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +### review + +Interactively review a pull request + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +### approve, lgtm, a + +Approve a pull request + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +### reject + +Request changes to a pull request + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +### merge, m + +Merge a pull request + +**--login, -l**="": Use a different Gitea Login. Optional + +**--message, -m**="": Merge commit message + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +**--style, -s**="": Kind of merge to perform: merge, rebase, squash, rebase-merge (default: merge) + +**--title, -t**="": Merge commit title + +## labels, label + +Manage issue labels + +**--limit, --lm**="": specify limit of items per page + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--page, -p**="": specify page, default is 1 + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +**--save, -s**: Save all the labels as a file + +### list, ls + +List labels + +**--limit, --lm**="": specify limit of items per page + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--page, -p**="": specify page, default is 1 + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +**--save, -s**: Save all the labels as a file + +### create, c + +Create a label + +**--color**="": label color value + +**--description**="": label description + +**--file**="": indicate a label file + +**--login, -l**="": Use a different Gitea Login. Optional + +**--name**="": label name + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +### update + +Update a label + +**--color**="": label color value + +**--description**="": label description + +**--id**="": label id (default: 0) + +**--login, -l**="": Use a different Gitea Login. Optional + +**--name**="": label name + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +### delete, rm + +Delete a label + +**--id**="": label id (default: 0) + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +## milestones, milestone, ms + +List and create milestones + +**--fields, -f**="": Comma-separated list of fields to print. Available values: + title,state,items_open,items_closed,items,duedate,description,created,updated,closed,id + (default: title,items,duedate) + +**--limit, --lm**="": specify limit of items per page + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--page, -p**="": specify page, default is 1 + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +**--state**="": Filter by milestone state (all|open|closed) + +### list, ls + +List milestones of the repository + +**--fields, -f**="": Comma-separated list of fields to print. Available values: + title,state,items_open,items_closed,items,duedate,description,created,updated,closed,id + (default: title,items,duedate) + +**--limit, --lm**="": specify limit of items per page + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--page, -p**="": specify page, default is 1 + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +**--state**="": Filter by milestone state (all|open|closed) + +### create, c + +Create an milestone on repository + +**--deadline, --expires, -x**="": set milestone deadline (default is no due date) + +**--description, -d**="": milestone description to create + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +**--state**="": set milestone state (default is open) + +**--title, -t**="": milestone title to create + +### close + +Change state of one or more milestones to 'closed' + +**--force, -f**: delete milestone + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +### delete, rm + +delete a milestone + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +### reopen, open + +Change state of one or more milestones to 'open' + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +### issues, i + +manage issue/pull of an milestone + +**--fields, -f**="": Comma-separated list of fields to print. Available values: + index,state,kind,author,author-id,url,title,body,created,updated,deadline,assignees,milestone,labels,comments,owner,repo + (default: index,kind,title,state,updated,labels) + +**--kind**="": Filter by kind (issue|pull) + +**--limit, --lm**="": specify limit of items per page + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--page, -p**="": specify page, default is 1 + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +**--state**="": Filter by issue state (all|open|closed) + +#### add, a + +Add an issue/pull to an milestone + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +#### remove, r + +Remove an issue/pull to an milestone + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +## releases, release, r + +Manage releases + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +### list, ls + +List Releases + +**--limit, --lm**="": specify limit of items per page + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--page, -p**="": specify page, default is 1 + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +### create, c + +Create a release + +**--asset, -a**="": Path to file attachment. Can be specified multiple times + +**--draft, -d**: Is a draft + +**--login, -l**="": Use a different Gitea Login. Optional + +**--note, -n**="": Release notes + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--prerelease, -p**: Is a pre-release + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +**--tag**="": Tag name. If the tag does not exist yet, it will be created by Gitea + +**--target**="": Target branch name or commit hash. Defaults to the default branch of the repo + +**--title, -t**="": Release title + +### delete, rm + +Delete one or more releases + +**--confirm, -y**: Confirm deletion (required) + +**--delete-tag**: Also delete the git tag for this release + +**--login, -l**="": Use a different Gitea Login. Optional + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +### edit, e + +Edit one or more releases + +**--draft, -d**="": Mark as Draft [True/false] + +**--login, -l**="": Use a different Gitea Login. Optional + +**--note, -n**="": Change Notes + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--prerelease, -p**="": Mark as Pre-Release [True/false] + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +**--tag**="": Change Tag + +**--target**="": Change Target + +**--title, -t**="": Change Title + +## times, time, t + +Operate on tracked times of a repository's issues & pulls + +**--fields**="": Comma-separated list of fields to print. Available values: + id,created,repo,issue,user,duration + + +**--from, -f**="": Show only times tracked after this date + +**--login, -l**="": Use a different Gitea Login. Optional + +**--mine, -m**: Show all times tracked by you across all repositories (overrides command arguments) + +**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +**--total, -t**: Print the total duration at the end + +**--until, -u**="": Show only times tracked before this date + +### add, a + +Track spent time on an issue + +>tea times add + +**--login, -l**="": Use a different Gitea Login. Optional + +**--remote, -R**="": Discover Gitea login from remote. Optional + +**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional + +### delete, rm + +Delete a single tracked time on an issue + +>tea times delete