________ ________ ________ ________ _______
╱ ╱ ╲╱ ╲╱ ╲╱ ╲_╱ ╲
╱ ╱ ╱ ╱ ╱ ╱
╱ ╱ ╱ ╱ ╱ ╱
╲__╱_____╱╲________╱╲__╱__╱__╱╲___╱____╱╲________╱
The customizable next gen
treecommand with Git integration and TUI.
bat - bat Files in the Treeedit - Edit Files in the Treetokei
nomad is a rewrite of the [tree][tree] command with a ton of additional features such as Git integration, built-in [bat][bat] and [tokei][tokei], the ability to customize its appearance, and even a TUI (terminal UI) mode.
I think the tree command is a useful CLI tool, but is unfortunately lacking some features that I think would make it even better. I decided to build my own next gen tree command that implements the features I would have wanted in the original tree command.
README barely explains what nomad does. Where the hell is the manual?"The manual for nomad was originally this README, but it became too long to comfortably navigate. This README merely serves as a preview of sorts with some information for each feature whereas the manual provides a more in-depth look at nomad.
[The manual is available here][nomad manual] and is also linked in the About section of this repository.
nomad's icons require a [NerdFont][NerdFont] to render correctly. Refer to the [NerdFont installation instructions][NerdFont Installation] to install a NerdFont for your system. It is quite simple to do and will not take too long.
![standard-demo][standard-demo]
By default, nomad will display a tree visual representing the directory structure of the target directory and respect rules specified in ignore-type files such as .gitignores. This behavior may be disabled.
Each item will also be labeled with a NerdFont-supported icon corresponding to its filetype as well as Git status markers indicating the Git status of the file. See the Git Status Markers section to learn more about what each default marker/color represents.
nomad's capabilities are drastically enhanced through the use of item labels.
These are the flags that will apply labels to items within the tree:
| Flag | Function |
|---|---|
-l |
Applies labels to directories only |
-n |
Applies labels to items only |
-L |
Applies labels to directories and items. An alias for -l -n |
bat - bat Files in the Tree
NOTE: Requires a preceeding run in a labeled mode.
Quickly bat files by passing item labels into the bat subcommand.
NOTE: This command works with item and/or directory labels. If directory labels are provided, all items within that directory will be
bated in the order they appear.
edit - Edit Files in the Tree
Opened with [
Neovim][Neovim], the best text editor.NOTE: Requires a preceeding run in a labeled mode.
Quickly edit files by passing item labels into the edit subcommand.
nomad will attempt to open files with your $EDITOR if it is set. If not, it will try the following text editors in this order:
NOTE: This command works with item and/or directory labels. If directory labels are provided, all items within that directory will be opened in a text editor.
tokeiTokei may be accessed through the subcommand or in tree view to display LoC data for individual files.
tokei - Subcommand (Overview)![tokei subcommand demo][tokei subcommand demo]
You can quickly see a tokei summary/overview for a project by using the tokei subcommand.
nd --tokei - Flag (Tree View)![tokei tree demo][tokei tree demo]
You can view tokei statistics for individual files by using the --tokei flag. This will display the lines of blanks, code, comments, and total number of lines for each file.
You can filter out items in a directory by matching or negateing filetypes or globs.
ft match - Including Filetypes and/or Globs
ft negate - Excluding Filetypes and/or Globs
ft options - Viewing Filetype Globs
You can view all the preset globs for each filetype by using the ft options subcommand. Optionally specify a filetype after the subcommand to search/view the globs for that specific filetype.
nomad has Git integration to allow for easy access to commonly used Git subcommands!
Here is a table that contains the default Git status markers, the marker's color, and what it represents:
| Marker | Color | Status |
|---|---|---|
! |
Red | Conflicting |
D |
Red | Deleted |
M |
Orange | Modified |
R |
Orange | Renamed |
TC |
Purple | Type change |
SA |
*Green | Staged, Added |
SD |
*Red | Staged, Deleted |
SM |
*Orange | Staged, Modified |
SR |
*Orange | Staged, Renamed |
STC |
*Purple | Staged, type change |
U |
Gray | Untracked |
* The filename will also be painted the same color.
NOTE: Staged deleted filenames will also be painted with a strikethrough.
If you do not like the default marker or color configuration, you can customize it to your liking.
git add
NOTE: Requires a preceeding run in a labeled mode.
Quickly git add files by passing items labels into the subcommand.
NOTE: This command works with item and/or directory labels. If directory labels are provided, all items within that directory that are tracked by Git and contain a Git status will be added.
git blame
NOTE: Requires a preceeding run in a labeled mode.
Quickly run git blame on a file by passing an item label into the subcommand.
NOTE: This command only accepts one item label.
Commits made by you remain plain while commits made by other authors are painted with a color. Each author is assigned a random color, so these colors will be different each time you run git blame.
Be sure to check out [Mojibar][Mojibar], a cross-platform, quick-access tab and search bar for emojis written by my friend Luke Schenk.
git branch
You can view git branch in tree form. This works especially well if your branch names look like filepaths. Some examples are:
feature/git/something-newbugfix/some-buggit commit
git commit has been integrated for convenience and offers some visual improvements over the original command.
git diff
NOTE: Requires a preceeding run in a labeled mode.
Quickly git diff files by passing item labels into the subcommand. This command offers visual improvements and additional data over the original command.
NOTE: This command works with item and/or directory labels. If directory labels are provided, all items within that directory that are tracked by Git and contain a Git status will be
diffed in the order they appear.
git status
You can view git status in tree form. This command will only display items that are tracked by Git and contain changes or are untracked.
Rootless mode is the TUI (terminal UI) mode that allows you to dynamically interact with directory trees.
There are three primary widgets that you can interact with. Here is a quick description of each widget:
| Widget | Description | Location |
|---|---|---|
| Breadcrumbs | Contains path breadcrumbs for parent directory navigation | Top |
| Inspect | Contains the contents of the selected item | Right |
| Normal | Contains the directory tree | Left |
You can configure/customize nomad without the hassles of creating your own configuration file in the correct directory with the correct syntax.
Here is a list of what you can customize for standard mode:
|, ├, ─, └)-p/--pattern flag)Here is a list of what you can customize for Rootless mode:
The following standard mode settings will also be applied to the Normal widget within Rootless mode:
- Indentation/padding
- Intent characters
- Git markers
config edit - Editing the Configuration File
You can easily access the configuration file by using the config edit subcommand.
config preview - Previewing Your Configurations
You can preview all your configuration options in a dummy tree by using the config preview subcommand.
Be sure to check out the tools that inspired me to create this project!
tree][tree] - the OG commandlsd][lsd] - a modern ls alternative/rewrite$ claude mcp add nomad \
-- python -m otcore.mcp_server <graph>