You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -405,6 +405,42 @@ See the [LiteLLM providers
405
405
documentation](https://docs.litellm.ai/docs/providers) for the complete
406
406
list of supported providers and their model naming conventions.
407
407
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
+
408
444
### Command Line Overrides
409
445
410
446
Any configuration option can be temporarily overridden via command line
0 commit comments