vin

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2020 License: MIT Imports: 22 Imported by: 0

README

banner

ci release go report card license go version release

Description | Features | Installation | Usage | Configuration | References

Description

vin is the CLI to install applications from GitHub Releases.

In recent years, many useful CLI tools have been made by Go, Rust, etc.
Many of them are available as pre-built binaries in GitHub Releases, but we have to manipulate the browser to download them, decompress the compressed files, and move the executables to the appropriate path.

vin makes it easy to manage all at once by writing a list of applications in a TOML file.
No longer do we have to select suitable assets for our machines from GitHub Releases, no longer do we have to look up the options for the tar command, and no longer do we have to be pained when we setup a new machine.

Features

  • Easy to use
  • TOML-based configuration

Installation

Download the binary from GitHub Releases.
Unfortunately, the first time you install vin, you need to open the browser.

Or, if you have Go, you can install vin with the following command.

go get github.com/skmatz/vin/...

After installation, add ~/.vin/bin to your $PATH.

export PATH="$HOME/.vin/bin:$PATH"

Usage

First, put the following TOML file in ~/.config/vin/vin.toml.

[[app]]
repo = "cli/cli"

Yes, all you have to do is run the following command.

vin get

Configuration

[[app]]
# repo is the GitHub repository name in "owner/repo" format.
repo = "cli/cli"

# tag is the tag on GitHub.
# If empty, it is treated as "latest".
tag = "v1.2.0"

# keywords is a list of keywords for selecting suitable assets from multiple assets.
# If empty, it is treated as [$GOOS, $GOARCH].
keywords = ["amd64", "linux"]

# name is the name of the executable file.
# If empty, it is treated as the original name.
name = "gh"

# command is the command to run after installation.
command = """
gh completion -s zsh > ~/.zfunc/_gh
"""

References

Thanks to ghg for the idea.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// Repo is the GitHub repository name in "owner/repo" format.
	Repo string `toml:"repo"`

	// Tag is the tag on GitHub.
	Tag string `toml:"tag"`

	// Keywords is a list of keywords for selecting suitable assets from multiple assets.
	Keywords []string `toml:"keywords"`

	// Name is the name of the executable file.
	Name string `toml:"name"`

	// Command is the command to run after installation.
	Command string `toml:"command"`
	// contains filtered or unexported fields
}

App represents an application.

type CLI

type CLI struct{}

CLI represents a CLI for Vin.

func NewCLI

func NewCLI() *CLI

func (*CLI) AskGitHubAccessToken added in v0.2.0

func (c *CLI) AskGitHubAccessToken() error

AskGitHubAccessToken prompts for the GitHub access token.

func (*CLI) Run

func (c *CLI) Run(opt CLIOptions) error

Run runs the CLI.

type CLIOptions added in v0.2.0

type CLIOptions struct {
	SelectApps bool
}

CLIOptions represents options for the CIL.

type Vin

type Vin struct {
	Apps []App `toml:"app"`
	// contains filtered or unexported fields
}

Vin represents a Vin client.

func New

func New(configPath, tokenPath string) (*Vin, error)

New returns a Vin client.

Directories

Path Synopsis
cmd
vin

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL