agent

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package agent adds keys to the ssh-agent (macOS keychain). ssh-add runs interactively so a passphrase prompt can be answered.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(m *manifest.Manifest, sshDir, profile string, add func(string) bool) ([]string, error)

Load adds a profile's keys to the agent and returns the key names added. A shared key mapped to many hosts is added once. add is the per-key action (Agent.Add in production; injectable for tests). Mirrors facade.load.

Resolved hosts, not KeyRefs - deliberately, and unlike reconcile/validate/ keyaudit, which all walk KeyRefs so a declared-but-unwired key is not overlooked. An agent holds keys for connections; a key no host uses serves no connection, so loading it would put an identity in the agent that is offered to every server the user then talks to.

Types

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

Agent adds private keys to the running ssh-agent.

func New

func New(useKeychain bool) *Agent

New builds an Agent. useKeychain adds --apple-use-keychain (macOS).

func (*Agent) Add

func (a *Agent) Add(keyPath string) bool

Add adds one private key to the agent, interactively (so a passphrase prompt is answerable). Returns true on success. Mirrors agent.Agent.add.

Jump to

Keyboard shortcuts

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