Documentation
¶
Index ¶
- func DerefInt(i *int) int
- func DerefStr(p *string) string
- func EnsureStellaCLIInPath(stellaHome string) error
- func IsJSON(c *ucli.Context) bool
- func JSONFlag() ucli.Flag
- func LoadDotEnv()
- func ParseLogLevel() slog.Level
- func PrintDeleted(c *ucli.Context, id string) error
- func PrintJSON(c *ucli.Context, v any) error
- func ShortID(id string) string
- func Truncate(s string, max int) string
- type LineWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureStellaCLIInPath ¶
EnsureStellaCLIInPath installs the stella CLI binary into $STELLA_HOME/bin/stella for sandbox sessions, whose PATH is intentionally restricted to stella-managed and system directories.
When the running process is stellad (the daemon), the stella CLI binary is located alongside it in the same directory — goreleaser, Homebrew, and nfpm all install both binaries to the same prefix. If the companion binary is not found, the function returns an error rather than copying the daemon.
Do not use a symlink: sandbox path resolution rejects symlink traversal.
func LoadDotEnv ¶ added in v0.43.0
func LoadDotEnv()
LoadDotEnv reads $STELLA_HOME/.env and sets any key that is not already present in the environment. Existing OS/service-injected variables win. Missing file is silently ignored; parse errors are skipped per line.
func ParseLogLevel ¶ added in v0.43.0
ParseLogLevel maps the LOG_LEVEL env var to slog.Level. Supported values: TRACE, DEBUG, INFO, WARN, ERROR (case-insensitive). Defaults to DEBUG if unset or unrecognized.
Types ¶
type LineWriter ¶ added in v0.43.0
type LineWriter struct {
// contains filtered or unexported fields
}
LineWriter is a fmt-style writer bound to a command's stdout that defers error handling: it records the first write error and short-circuits the rest, so human-output helpers check once at the end (via Err) instead of after every line.
func Stderr ¶ added in v0.43.0
func Stderr(c *ucli.Context) *LineWriter
func Stdout ¶ added in v0.43.0
func Stdout(c *ucli.Context) *LineWriter
func (*LineWriter) Err ¶ added in v0.43.0
func (l *LineWriter) Err() error
func (*LineWriter) Printf ¶ added in v0.43.0
func (l *LineWriter) Printf(format string, a ...any)
func (*LineWriter) Println ¶ added in v0.43.0
func (l *LineWriter) Println(a ...any)