Poor mans mind mapping tool with just the terminal

Published on 2022-09-15. Modified on 2022-09-15.

So, I saw the Hacker News post about h-m-m (hackers mind map) and thought, "We could do something similar with just the terminal and tree".

Now, this of course has no where near the functionality build into the h-m-m tool by Nader K. Rad, but sometimes you just want a really basic and simple solution.

So, it looks like this.

$ tree
.
├── a-mind-mapping-tool
│   ├── free-and-open-source
│   ├── really-fast
│   ├── text-based
│   └── with-lots-of-cool-features
│       ├── bar
│       ├── baz
│       │   ├── maa
│       │   ├── mee
│       │   └── moo
│       └── foo
├── blablabla
│   ├── adding-removing-and-editing
│   ├── relative-navigating-and-moving
│   └── search
│       ├── bar
│       ├── baz
│       └── foo
├── compatibility
├── configuration
├── data-format
├── feedback
└── installing

If you want to colapse the tree, use the -d option.

$ tree -d
.
├── a-mind-mapping-tool
│   └── with-lots-of-cool-features
│       └── baz
├── blablabla
│   └── search
├── compatibility
├── configuration
├── data-format
├── feedback
└── installing

You can also use coloring if you want the directories to stand out.

$ tree -C
.
├── a-mind-mapping-tool
│   ├── free-and-open-source
│   ├── really-fast
│   ├── text-based
│   └── with-lots-of-cool-features
│       ├── bar
│       ├── baz
│       │   ├── maa
│       │   ├── mee
│       │   └── moo
│       └── foo
├── blablabla
│   ├── adding-removing-and-editing
│   ├── relative-navigating-and-moving
│   └── search
│       ├── bar
│       ├── baz
│       └── foo
├── compatibility
├── configuration
├── data-format
├── feedback
└── installing

If you need an item in the map to contain more relevant information you can use an .info file combined with the --info option for tree (which simulates expansion). The .info file must use tabs, not spaces, and it goes into the specific directory containing the item(s) you need to print more information about

$ cat a-mind-mapping-tool/.info
really-fast
		Faster than lightning,
		but safer than Rust!

text-based
		This is purely text based,
		so it is really easy to search and manipulation
		using just standard UNIX command line tools

Then it looks like this:

$ tree --info
.
├── a-mind-mapping-tool
│   ├── free-and-open-source
│   ├── really-fast
│   │    ⎧      Faster than lightning,
│   │    ⎩      but safer than Rust!
│   ├── text-based
│   │    ⎧      This is purely text based,
│   │    ⎨      so it is really easy to search and manipulation
│   │    ⎩      using just standard UNIX command line tools
│   └── with-lots-of-cool-features
│       ├── bar
│       ├── baz
│       │   ├── maa
│       │   ├── mee
│       │   └── moo
│       └── foo
├── blablabla
│   ├── adding-removing-and-editing
│   ├── relative-navigating-and-moving
│   └── search
│       ├── bar
│       ├── baz
│       └── foo
├── compatibility
├── configuration
├── data-format
├── feedback
└── installing

A "poor mans" mind map with nothing but the terminal and a couple of basic UNIX commands.

You can also use different kinds of sorting with tree as well, take a look at the man page 😉

Update: There exist multiple versions of tree. The one I use in this post is unix-tree, which is the one that Arch Linux, Debian and FreeBSD uses, which is the GNU version from 1991, but it has since been updated with multiple features. On Arch it's version 2.0.4, on Debian stable it's version 2.0.0, but testing has version 2.0.4. On OpenBSD it's the colortree package, yet as of writing both STABLE and CURRENT is running with version 1.8.0, which is missing the .info feature. FreeBSD 13.1 RELEASE has version 2.0.2.

You can easily compile and install unix-tree yourself, if you need any of the more "fancy" stuff.