doc.go

 1package shell
 2
 3// Example usage of the shell package:
 4//
 5// 1. For one-off commands:
 6//
 7//	shell := shell.NewShell(nil)
 8//	stdout, stderr, err := shell.Exec(context.Background(), "echo hello")
 9//
10// 2. For maintaining state across commands:
11//
12//	shell := shell.NewShell(&shell.Options{
13//	    WorkingDir: "/tmp",
14//	    Logger: myLogger,
15//	})
16//	shell.Exec(ctx, "export FOO=bar")
17//	shell.Exec(ctx, "echo $FOO")  // Will print "bar"
18//
19// 3. Managing environment and working directory:
20//
21//	shell := shell.NewShell(nil)
22//	shell.SetEnv("MY_VAR", "value")
23//	shell.SetWorkingDir("/tmp")
24//	cwd := shell.GetWorkingDir()
25//	env := shell.GetEnv()