Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
A command-line tool to create real file structures on your system from tree-like representations. Easily replicate directory and file structures from your favorite articles, tutorials, LLM answers, or even from tree -F
outputs from other users! Just copy the tree structure to your clipboard and you're ready to recreate it on your system.
./
├── src/
│ ├── main.py
│ └── utils.py
├── tests/
│ └── test_main.py
└── README.md
and creates them in your system.
tree -F
command.Install hoc
from PyPI using pip
:
pip install house-of-cards
or run it using pipx:
pipx run house-of-cards
or even single runs with uvx:
uvx house-of-cards
hoc
can be used directly from the command line. It reads the file structure string from the clipboard or a file and creates the corresponding directory and file structure at the specified base path.
hoc <base_path> [options]
[!NOTE]
If the dir that was chosen as base for the generated file structure does not exist it will be created.
-f, --file FILENAME
: File containing the tree structure. If not provided, the clipboard content will be used.-dp, --dir-permissions PERMISSIONS
: Octal permissions for created directories (e.g., 755).-fp, --file-permissions PERMISSIONS
: Octal permissions for created files (e.g., 644).-h, --help
: Show the help message and exit.You can generate a directory structure based on the contents of your clipboard. Just copy the tree-like structure from your favorite tutorial, LLM answer, documentation or the output of a:
`tree -F .`
command and run hoc by just specifying the base path.
hoc /relative/base/path
Try it by copying the following structure to your clipboard:
etc/
├── apache2/
│ ├── apache2.conf
│ ├── envvars
│ ├── magic
│ ├── mods-available/
│ ├── mods-enabled/
│ ├── sites-available/
│ └── sites-enabled/
├── network/
│ ├── if-up.d/
│ ├── if-down.d/
│ └── interfaces
├── passwd
├── shadow
├── group
└── hosts
and running:
hoc ~/hoc_test
or
hoc
If you want to use the current directory as the base path.
Create a file named structure.txt with the following content:
./
├── apache2/
│ ├── apache2.conf
│ ├── envvars
│ ├── magic
│ ├── mods-available/
│ ├── mods-enabled/
│ ├── sites-available/
│ └── sites-enabled/
├── network/
│ ├── if-up.d/
│ ├── if-down.d/
│ └── interfaces
├── passwd
├── shadow
├── group
└── hosts
Run hoc to create the structure:
hoc /relative/base/path -f structure.txt
You can set the permissions for directories and files using the -dp
and -fp
options. For example, to set the permissions for directories to 755 and for files to 644, run:
hoc /relative/base/path -dp 755 -fp 644
You can use hoc to clone file structures to a remote server by copying the structure using:
tree -F /path/to/directory | pbcopy
or
tree -F /path/to/directory | xclip -selection clipboard
and either share the clipboard content with the other user or save it to a file and send it to them. They can then run hoc on their system to create the same structure or run it on the remote server to create the structure there.
This project is licensed under the GNU General Public License version 3. See the LICENSE file for details.
FAQs
A robust CLI tool to create directory structures from tree-like input.
We found that house-of-cards demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.