Справочник команд

gv

GitVerse from the command line

Work with GitVerse repositories, pull requests and issues without leaving the terminal.

gv <command> <subcommand> [flags]

Флаги

ФлагОписание
--helpShow help for command
--hostname <string>GitVerse hostname to operate against
-v, --versionShow gv version

Примеры

$ gv repo view veryviolet/gv
  $ gv pr list
  $ gv issue create --title "Bug" --body "..."
  $ gv api /user

gv api

Make an authenticated GitVerse API request

Make an authenticated HTTP request to the GitVerse API.

The endpoint is a path such as "/user" or "repos/{owner}/{repo}/pulls"; a full URL is also accepted. The placeholders {owner}, {repo} and {hostname} are filled in from the repository in the current directory.

The default method is GET, or POST when parameters are supplied. Parameters are sent as a query string for GET and HEAD, and as a JSON body otherwise.

With --paginate, every page of a collection is fetched and the arrays are merged into a single JSON array.

gv api <endpoint> [flags]

Флаги

ФлагОписание
-F, --field <key=value>Add a typed parameter in key=value format
-H, --header <key:value>Add an HTTP request header in key:value format
-i, --includeInclude the HTTP status line and response headers
--input <file>Send the contents of file as the body (use "-" for stdin)
-q, --jq <expression>Filter the JSON response with a jq expression
--limit <n>Stop after fetching n items when paginating
-X, --method <string>HTTP method for the request
--paginateFetch every page of a paginated collection
-f, --raw-field <key=value>Add a string parameter in key=value format
--silentDo not print the response body
-t, --template <template>Format the JSON response with a Go template

Примеры

# the authenticated user
  $ gv api /user

  # pull requests of the current repository
  $ gv api repos/{owner}/{repo}/pulls

  # every repository you can see, as a flat list of names
  $ gv api /user/repos --paginate --jq '.[].full_name'

  # create an issue
  $ gv api repos/{owner}/{repo}/issues -f title='Bug' -f body='Steps...'

  # close a pull request
  $ gv api -X PATCH repos/{owner}/{repo}/pulls/12 -f state=closed

gv auth

Authenticate gv with GitVerse

Manage the credentials gv uses.

GitVerse issues personal access tokens from the web interface; gv stores the token you paste in `$GV_CONFIG_DIR/hosts.yml` with 0600 permissions. The environment variables GV_TOKEN and GITVERSE_TOKEN take precedence over the stored credential and are never written to disk.

gv auth <command>

gv auth docker-login

Log the container engine in to the GitVerse registry

Authenticate docker or podman against the GitVerse container registry using the token gv already holds.

The registry lives on the same host as the repositories, so images are named `<host>/<owner>/<image>`. The token is passed to the engine on standard input and never appears in the process list or the shell history.

gv auth docker-login [flags]

Флаги

ФлагОписание
--engine <string>Container engine to use: {docker|podman|nerdctl}
-h, --hostname <string>The GitVerse host whose registry to log in to
--verifyCheck the token against the registry before logging in

Примеры

$ gv auth docker-login
  $ gv auth docker-login --engine podman

gv auth login

Authenticate with a GitVerse host

Store a GitVerse personal access token.

GitVerse has no OAuth device flow, so the token is created in the web interface and pasted here. Create one at https://gitverse.ru/settings/tokens and grant it the scopes the commands you intend to use require.

gv auth login [flags]

Флаги

ФлагОписание
-p, --git-protocol <string>The protocol to use for git operations: {https|ssh}
-h, --hostname <string>The GitVerse host to authenticate with
--skip-verifyStore the token without checking it against the API
--with-tokenRead the token from standard input

Примеры

# paste the token interactively
  $ gv auth login

  # read the token from a file, for scripts and CI
  $ gv auth login --with-token < token.txt

gv auth logout

Remove stored credentials for a host

Forget the token stored for a GitVerse host.

