Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,21 @@ To skip the shell and launch an agent (or any command) directly, you can either:

```sh
bwai --command claude
bwai -c "claude --model gemini-2.0-flash-exp"

```

To append arguments to the command configured in `~/.bwai.json`, use `--`:

```sh
# With "command": ["goose"] in config
bwai -- session -r # runs "goose session -r" to resume a session

# With "command": ["claude"] in config
bwai -- --model gemini-2.0-flash-exp # runs "claude --model gemini-2.0-flash-exp"
```

Everything after `--` is passed as extra arguments to the resolved command.

## Configuration

`bwai` works out of the box with no config file. To customise behaviour, create `~/.bwai.json` as a global config. This can be overridden per-run with the `--config` flag:
Expand Down
5 changes: 4 additions & 1 deletion cmd/bwai/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os"
"os/exec"
"path/filepath"
"strings"
)

func main() {
Expand Down Expand Up @@ -59,6 +60,8 @@ func main() {
if *commandFlag != "" {
command = []string{*commandFlag}
}
// Append any trailing args after -- to the resolved command
command = append(command, flag.Args()...)

fmt.Printf("bwai: sandboxed in %s\n", currentDir)
args := []string{
Expand Down Expand Up @@ -122,7 +125,7 @@ func main() {
// running with --unshare-pid (which it does by default).
// By running the command via "bash -i -c goose" the iteractive shell
// prevents it from exiting and goose starts normally.
command = append([]string{"bash", "-i", "-c"}, command...)
command = []string{"bash", "-i", "-c", strings.Join(command, " ")}
}

args = append(args, command...)
Expand Down
Loading