setupidentity

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 12 Imported by: 1 module, 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 setupidentity provides the command to bootstrap the secure environment.

Index

Constants

This section is empty.

Variables

View Source
var SetupIdentityCmd = &cobra.Command{
	Use:   "setup-identity",
	Short: "Bootstraps the secure environment (GPG, Pass, GitHub).",

	Long: `Configures the "Chain of Trust" workflow: GPG Agent, Git signing, Password Store, and GitHub CLI authentication.`,
	RunE: func(cmd *cobra.Command, _ []string) error {
		presenter := ui.NewPresenter(cmd.OutOrStdout(), cmd.ErrOrStderr())
		ctx := cmd.Context()

		presenter.Summary("Secure Environment Bootstrap")

		presenter.Header("1. Configuring Tools & Shell")

		err := configureGPGAgent(ctx, presenter)
		if err != nil {
			return err
		}

		err = configureGitSecurity(ctx, presenter)
		if err != nil {
			return err
		}

		err = configureBashrc(presenter)
		if err != nil {
			return err
		}

		presenter.Newline()

		presenter.Header("2. Identity & Secrets")

		keyID, err := importGPGKey(ctx, presenter)
		if err != nil {
			return err
		}

		err = trustGPGKey(ctx, presenter, keyID)
		if err != nil {
			return err
		}

		err = initPass(ctx, presenter, keyID)
		if err != nil {
			return err
		}

		err = authenticateGitHub(ctx, presenter)
		if err != nil {
			return err
		}

		presenter.Success("Bootstrap Complete! Your environment is secure.")
		presenter.Advice("Run 'source ~/.bashrc' to refresh your shell configuration.")

		return nil
	},
}

SetupIdentityCmd represents the setup-identity command.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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