Tokens supplied through GV_TOKEN or GITVERSE_TOKEN are not stored by gv and cannot be removed this way; unset the variable instead.

gv auth logout [flags]

Флаги

ФлагОписание
-h, --hostname <string>The host to log out of

gv auth setup-git

Configure git to authenticate with the stored token

Register gv as a git credential helper for a GitVerse host.

Afterwards `git clone`, `git fetch` and `git push` over HTTPS use the token gv holds, so no separate git credential setup is needed.

gv auth setup-git [flags]

Флаги

ФлагОписание
-h, --hostname <string>The host to configure

gv auth status

Show the authentication state

Report which hosts gv has credentials for, where each credential came from, and whether it is still accepted by the API.

gv auth status [flags]

Флаги

ФлагОписание
-h, --hostname <string>Check a single host
-t, --show-tokenDisplay the token in the output
--skip-verifyDo not contact the API

gv auth token

Print the token gv would use

Print the authentication token gv resolves for a host.

Useful for feeding other tools, e.g. `curl -H "Authorization: Bearer $(gv auth token)"`.

gv auth token [flags]

Флаги

ФлагОписание
-h, --hostname <string>The host to look up

gv issue

Work with issues

List, inspect, open and close issues.

GitVerse returns issues and pull requests from the same endpoint; gv filters pull requests out of issue listings unless --include-prs is given.

gv issue <command>

Флаги

ФлагОписание
-R, --repo <OWNER/REPO>Select a repository using the OWNER/REPO format

gv issue close

Close an issue

gv issue close <number> [flags]

Флаги

ФлагОписание
-c, --comment <comment>Leave a closing comment

Примеры

$ gv issue close 12 --comment "Fixed in 1.4.1"

gv issue comment

Comment on an issue or pull request

Add a comment.

The same endpoint serves issues and pull requests, so this works for either.

gv issue comment <number> [flags]

Флаги

ФлагОписание
-b, --body <string>Text of the comment
-F, --body-file <file>Read the comment from file (use "-" for stdin)

Примеры

$ gv issue comment 12 --body "Reproduced on 1.4.0"
  $ git log -1 | gv issue comment 12 --body-file -

gv issue create

Open a new issue

Create an issue.

A title is required; gv does not open an editor. Use --body-file - to read a long description from standard input.

gv issue create [flags]

Флаги

ФлагОписание
-a, --assignee <people>Assign people to the issue
-b, --body <string>Body of the issue
-F, --body-file <file>Read the body from file (use "-" for stdin)
--due-date <date>Due date in YYYY-MM-DD format
-l, --label <labels>Add labels to the issue
-t, --title <string>Title of the issue
-w, --webOpen the new-issue form in a browser instead

Примеры

$ gv issue create --title "Crash on startup" --body "Steps: ..."
  $ gv issue create -t "Docs" -F notes.md --label docs --assignee veryviolet

gv issue edit

Edit an issue

Change the title, body, labels or assignees of an issue.

Only the flags you pass are sent. Note that --label and --assignee replace the existing sets rather than adding to them, because the API takes whole lists.

gv issue edit <number> [flags]

Флаги

ФлагОписание
-a, --assignee <logins>Replace the assignees with these logins
-b, --body <string>New body
-F, --body-file <file>Read the new body from file (use "-" for stdin)
--due-date <date>New due date in YYYY-MM-DD format
-l, --label <names>Replace the labels with these names
-t, --title <string>New title

Примеры

$ gv issue edit 12 --title "Clearer title"
  $ gv issue edit 12 --label bug --label regression

gv issue list

List issues

gv issue list [flags]

Флаги

