@terzitech/flathier-cli
v0.1.0-demo.4
Published
CLI and TUX for the flathier library to create and manipulate flat hierarchical data right from the terminal.
Readme
flathier-cli
flathier-cli is a command-line interface (CLI) and terminal-based user experience (TUX) tool for creating and manipulating flat hierarchical data structures. It provides a simple and intuitive way to manage hierarchical data directly from the terminal.
It uses the flathier library, also by Terzi Tech, which is a node.js library for creating and managing the flat hierarchy data structure. No other dependencies are required, making it lightweight and easy to integrate into existing projects.
Note: This project has been developed to be the core library of
ReqText, a tool for managing requirements. I designed it for a specific use case however I found it useful for other use cases as well, which is why I am releasing it as an open source package. I will continue to develop it and add to this documentation for ease of startup and use.
Features
- Command-line Interface: Perform operations like adding, deleting, promoting, and demoting items in a flat hierarchy.
- Interactive Editor: A terminal-based editor (
fhr-editor) for navigating and modifying hierarchical data in real-time. - Customizable Templates: Use predefined templates to initialize and manage hierarchical data structures.
- Lightweight and Dependency-Free: Built with minimal dependencies for fast and efficient usage.
Installation
Install the CLI locally using npm:
npm install @terzitech/flathier-cliUsage:
npx fhr init <file_name>Single Commands:
npx fhr <command> <args>For the interactive editor:
npx fhr-editor
Usage
CLI Commands
Run the CLI using the fhr command. Below are the available commands:
fhr help: Display help and usage information.fhr init <file_name>: Initialize a new hierarchical data file.fhr add: Add a new item to the end of the hierarchy.fhr add_after <outline>: Add a new item after a specific outline.fhr delete <outline>: Delete an item by its outline.fhr version: Display the current version of the CLI.
Interactive Editor
Launch the interactive editor using:
npx fhr-editorKey Bindings
- Arrow Keys: Navigate through the hierarchy.
- Enter: Edit the title of the selected item.
- Ctrl+n: Add a new item.
- Backspace/Delete: Delete the selected item.
- Shift+Up/Down: Move the selected item up or down.
- Left/Right: Promote or demote the selected item.
- Escape: Exit the editor.
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with a detailed description of your changes.
License
This project is licensed under the AGPL-3.0 License. See the LICENSE file for details.
Acknowledgments
Special thanks to the contributors and the open-source community for their support.
Feel free to reach out with any questions or feedback!
