Metadata-Version: 2.4
Name: touchtree
Version: 1.5.7
Summary: **touchtree** is a lightweight command-line utility that converts raw text directory trees—like those generated by the `tree` command or produced by AI coding assistants—into real, empty file and folder structures on your file system.
Author: Andrew Kingdom
License: MIT License
        
        Copyright (c) 2026 Andrew Kingdom
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/akingdom/touchtree
Project-URL: Repository, https://github.com/akingdom/touchtree
Project-URL: Issues, https://github.com/akingdom/touchtree/issues
Keywords: cli,directory-tree,scaffolding,file-generator,devtools
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE.md
Dynamic: license-file

# touchtree

[![PyPI version](https://img.shields.io/pypi/v/touchtree.svg)](https://pypi.org/project/touchtree/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python Version](https://img.shields.io/pypi/pyversions/touchtree.svg)](https://pypi.org/project/touchtree/)

**touchtree** is a lightweight command-line utility that converts raw text directory trees—like those generated by the `tree` command or produced by AI coding assistants—into real, empty file and folder structures on your file system.

---

## Key Features

* **Smart Indentation Parsing:** Handles standard spaces, tabs, and ASCII/Unicode box-drawing characters (`├──`, `└──`, `│`).
* **Paste-Aware Terminal Input:** Paste directly into the terminal without accidental termination from mid-tree blank lines.
* **Flexible Termination:** Supports standard terminal signals (`Ctrl+D` / `Ctrl+Z`), explicit sentinels (`EOF` / `END`), or a deliberate human `Enter` keypress.
* **Comment Stripping:** Inline comments starting with `#` are automatically removed before creation.
* **Safe Dry Runs:** Prompts for target directory confirmation before touching the disk.

---

## Quick Start

### Installation

```bash
pip install touchtree

```

---

## Example: From AI Prompt to Real Files

### 1. The Scenario

Suppose an LLM or design spec gives you a desired project structure:

```text
my_awesome_app/
├── src/
│   ├── components/
│   │   ├── Header.py
│   │   └── Sidebar.py   # Main navigation component
│   ├── utils/
│   │   └── helpers.py
│   └── main.py
├── tests/
│   └── test_main.py
├── .gitignore
├── pyproject.toml
└── README.md

```

### 2. Execution Options

#### Option A: Interactive Clipboard Paste (Default)

Run `touchtree` with no arguments, paste the text block, and press `[ENTER]` on a blank line (or press `Ctrl+D` / `Ctrl+Z`):

```bash
touchtree

```

**Terminal Walkthrough:**

```text
No input file provided. Entering interactive mode.
--> Paste your tree text below.
--> To finish, press [ENTER] on a blank line, type 'EOF', or press [Ctrl+D] / [Ctrl+Z].
--------------------------------------------------
my_awesome_app/
├── src/
│   ├── components/
│   │   ├── Header.py
│   │   └── Sidebar.py   # Main navigation component
│   ├── utils/
│   │   └── helpers.py
│   └── main.py
├── tests/
│   └── test_main.py
├── .gitignore
├── pyproject.toml
└── README.md

WARNING: About to generate file structure inside: /path/to/current/dir
Are you sure you want to proceed? (y/N): y
Creating empty replica structure inside: /path/to/current/dir
Structure successfully created.

```

#### Option B: Read From a Saved Text File

If you have saved your structure diagram into `layout.txt`:

```bash
touchtree -i layout.txt

```

#### Option C: Target a Specific Directory with Auto-Confirm

Create the structure inside a targeted directory (`./output`) without confirmation prompts:

```bash
touchtree -i layout.txt -o ./output -y

```

---

## Generated Disk Result

Running the command creates the complete nested folder and file hierarchy:

```text
my_awesome_app/
├── .gitignore
├── README.md
├── pyproject.toml
├── src/
│   ├── components/
│   │   ├── Header.py
│   │   └── Sidebar.py
│   ├── main.py
│   └── utils/
│       └── helpers.py
└── tests/
    └── test_main.py

```

* **Folders** are identified by trailing slashes `/` or names lacking extension dots.
* **Files** with extensions or explicit hidden file dots (`.gitignore`) are instantiated cleanly via empty `touch()` operations.
* **Comments** (like `# Main navigation component`) are stripped away during generation.

---

## CLI Options Reference

| Flag | Long Argument | Description | Default |
| --- | --- | --- | --- |
| `-i` | `--input` | Path to a text file containing the tree structure. | Interactive Mode |
| `-o` | `--output` | Target root folder where files will be created. | Current Dir (`.`) |
| `-y` | `--yes` | Skip confirmation prompt and execute immediately. | `False` |

---

## License

This project is dual-licensed under the [MIT License](https://www.google.com/search?q=LICENSE) for both code and documentation.
