cli

package
v0.1.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 50 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDraftNotMaterializable = errors.New("content sync not yet materialized (no draft bundle synced)")

ErrDraftNotMaterializable signals the expected interim state of a local_git/draft_project that has no synced bundle yet (P5-QUAL-01). It is a "skipped", not a "failed": a freshly synced device legitimately holds draft projects whose content has not been pushed, and counting them as failures re-broke the QUAL-03 exit-code gate (any such workspace exited non-zero).

View Source
var ErrPartialMaterialize = errors.New("one or more projects failed to materialize")

ErrPartialMaterialize signals that the materialize pass completed but one or more projects failed (QUAL-03). The batch is never aborted by a single failure (EAGER-04), but the command exits non-zero so CI/cron gates and `devstrap materialize && ...` chains can detect a failed clone/hydrate.

Functions

func Execute

func Execute(ctx context.Context) error

func ExitCode

func ExitCode(err error) int

func ExitCodeWithWriter

func ExitCodeWithWriter(err error, stderr io.Writer) int

func NewRootCommand

func NewRootCommand(stdout, stderr io.Writer) *cobra.Command

Types

type ForgeKind

type ForgeKind string

ForgeKind identifies the forge hosting a repository (FORGE-01).

const (
	ForgeGitHub    ForgeKind = "github"
	ForgeGitLab    ForgeKind = "gitlab"
	ForgeGitea     ForgeKind = "gitea"
	ForgeBitbucket ForgeKind = "bitbucket"
	ForgeAzure     ForgeKind = "azure"
	ForgeUnknown   ForgeKind = ""
)

func DetectForge

func DetectForge(remoteURL string) ForgeKind

DetectForge infers the forge kind from a remote URL's host (FORGE-01). For self-hosted instances the host will not match known patterns and ForgeUnknown is returned; the caller should prompt for --forge or degrade gracefully. SSH host aliases (~/.ssh/config) are resolved first so `git@work-gitlab:org/repo` maps to the real host (GIT-05).

func ResolveForge

func ResolveForge(remoteURL, flagForge, projectForge string, hostMap map[string]ForgeKind) ForgeKind

ResolveForge resolves the forge kind for a remote with a documented precedence (GIT-05): --forge flag > per-project git_repos.forge_kind column > [forge] host map (config) > DetectForge heuristic. Each tier is only consulted if the prior tier is unset/invalid, so a self-hosted GitLab at git.acme.com can be taught once (host map or project column) and then route to glab without per-call flags.

Jump to

Keyboard shortcuts

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