// Copyright 2026 printing-press-golden. Licensed under Apache-2.0. See LICENSE.
// Generated by CLI Printing Press (https://github.com/mvanhorn/cli-printing-press). DO NOT EDIT.

package cobratree

import (
	"os"
	"os/exec"
	"path/filepath"
)

// SiblingCLIPath resolves the companion CLI via sibling-of-executable,
// PRINTING_PRESS_GOLDEN_CLI_PATH env var, then PATH.
func SiblingCLIPath() (string, error) {
	const cliName = "printing-press-golden-pp-cli"
	if exe, err := os.Executable(); err == nil {
		candidate := filepath.Join(filepath.Dir(exe), cliName)
		if _, err := os.Stat(candidate); err == nil {
			return candidate, nil
		}
	}
	if v := os.Getenv("PRINTING_PRESS_GOLDEN_CLI_PATH"); v != "" {
		return v, nil
	}
	return exec.LookPath(cliName)
}
