Skip to content

Commit 59b0e44

Browse files
committed
safecmd docs
1 parent 9999623 commit 59b0e44

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,42 @@ See the [LiteLLM providers
405405
documentation](https://docs.litellm.ai/docs/providers) for the complete
406406
list of supported providers and their model naming conventions.
407407

408+
### Bash Tool (Safe Command Execution)
409+
410+
ShellSage can execute shell commands on your behalf using the [safecmd](https://github.com/AnswerDotAI/safecmd) library, which provides a safety layer via an allow-list approach.
411+
412+
#### Enabling the Bash Tool
413+
414+
Add to your config file (`~/.config/shell_sage/shell_sage.conf`):
415+
416+
```
417+
safecmd = true
418+
```
419+
420+
#### How It Works
421+
422+
When enabled, ShellSage gains access to a `bash` tool that:
423+
424+
- Validates commands against a curated allow-list before execution
425+
- Supports pipes, redirects, and shell operators
426+
- Blocks potentially destructive operations by default
427+
- Can be customized with `rm_cmds` and `rm_dests` parameters to restrict allowed commands/destinations
428+
429+
#### Example Usage
430+
431+
```sh
432+
ssage "what files are in this directory and how big are they?"
433+
# ShellSage can now run `ls -la` or `du -sh *` to answer
434+
```
435+
436+
ShellSage will show you the command it's about to run. Unless you've added `bash` to your trust list, you'll be prompted to confirm before execution.
437+
438+
#### Safety Considerations
439+
440+
- Review commands before confirming – even with allow-lists, verify the command makes sense
441+
- To auto-approve bash commands, add `trust = bash` to your config (use with caution)
442+
- See the [safecmd documentation](https://github.com/AnswerDotAI/safecmd) for details on the allow-list
443+
408444
### Command Line Overrides
409445

410446
Any configuration option can be temporarily overridden via command line

0 commit comments

Comments
 (0)