appname

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package appname is the single source of truth for the running app's *path-safe identifier* — the slug used in `~/.<app>/` for DB, logs, agents Layout, gate spec/socket. Every artefact lands under one tree.

Resolution order (first non-empty wins):

  1. BuildAppName — ldflag-baked at compile time by `wick build`
  2. wick.yml — top-level `name:` field, walked from cwd
  3. "wick" — last-ditch fallback

`APP_NAME` env var is intentionally NOT in this chain. That env holds the human-readable display label (e.g. "My App" with spaces and capitalization) used by the UI / login / systray title — it must not contaminate filesystem paths. Path identifiers come from `name:` in wick.yml, which already enforces no-space slug rules.

The package has zero deps on the rest of the codebase so any other internal package can import it without risking cycles.

Index

Constants

This section is empty.

Variables

View Source
var BuildAppName = ""

BuildAppName is the ldflag injection target. Builder writes here via `-X github.com/yogasw/wick/internal/appname.BuildAppName=<name>`. Empty when not built via `wick build` (e.g. `go run`, VSCode debug).

Functions

func Resolve

func Resolve() string

Resolve returns the active app name. Result is cached for the process lifetime — chain inputs (BuildAppName, env, yml) don't change at runtime, so we resolve exactly once.

Types

This section is empty.

Jump to

Keyboard shortcuts

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