ФлагОписание
-a, --assignee <login>Filter by assignee login
--author <login>Filter by author login
--include-prsInclude pull requests in the listing
-q, --jq <expression>Filter the JSON output with a jq expression
--jsonOutput the issues as JSON
-l, --label <labels>Filter by labels
-L, --limit <int>Maximum number of issues to list
--mention <login>Filter by mentioned login
--milestone <milestone>Filter by milestone
-S, --search <query>Search issues with a query
-s, --state <string>Filter by state: {open|closed|all}
-t, --template <template>Format the JSON output with a Go template
-w, --webList issues in a browser

Примеры

$ gv issue list
  $ gv issue list --state all --label bug --limit 100
  $ gv issue list --assignee veryviolet --json --jq '.[].title'

gv issue reopen

Reopen a closed issue

gv issue reopen <number> [flags]

Флаги

ФлагОписание
-c, --comment <comment>Leave a comment when reopening

Примеры

$ gv issue reopen 12

gv issue view

Show an issue

gv issue view <number> [flags]

Флаги

ФлагОписание
-c, --commentsShow the comment thread
-q, --jq <expression>Filter the JSON output with a jq expression
--jsonOutput the issue as JSON
-t, --template <template>Format the JSON output with a Go template
-w, --webOpen the issue in a browser

Примеры

$ gv issue view 12
  $ gv issue view 12 --comments

gv package

Work with packages and container images

List and delete packages published to GitVerse.

Container images live in the registry on the same host as the repositories: an image is named `gitverse.ru/<owner>/<image>` and `docker login gitverse.ru` takes the same token gv uses — see `gv auth docker-login`.

The REST API can only address a package whose name is already known, so `gv package list` reads the registry catalogue instead.

gv package <command>

gv package delete

Delete a package or one of its versions

Delete a whole package, or a single version with --version.

This cannot be undone: an image deleted from the registry is gone, and anyone pulling that tag will start getting errors.

gv package delete [<owner>/]<package> [flags]

Флаги

ФлагОписание
--orgThe owner is an organization
--type <type>Package type: {container|generic|debian|rpm|maven|npm|pypi|helm|nuget|go}
--version <id>Delete only this version id
--yesSkip the confirmation prompt

Примеры

$ gv package delete gv --version 42
  $ gv package delete veryviolet/gv --yes

gv package list

List container images of an owner

List the registry repositories belonging to an owner.

The REST API cannot enumerate packages, so this reads the registry catalogue, which is shared by the whole platform and sorted by name: gv starts at the owner's prefix rather than walking the catalogue from the beginning.

gv package list [<owner>] [flags]

Флаги

ФлагОписание
-q, --jq <expression>Filter the JSON output with a jq expression
--jsonOutput the packages as JSON
-L, --limit <int>Maximum number of packages to list
--tagsAlso fetch the tags of each image
-t, --template <template>Format the JSON output with a Go template

Примеры

$ gv package list
  $ gv package list veryviolet --tags

gv package push

Publish packages to the GitVerse registries

Upload .deb, .rpm or arbitrary files to the package registries.

The registry signs the repository metadata itself, so clients verify the packages against a published key — unlike a plain file share. The kind is guessed from the extension and can be forced with --kind.

Files are immutable: republishing the same name, version and architecture fails until the existing version is deleted.

gv package push <file>... [flags]

Флаги

ФлагОписание
--component <component>Debian component
--distribution <distribution>Debian distribution
--group <group>RPM group; empty publishes to the owner-wide repository
--kind <string>Registry to use: {deb|rpm|generic} (guessed from the extension)
--name <name>Generic package name
--owner <owner>Publish under this owner instead of the authenticated user
--version <version>Generic package version

Примеры

