Help us shape the future of Go! Take the 2026 Go Developer Survey

setup

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package setup sets workline up on a machine, asking what to enable: the global git hooks, the agent, the tools the roles use. Run again, it offers what is set up as the default, so it reconfigures. Each question has a flag answering it; without a terminal, every question must be answered so, or `--yes` takes the defaults (as gh and terraform do).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(a Answers, m Machine) error

Run asks, then sets up. It stops at the first thing that fails.

func Shell

func Shell(out io.Writer) func(string) error

Shell runs a command with sh, its output shown as it goes.

Types

type Answers

type Answers struct {
	Hooks   string   // yes | no; empty: ask
	AI      string   // none | claude | claude:<model>@<effort> | cmd:<command>; empty: ask
	Install []string // the tools to install; nil: ask; empty: none
	Yes     bool     // the default for every question not answered
}

Answers are the questions answered beforehand, by flags.

type Machine

type Machine struct {
	In          io.Reader
	Out         io.Writer
	Interactive bool // In is a terminal
	Bin         string
	Hooks       hooks.Paths
	UserConfig  string   // the file holding `ai:`
	Tools       []string // the tools the roles use
	// Install runs an install command, its output shown as it goes.
	Install func(command string) error
}

Machine is what setup changes, and how it talks.

Jump to

Keyboard shortcuts

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