Documentation
¶
Index ¶
- Variables
- func CleanPath(p string) string
- func CmdAlias(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdAwk(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdBase64(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdBasename(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdBracket(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdCat(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdCd(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdClear(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdColumn(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdComm(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdCommand(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdCut(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdDate(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdDiff(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdDirname(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdDu(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdEcho(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdEnv(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdEval(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdExpand(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdExport(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdExpr(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdFalse(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdFind(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdFold(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdGrep(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdHead(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdHelp(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdHistory(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdHostname(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdJoin(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdJq(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdLs(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdMd5sum(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdNl(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdPaste(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdPrintenv(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdPrintf(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdPublish(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdRead(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdRev(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdSed(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdSeq(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdSet(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdSha1sum(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdSha256sum(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdSkills(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdSleep(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdSort(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdSource(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdStat(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdTac(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdTail(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdTee(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdTest(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdTime(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdTimeout(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdTr(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdTree(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdTrue(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdType(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdUnalias(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdUnexpand(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdUniq(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdUnset(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdVersion(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdWc(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdWhich(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdWhoami(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func CmdXargs(ctx CmdContext, args []string, w io.Writer, errW io.Writer, stdin io.Reader) int
- func IsKnown(name string) bool
- func PrintLong(w io.Writer, f *FileInfo)
- func ReadInputLines(ctx CmdContext, files []string, stdin io.Reader, errW io.Writer, ...) ([]string, int)
- func Register(name string, fn CmdFunc)
- func RegisterPublishTarget(name, diskDir string, maxFileSize int64)
- func RegisterSkill(name, description, content string)
- func WalkDir(fsys FileSystem, root string, ...) error
- type CmdContext
- type CmdFunc
- type FileInfo
- type FileSystem
- type PublishTarget
- type SkillEntry
Constants ¶
This section is empty.
Variables ¶
var ( PublishTargets []PublishTarget PublishBaseURL string )
Package-level publish state. Populated by the server at startup via RegisterPublishTarget and PublishBaseURL. See docs/openlore-cli-wart-audit.md (W-01/W-02) for the planned migration onto Shell/CmdContext.
var Registry = map[string]CmdFunc{}
Registry maps command names to their implementations.
var Skills []SkillEntry
Skills holds dynamically registered skill commands.
var VersionString = "unknown"
VersionString is set by the server at init time.
Functions ¶
func CmdBasename ¶
func CmdBracket ¶
func CmdCommand ¶
func CmdDirname ¶
func CmdHistory ¶
func CmdHostname ¶
func CmdPrintenv ¶
func CmdPublish ¶
CmdPublish writes stdin to a file inside a writable docset. The session's writable docsets are supplied via the OPENLORE_DOCSETS env var (set by the server from the identity's `publish` list). Writes are whole-file: the command buffers stdin and writes once.
func CmdSha1sum ¶
func CmdSha256sum ¶
func CmdTimeout ¶
func CmdUnalias ¶
func CmdUnexpand ¶
func CmdVersion ¶
CmdVersion prints the OpenLore version.
func ReadInputLines ¶
func ReadInputLines(ctx CmdContext, files []string, stdin io.Reader, errW io.Writer, cmdName string) ([]string, int)
ReadInputLines reads lines from files or stdin, used by many text commands.
func RegisterPublishTarget ¶
RegisterPublishTarget registers a writable docset. Append-only.
func RegisterSkill ¶
func RegisterSkill(name, description, content string)
RegisterSkill adds a skill as a shell command.
Types ¶
type CmdContext ¶
type CmdContext interface {
FS() FileSystem
Cwd() string
SetCwd(dir string)
Resolve(path string) string
GetEnv(key string) string
SetEnv(key, value string)
DeleteEnv(key string)
AllEnv() map[string]string
Exec(cmdLine string, w io.Writer, errW io.Writer, stdin io.Reader) int
ExecPipeline(line string, w io.Writer, errW io.Writer, stdin io.Reader) int
}
CmdContext provides the interface that commands use to interact with the shell. Implemented by bashfs.Shell.
type FileInfo ¶
type FileInfo struct {
FileName string
FilePath string
Content []byte
Dir bool
FileModTime time.Time
FileSize int64
}
FileInfo represents a file or directory in the virtual filesystem.
type FileSystem ¶
type FileSystem interface {
Stat(path string) (*FileInfo, error)
ReadDir(path string) ([]FileInfo, error)
ReadFile(path string) ([]byte, error)
}
FileSystem is the read-only filesystem interface that all commands operate on.
type PublishTarget ¶
PublishTarget is a writable docset: its logical name (the first path segment used in `publish /<name>/<file>`) mapped to an on-disk directory.
type SkillEntry ¶
SkillEntry is a registered skill command.
Source Files
¶
- awk.go
- base64_cmd.go
- basename.go
- cat.go
- cd.go
- checksum.go
- column.go
- comm.go
- context.go
- cut.go
- date.go
- diff.go
- du.go
- echo.go
- env.go
- expand.go
- export.go
- expr.go
- find.go
- fold.go
- grep.go
- head.go
- help.go
- helpers.go
- history.go
- join.go
- jq.go
- ls.go
- misc.go
- nl.go
- paste.go
- printf.go
- publish.go
- read_cmd.go
- registry.go
- rev.go
- sed.go
- seq.go
- skills.go
- sort_cmd.go
- source.go
- stat.go
- tac.go
- tail.go
- tee.go
- test_cmd.go
- tr.go
- tree.go
- type_cmd.go
- uniq.go
- version.go
- wc.go
- which.go
- whoami.go
- xargs.go