Documentation
¶
Overview ¶
Package installmeta persists install-time metadata to ~/.nself/install-meta.json.
The install source (NSELF_INSTALL_REF env var) is captured at install time by install.sh and persisted here. The value is sanitized to prevent injection.
Schema (v1):
{
"install_source": "hn", // sanitized ref from ?ref= query param or NSELF_INSTALL_REF env
"install_date": "2026-04-20T10:00:00Z",
"cli_version": "1.0.9",
"schema_version": 1,
"_p95_note": "install_source included in ping_api telemetry from v1.1.0 (S54-T05)"
}
The telemetry package reads InstallSource() and sends it in the ping_api telemetry payload as "install_source".
S57-T11 — 2026-04-20
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallSource ¶
func InstallSource() string
InstallSource returns the sanitized install source string, or "unknown" if not set. Safe to call at any time — never errors.
func SanitizeRef ¶
SanitizeRef strips disallowed characters and caps length. Input: raw ref from NSELF_INSTALL_REF or ?ref= query param. Output: safe ASCII string suitable for JSON and logging.