treesh - Navigate and manipulate in-memory tree objects using a CLI shell
version 0.001
% treesh --help % treesh [opts] treesh> _
Load a tree object (from an Org document):
treesh> load --as animals --driver org --source /home/budi/animals.org treesh> load animals org /home/budi/animals.org
Load another tree object:
treesh> load plants org ~/plants.org
See loaded objects:
treesh> objects +-----------+--------+---------------------------+-----+ | name | driver | source | cwd | +-----------+--------+---------------------------+-----+ | animals | org | /home/budi/animals.json | / | | plants | org | /home/budi/plants.org | / | +-----------+--------+---------------------------+-----+
Dump a loaded object:
treesh> dumpobj animals ...
Browse top-level children of a tree object:
treesh> setcurobj plants treesh> ls -l ...
or:
treesh> ls -l --obj plants ...
Change "directory" to view another part of the tree (from hereon, please remember that you can set the object you want to work with with setcurobj command first, or specify the name of the object using --object option):
setcurobj
--object
treesh> cd /dog treesh> ls -l
Removing nodes of a tree object:
treesh> rm poo*
[NOT YET IMPLEMENTED] Reload an object from file (reverting all modifications):
treesh> reloadobj animals
[NOT YET IMPLEMENTED] Save a loaded object to file:
treesh> saveobj animals
[NOT YET IMPLEMENTED] Save a loaded object to another file:
treesh> saveobj animals /home/budi/animals-new.org
This utility lets you navigate and manipulate in-memory tree objects. Currently supported tree objects:
Org (parsed using Org::Parser::Tiny)
JSON [NOT YET IMPLEMETED]
YAML [NOT YET IMPLEMETED]
HTML [NOT YET IMPLEMETED]
PPI [NOT YET IMPLEMETED]
You can then browse the tree as if it were a filesystem, using command like cd and ls. You can prune nodes, add/modify nodes, as well as move/copy nodes around. You can save the changes back to file.
cd
ls
--help-, -h, -?
Show short help message and exit.
--version, -v
Show version and exit.
For now, use help command, or command --help.
help
--help
Settings are configuration and regulate how the shell behaves.
text
Set output format for command results. The same formatting is used by Perinci::CmdLine. See that module or Perinci::Result::Format for more details.
Whether to show debugging information when doing tab completion.
Whether to show how long a command takes.
It looks to be an issue with Term::ReadLine::Perl. Try installing Term::ReadLine::Gnu instead.
treesh is meant to be a simple shell, not a full-blown Unix shell. So this feature is currently not implemented.
Again, treesh is meant to be a simple shell, not a full-blown Unix shell. So those features are currently not implemented.
~/.treesh_history
Specify location of command history file. Like in shells, can be set to empty string to disable history loading/saving.
~/.treeshrc
Specify location of settings file.
Command history file.
Settings file (IOD format).
perlancar <perlancar@cpan.org>
This software is copyright (c) 2020 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Tree::Shell, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tree::Shell
CPAN shell
perl -MCPAN -e shell install Tree::Shell
For more information on module installation, please visit the detailed CPAN module installation guide.