A virtual jailed shell environment for Go apps backed by an io/fs#FS.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(command): add hostname returning localhost

Implements a fake hostname command that ignores all arguments and
writes "localhost\n" to stdout with exit code 0. Registered under
the coreutils registry alongside ls.

Assisted-by: Claude Opus 4.7 via Claude Code
Signed-off-by: Xe Iaso <me@xeiaso.net>

Xe Iaso e51d0bc8 1d68ebbb

+19
+17
command/internal/hostname/hostname.go
··· 1 + package hostname 2 + 3 + import ( 4 + "context" 5 + "io" 6 + 7 + "tangled.org/xeiaso.net/kefka/command" 8 + ) 9 + 10 + type Impl struct{} 11 + 12 + func (Impl) Exec(ctx context.Context, ec *command.ExecContext, args []string) error { 13 + if ec != nil && ec.Stdout != nil { 14 + io.WriteString(ec.Stdout, "localhost\n") 15 + } 16 + return nil 17 + }
+2
command/registry/coreutils/coreutils.go
··· 1 1 package coreutils 2 2 3 3 import ( 4 + "tangled.org/xeiaso.net/kefka/command/internal/hostname" 4 5 "tangled.org/xeiaso.net/kefka/command/internal/ls" 5 6 "tangled.org/xeiaso.net/kefka/command/registry" 6 7 ) 7 8 8 9 func Register(reg *registry.Impl) { 10 + reg.Register("hostname", hostname.Impl{}) 9 11 reg.Register("ls", ls.Impl{}) 10 12 }