Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emad-elsaid/dirtree
Visualizing files paths as an interactive tree, works nicely with gnu linux tools such as find, ls, or git ls-files
https://github.com/emad-elsaid/dirtree
cli d3js ruby visualizer
Last synced: 2 months ago
JSON representation
Visualizing files paths as an interactive tree, works nicely with gnu linux tools such as find, ls, or git ls-files
- Host: GitHub
- URL: https://github.com/emad-elsaid/dirtree
- Owner: emad-elsaid
- License: mit
- Created: 2017-06-25T14:03:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-09-12T18:04:43.000Z (over 4 years ago)
- Last Synced: 2024-10-21T02:02:28.709Z (3 months ago)
- Topics: cli, d3js, ruby, visualizer
- Language: HTML
- Size: 274 KB
- Stars: 119
- Watchers: 4
- Forks: 11
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Dirtree
[![Gem Version](https://badge.fury.io/rb/dirtree.svg)](https://badge.fury.io/rb/dirtree)
Dirtree visualizes an list of file paths into a tree graph, printed as HTML page, it can be useful in visualizing a whole project you're working on to start cleanup or organizing your code or spotting large directories or unneeded files.
## Tree template
![http://i.imgur.com/cGhx0lG.png](http://i.imgur.com/cGhx0lG.png)## Flame Graph template
![https://i.imgur.com/eSTlQNE.png](https://i.imgur.com/eSTlQNE.png)## Circles template
![http://i.imgur.com/WvfOgCp.png](http://i.imgur.com/WvfOgCp.png)## Treemap template
![https://i.imgur.com/quO67Ky.png](https://i.imgur.com/quO67Ky.png)## Installation
$ gem install dirtree
## Usage
Usage: dirtree [options]... [file]...
To get autocompletion functionality
run: dirtree completion >> ~/.bashrc
Or, dirtree completion > /usr/local/etc/bash_completion.d/dirtree
-v, --version Print version
-h, --help Show this help text
-l, --local-dependencies Use saved JavaScript libraries instead of downloading them
-s, --screenshot Get an image screenshot of the directory tree
-o, --output=File.html Specify a path to write HTML output
-t, --template=TemplateName Specify the template name, available templates ["tree", "circles", "flame", "treemap"]## Examples
**Visualize current directory recursively**
```
$ dirtree -o output.html **/* *
```make sure you have `globstar` on
```
$ shopt -s globstar
```**Visualize files from git ls**
```
$ git ls-files | dirtree -o output.html
```**Dirtree prints to standard output if no --output option specified so you can redirect it**
```
$ git ls-files | dirtree > output.html
```**visualize only files that include specific word**
```
$ git ls-files | grep keyword | dirtree > output.html
```**works with find**
visualize all files that ends with `rb`
```
$ find ~ -name *rb | dirtree > output.html
```**With ag:silver searcher**
```
$ ag -l | dirtree -o output.html
```## Conjunctions
* [lsgh](https://www.github.com/emad-elsaid/lsgh) Draw a tree for a github user/org and open pull requests.
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/emad-elsaid/dirtree.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).