$ gv package push dist/gv_0.2.0-1_amd64.deb
  $ gv package push dist/*.rpm --group gv
  $ gv package push notes.txt --kind generic --name gv --version 0.2.0

gv package versions

List the versions of a package

List the published versions of one package.

For container images the version name is the tag. Pass --org when the package belongs to an organization: users and organizations live under different API paths and gv cannot tell them apart from the name alone.

gv package versions [<owner>/]<package> [flags]

Флаги

ФлагОписание
-q, --jq <expression>Filter the JSON output with a jq expression
--jsonOutput the versions as JSON
-L, --limit <int>Maximum number of versions to list
--orgThe owner is an organization
-t, --template <template>Format the JSON output with a Go template
--type <type>Package type: {container|generic|debian|rpm|maven|npm|pypi|helm|nuget|go}

Примеры

$ gv package versions gv
  $ gv package versions veryviolet/gv
  $ gv package versions myorg/service --org

gv pr

Work with pull requests

List, inspect and open pull requests.

Commands that take a pull request accept its number; inside a git checkout the pull request for the current branch is found automatically.

Note: the GitVerse API exposes no endpoint for merging a pull request, so gv has no "pr merge" command. Merge from the web interface.

gv pr <command>

Флаги

ФлагОписание
-R, --repo <OWNER/REPO>Select a repository using the OWNER/REPO format

gv pr checkout

Check out a pull request locally

Fetch the head of a pull request and switch to it.

gv first tries the server-side ref "pull/<number>/head". Not every GitVerse deployment publishes those refs, so it falls back to fetching the head branch directly from the fork it lives in.

gv pr checkout <number> [flags]

Флаги

ФлагОписание
-b, --branch <name>Local branch name to create

Примеры

$ gv pr checkout 42
  $ gv pr checkout 42 --branch review-42

gv pr close

Close a pull request

gv pr close [<number>] [flags]

Флаги

ФлагОписание
-c, --comment <comment>Leave a closing comment

Примеры

$ gv pr close 42 --comment "Superseded by #45"

gv pr commits

List the commits of a pull request

gv pr commits [<number>] [flags]

Флаги

ФлагОписание
-q, --jq <expression>Filter the JSON output with a jq expression
--jsonOutput the commits as JSON
-t, --template <template>Format the JSON output with a Go template

Примеры

$ gv pr commits 42

gv pr create

Open a pull request

Create a pull request.

The head branch defaults to the current git branch and the base branch to the repository's default branch. A title is required; gv does not open an editor.

gv pr create [flags]

Флаги

ФлагОписание
-a, --assignee <people>Assign people to the pull request
-B, --base <branch>The branch to merge into
-b, --body <string>Body of the pull request
-F, --body-file <file>Read the body from file (use "-" for stdin)
-d, --draftOpen the pull request as a draft
-H, --head <branch>The branch that contains the commits
-l, --label-id <id>Add labels by numeric id
--pushPush the head branch to the remote first
-t, --title <string>Title of the pull request
-w, --webOpen the compare page in a browser instead

Примеры

$ gv pr create --title "Fix pagination" --body "Closes #12"
  $ gv pr create -t "WIP" --draft --base develop
  $ gv pr create -t "Docs" -F description.md --push

gv pr diff

Show the changes of a pull request

Print the patch of a pull request.

The diff is assembled from the per-file patches the API returns, so it is a unified diff without the commit headers a "git format-patch" would carry.

gv pr diff [<number>] [flags]

Флаги

ФлагОписание
--name-onlyPrint only the names of the changed files

Примеры

$ gv pr diff
  $ gv pr diff 42 --name-only

gv pr edit

Edit a pull request

Change the title, body or base branch of a pull request.

Only the flags you pass are sent, so unspecified fields keep their values.

gv pr edit [<number>] [flags]

Флаги

ФлагОписание
-B, --base <branch>New base branch
-b, --body <string>New body
-F, --body-file <file>Read the new body from file (use "-" for stdin)
-t, --title <string>New title

Примеры

$ gv pr edit 42 --title "Better title"
  $ gv pr edit 42 --body-file notes.md
  $ gv pr edit 42 --base develop

gv pr files

List the files a pull request changes

gv pr files [<number>] [flags]

Флаги

ФлагОписание
-q, --jq <expression>Filter the JSON output with a jq expression
--jsonOutput the files as JSON
-t, --template <template>Format the JSON output with a Go template

Примеры

$ gv pr files 42

gv pr list

List pull requests

gv pr list [flags]

Флаги

ФлагОписание
-B, --base <branch>Filter by base branch
--direction <direction>Sort direction: {asc|desc}
-H, --head <string>Filter by head branch, as "branch" or "owner:branch"
-q, --jq <expression>Filter the JSON output with a jq expression
--jsonOutput the pull requests as JSON
-L, --limit <int>Maximum number of pull requests to list
--sort <field>Sort by field
-s, --state <string>Filter by state: {open|closed|merged|all}
-t, --template <template>Format the JSON output with a Go template
-w, --webList pull requests in a browser

Примеры

$ gv pr list
  $ gv pr list --state all --limit 50
  $ gv pr list --base main --json --jq '.[].title'

gv pr reopen

Reopen a closed pull request

gv pr reopen [<number>] [flags]

Флаги

ФлагОписание
-c, --comment <comment>Leave a comment when reopening

Примеры

$ gv pr reopen 42

gv pr view

Show a pull request

Display the title, state, body and metadata of a pull request.

Without a number, the pull request for the current branch is used.

gv pr view [<number>] [flags]

Флаги

ФлагОписание
-c, --commentsShow the comment thread
-q, --jq <expression>Filter the JSON output with a jq expression
--jsonOutput the pull request as JSON
-t, --template <template>Format the JSON output with a Go template
-w, --webOpen the pull request in a browser

Примеры

$ gv pr view
  $ gv pr view 42 --comments
  $ gv pr view 42 --web

gv release

Work with releases

Publish releases and attach build artefacts to them.

A release is identified by its tag; the tag must already exist in the repository, or be created from --target when the release is published.

gv release <command>

Флаги

ФлагОписание
-R, --repo <OWNER/REPO>Select a repository using the OWNER/REPO format

gv release create

Publish a release

Create a release for a tag and, optionally, attach files to it.

Files given as positional arguments or with --asset are uploaded once the release exists.

gv release create <tag> [<file>...] [flags]

Флаги

ФлагОписание
-a, --asset <files>Additional files to attach
-d, --draftSave the release as a draft
-n, --notes <string>Release notes
-F, --notes-file <file>Read the release notes from file (use "-" for stdin)
-p, --prereleaseMark the release as a prerelease
--target <string>Branch or commit the tag should point at
-t, --title <string>Title of the release

Примеры

$ gv release create v0.1.0 --title "gv 0.1.0" --notes-file CHANGELOG.md
  $ gv release create v0.1.0 dist/*.deb dist/*.rpm
  $ gv release create v0.2.0-rc1 --prerelease --target main

gv release delete

Delete a release

Delete a release. The git tag itself is left alone.

gv release delete <tag> [flags]

Флаги

ФлагОписание
--yesSkip the confirmation prompt

Примеры

$ gv release delete v0.1.0 --yes

gv release list

List releases

gv release list [flags]

Флаги

ФлагОписание
-q, --jq <expression>Filter the JSON output with a jq expression
--jsonOutput the releases as JSON
-L, --limit <int>Maximum number of releases to list
-t, --template <template>Format the JSON output with a Go template

gv release upload

Attach files to a release

Upload build artefacts to an existing release.

With --clobber an asset of the same name is deleted first; otherwise the API decides what to do with a duplicate name.

gv release upload <tag> <file>... [flags]

Флаги

ФлагОписание
--clobberReplace assets of the same name

Примеры

$ gv release upload v0.1.0 dist/gv_0.1.0_amd64.deb
  $ gv release upload v0.1.0 dist/* --clobber

gv release view

Show a release

Show a release and the files attached to it. Without a tag, the latest release is shown.

gv release view [<tag>] [flags]

Флаги

ФлагОписание
-q, --jq <expression>Filter the JSON output with a jq expression
--jsonOutput the release as JSON
-t, --template <template>Format the JSON output with a Go template
-w, --webOpen the release in a browser

gv repo

Work with GitVerse repositories

Create, inspect, clone and fork repositories.

Commands that take a repository accept it as "OWNER/REPO"; run inside a git repository with a GitVerse remote and the argument can be omitted.

gv repo <command>

gv repo clone

Clone a repository locally

Clone a GitVerse repository.

Arguments after "--" are passed straight to git clone. When the repository is a fork, a remote named "upstream" is added for its parent.

gv repo clone <repository> [<directory>] [-- <git-flags>...]

Флаги

ФлагОписание
-p, --protocol <string>Clone protocol to use: {https|ssh}
--upstream-remote-name <name>Remote name to create for the parent of a fork

Примеры

$ gv repo clone gitverse/rest-api-description
  $ gv repo clone veryviolet/gv gv-cli
  $ gv repo clone veryviolet/gv -- --depth 1

gv repo create

Create a new repository

Create a repository on GitVerse.

Pass "OWNER/NAME" to create it inside an organization you belong to; a bare name creates it under your own account. New repositories are private unless --public is given.

gv repo create <name> [flags]

Флаги

ФлагОписание
--add-readmeInitialise the repository with a README
-c, --cloneClone the new repository afterwards
-d, --description <string>Description of the repository
--gitignore <templates>Gitignore templates to apply
--privateMake the repository private (default)
--publicMake the repository public
--templateMark the repository as a template

Примеры

$ gv repo create my-project --private --add-readme
  $ gv repo create myorg/service --description "Billing service" --public
  $ gv repo create tools --clone

gv repo delete

Delete a repository

Delete a repository on GitVerse. This cannot be undone.

Interactively you are asked to retype the full repository name. In scripts, pass --yes to skip the prompt.

gv repo delete [<repository>] [flags]

Флаги

ФлагОписание
--yesSkip the confirmation prompt

Примеры

$ gv repo delete veryviolet/scratch
  $ gv repo delete veryviolet/scratch --yes

gv repo fork

Create a fork of a repository

Fork a repository into your account or an organization.

Run inside a clone of the upstream repository and pass --remote to add the new fork as a git remote.

gv repo fork [<repository>] [flags]

Флаги

ФлагОписание
--cloneClone the fork afterwards
--fork-name <string>Rename the forked repository
--org <organization>Create the fork in an organization
--remoteAdd the fork as a git remote in the current repository
--remote-name <name>Remote name to use with --remote

Примеры

$ gv repo fork gitverse/rest-api-description --clone
  $ gv repo fork --org myorg --remote

gv repo list

List repositories

List repositories owned by you, by a user, or by an organization.

The API returns every repository the token can see; the --fork, --source, --public and --private flags filter that list client-side.

gv repo list [<owner>] [flags]

Флаги

ФлагОписание
--forkShow only forks
-q, --jq <expression>Filter the JSON output with a jq expression
--jsonOutput the repositories as JSON
-L, --limit <int>Maximum number of repositories to list
--org <organization>List repositories of an organization
--privateShow only private repositories
--publicShow only public repositories
--sourceShow only repositories that are not forks
-t, --template <template>Format the JSON output with a Go template

Примеры

$ gv repo list
  $ gv repo list veryviolet --limit 50
  $ gv repo list --org myorg --source

gv repo view

Show a repository

Display the description, statistics and README of a repository.

Without an argument the repository of the current directory is used.

gv repo view [<repository>] [flags]

Флаги

ФлагОписание
-b, --branch <branch>Read the README from this branch
-q, --jq <expression>Filter the JSON output with a jq expression
--jsonOutput the repository as JSON
-t, --template <template>Format the JSON output with a Go template
-w, --webOpen the repository in a browser

Примеры

$ gv repo view
  $ gv repo view gitverse/rest-api-description
  $ gv repo view --web

gv version

Print the version of gv

gv version