importer

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 12 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 importer onboards an existing ~/.ssh into the manifest + inventory. It parses an ssh config (following relative Include directives) into profiles + hosts, fingerprints any private keys it can find into the inventory, and adopts non-canonical keys into the profiles/ layout. Profile assignment derives from an IdentityFile under profiles/<profile>/ or profiles/<category>/<profile>/ (which also carries the category over), else "imported".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImportResult

type ImportResult struct {
	Profiles  map[string]int // profile -> host count (counts all parsed hosts)
	KeysFound int
	Adopted   int
	DryRun    bool
	// Skipped names each host left out because the manifest would refuse it
	// (e.g. a hostname ssh itself refuses), with the reason.
	Skipped []string
}

ImportResult summarizes an import run.

func (ImportResult) Format

func (r ImportResult) Format() string

Format renders the human-readable import summary (mirrors ImportResult.format).

type Importer

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

Importer onboards an ssh config.

func New

func New(p paths.Paths, emitUseKeychain bool) *Importer

New builds an importer.

func (*Importer) Run

func (im *Importer) Run(configPath string, dryRun bool) (ImportResult, error)

Run parses configPath into a fresh manifest + inventory (replacing any existing). With dryRun it parses and reports without writing or adopting keys.

type ParsedHost

type ParsedHost struct {
	Alias        string
	Hostname     string
	User         string
	Port         int
	IdentityFile string // "" if none
	Profile      string
	Category     string // "" unless the IdentityFile sat under profiles/<category>/<profile>/
	Extra        []kv
}

ParsedHost is one host block parsed from an ssh config.

Jump to

Keyboard shortcuts

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