Bonsai is a CLI tool designed to enhance navigation and execution within command-line environments, featuring an Explorer-like UI for intuitive file management. It allows users to quickly access directories and execute files with ease. Key features include themeable UIs, customization of themes and key bindings, integration with shells like PowerShell, support for regex search, and the ability to track used directories and files in a database.
Ideal for developers, system administrators, and power users, Bonsai boosts productivity by streamlining navigation and file execution. Its customizable interface adapts to individual workflows, enhancing efficiency. Installation is straightforward via winget: winget install donmar.bonsai.
README
bonsai
A simple cli tool that provides a better 'change directory' and file execution experience.
Also a user interface for explorer like navigation is included (themeable).
b # Opens the explorer app at the current working directory
b tempor/consetetur # Changes directory to "C:\tempor\consetetur"
# because tempor/consetetur is a subdirectory of C:\
# We assume that bonsai have already been used and the database
b nonumy # will open an UI aksing which of the two nonumy folders you ment
b tem sum # will change directory to "C:\tempor\lorem\ipsum"
b scing amet.ps1 # will execute "C:\tempor\consetetur\sadipscing\amet.ps1"
Everytime you use bonsai to navigate or execute a file this will be stored in the database.
Load sub directories and files from sub directory (! This could take a bit)
ctrl+R
toggle regex search
alt+UpArror
open parent directory
multiple selection ui
Key
Action
Enter
Select directory/File and exit
Configuration
The configuration is stored in
Windows: %userprofile%\.bonsai
Contents of the folder are:
settings.json
Property
Values
Description
showParentDirectoryInList
true/false
true to shwo the parent directory in explorer as ".."
theme
e.g default.json, justicons.json
The theme file to use which has to be located in the themes folder
maxEntryAgeInDays
integer
The amount of days after which an entry in the database should be removed.
maxIndividualScore
integer
The max score an entry should be able to get. If any entry exceeds this value, scores of all entries will be reduced and all falling below 1 are getting deleted.
commands that should be used when selecting directories. When not set change directory to will be executed If you add a directoryCommand you might want to register also the the change directory command for powershell: {"action": "Set-Location \"[path]\"", "displayName": "Change directory"}
KeyBindingContext:
Common,
ExplorerApp,
NavigationApp
FileCommand
Property
Description
extension
the extension (include the . e.g ".ps1") for which the command should be available. "*" = all files
action
the expression which should be executed =="[path]"== will be replaced with the full qualified name of the file. eg: "code "[path]"" will open Visual Studio Code with the given file
displayName
the name which should be displayed if more than one command is available
the expression which should be executed =="[path]"== will be replaced with the full qualified name of the directory. eg: "ii "[path]"" will open the windows explorer
displayName
the name which should be displayed if more than one command is available