Documentation
¶
Index ¶
- Constants
- func CLI(name string) string
- func DogfoodBinary(name string) string
- func EnvPrefix(name string) string
- func EnvVarPlaceholder(envVar string) string
- func IsCLIDirName(name string) bool
- func IsValidLibraryDirName(name string) bool
- func LegacyCLI(name string) string
- func LibraryDirName(name string) string
- func MCP(name string) string
- func MCPDescription(desc string, noAuth bool, authType string, publicCount, totalCount int) string
- func OneLine(s string) string
- func Snake(s string) string
- func TrimCLISuffix(name string) string
- func ValidationBinary(name string) string
Constants ¶
const ( CurrentCLISuffix = "-pp-cli" LegacyCLISuffix = "-cli" MCPSuffix = "-pp-mcp" )
Variables ¶
This section is empty.
Functions ¶
func DogfoodBinary ¶
func EnvPrefix ¶
EnvPrefix returns an ASCII-only shell-safe environment variable prefix. API display names and OpenAPI titles can contain accents or punctuation ("PokéAPI", "Cal.com", "1Password"); generated env vars must not.
func EnvVarPlaceholder ¶
EnvVarPlaceholder derives the placeholder name from an environment variable. DUB_TOKEN -> token, STYTCH_PROJECT_ID -> project_id.
func IsCLIDirName ¶
func IsValidLibraryDirName ¶
IsValidLibraryDirName returns true if name is a valid library directory name. It accepts both legacy CLI directory names (e.g. "dub-pp-cli", "dub-pp-cli-2") and slug-keyed names (e.g. "dub", "cal-com", "dub-2"). It rejects empty strings, path separators, ".." components, and dotfiles. This is Layer 1 input validation; callers that use the name in filepath.Join must still apply Layer 2 containment.
func LibraryDirName ¶
LibraryDirName maps a CLI-style name to the corresponding library directory key while preserving rerun suffixes. Examples:
- "dub-pp-cli" -> "dub"
- "dub-pp-cli-2" -> "dub-2"
- "dub-2-pp-cli" -> "dub-2"
Bare slug-keyed names are returned unchanged.
func MCPDescription ¶
MCPDescription builds an MCP tool description with optional minority-side auth annotation. It annotates only when an API has a mix of public and auth-required tools, and only the minority side gets annotated.
func Snake ¶
Snake converts CamelCase to snake_case for generated tool name segments. Hyphens are intentionally preserved to match the historical MCP template helper behavior.
func TrimCLISuffix ¶
func ValidationBinary ¶
Types ¶
This section is empty.