Comprehensive guide to mkarchi. Learn how to generate project structures, manage ignore patterns, and integrate with AI tools.
mkarchi requires Python 3.6 or newer. It is distributed via PyPI and can be installed using pip.
pip install mkarchi
Upgrade Note: If you already have mkarchi installed, ensure you are on the latest version (v0.1.7) to access all features described here.
pip install --upgrade mkarchiVerify that the installation was successful:
mkarchi --version
Get up and running in seconds. Define your structure in a text file and apply it.
project.txt).project_root/ ├── src/ │ ├── main.py │ └── utils.py ├── tests/ │ └── test_main.py └── README.md
mkarchi apply project.txt
That's it! mkarchi will create all folders and files defined in your structure.
mkarchi uses a visual, indentation-based syntax. It is designed to be human-readable and easy for LLMs to generate.
The structure is determined by tree characters (│, ├──, └──) or simple spaces. You can copy output directly from the tree command on Linux/Mac.
To define content within a file, use the (begincontenu) and (endcontenu) markers.
Lines starting with # are treated as comments and ignored by the parser.
flask_app/
├── app.py (begincontenu)
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return "Hello World!"
(endcontenu)
│
├── .gitignore (begincontenu)
__pycache__/
venv/
.env
(endcontenu)
│
└── README.md (begincontenu)
# Flask App
Generated by mkarchi.
(endcontenu)Complete reference for all available commands and flags.
mkarchi apply <structure_file>Parses the specified structure file and creates the directory tree and files relative to the current working directory.
mkarchi give [options] [output_file]Scans the current directory and generates a structure file. This is effectively "Reverse Engineering" your project into a generic template.
| Flag | Description | Example |
|---|---|---|
| -c, --no-content | Generate structure only, without file contents. | mkarchi give -c |
| -max=<kb> | v0.1.7+Max file size to include (default: 10KB). | mkarchi give -max=50 |
| --no-max | v0.1.7+Include ALL file contents, regardless of size. | mkarchi give --no-max |
| --no-ignore | v0.1.7+Disable all ignore patterns (includes node_modules, etc). | mkarchi give --no-ignore |
The give command is a powerful tool to "demand" the architecture of an existing project. This is perfect for creating templates, backups, or LLM contexts.
You have a working React setup and want to reuse it.
mkarchi give base_template.txtYou want to save EVERYTHING into a single text file.
mkarchi give --no-max --no-ignore backup.txtBy default, mkarchi ignores common clutter (node_modules, .git, __pycache__). You can override this behavior using a configuration file.
Create a file named .mkarchiignore in your project root. The syntax is identical to .gitignore.
# .mkarchiignore # Ignore node_modules directory node_modules # Ignore environment files .env .env.local # Ignore all log files *.log npm-debug.log* # Ignore build output dist/ build/
mkarchi bridges the gap between AI code generation and your local filesystem.
"Create a Django blog structure using mkarchi syntax..."
Copy the code block generated by the AI.
Paste into struct.txt and run mkarchi apply struct.txt.