Run command

Session.RunCommand on the one SDK, pkg/abox.

Guest /bin/sh -c. This is a supervisor RPC, not the model-tool approval gate. Default command: uname -a && pwd && ls. Extra args are the command (go run . cat /etc/os-release). Model-authored shell: Approvals.

CLI

The CLI has no supervisor RunCommand probe. --probe-vm only calls list_files. Host-initiated shell is SDK-only.

Model-authored run_command is the approvals gate: the TUI prompts; abox exec denies.

abox --probe-vm
abox                                 # TUI; model shell prompts
abox exec --prompt "Run uname -a"    # denied (no approver)

SDK

package main

import (
	"context"
	"fmt"
	"os"
	"strings"

	"github.com/AdminTurnedDevOps/ABox/pkg/abox"
)

func main() {
	cmd := "uname -a && pwd && ls"
	if len(os.Args) > 1 {
		cmd = strings.Join(os.Args[1:], " ")
	}
	ctx := context.Background()
	sess, err := abox.Open(ctx, abox.Options{})
	if err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
	defer sess.Close()
	res, err := sess.RunCommand(ctx, cmd, 15)
	if err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
	fmt.Print(res.Stdout)
	fmt.Fprint(os.Stderr, res.Stderr)
	fmt.Println("exit", res.ExitCode, "dur", res.Duration)
}