Skip to main content

一个生成目录树结构的命令行工具

Project description

dir2prompt

一个简单易用的命令行工具,用于生成目录树结构。

功能特点

  • 生成清晰的目录树结构
  • 支持排除指定目录或文件
  • 支持仅包含指定目录或文件
  • 跨平台支持(Windows、macOS、Linux)
  • 简洁的命令行界面

安装

使用 pip 安装:

pip install dir2prompt

使用方法

基本用法

# 显示当前目录的树结构
dir2prompt .

# 显示指定目录的树结构
dir2prompt /path/to/your/project

高级用法

# 排除特定目录
dir2prompt . --ex node_modules --ex .git

# 仅包含特定目录
dir2prompt /project --in src --in docs

# 组合使用排除和包含
dir2prompt /project --ex __pycache__ --in src --in tests

# 输出到文件
dir2prompt . -o tree.txt

命令行选项

  • path: 要扫描的目录路径
  • --ex, --exclude: 排除的路径(可多次使用)
  • --in, --include: 包含的路径(可多次使用)
  • -o, --output: 输出到指定文件
  • -h, --help: 显示帮助信息

示例输出

project/
├── src/
│   ├── __init__.py
│   └── main.py
├── tests/
│   └── test_main.py
├── pyproject.toml
├── README.md
└── LICENSE

开发

如果你想参与开发或自定义功能:

# 克隆仓库
git clone https://github.com/Jeffjeno/dir2prompt.git
cd dir2prompt

# 安装开发依赖
pip install -e .

# 运行工具
dir2prompt .

许可证

MIT License

贡献

欢迎提交 Issue 和 Pull Request!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dir2prompts-0.1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dir2prompts-0.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file dir2prompts-0.1.0.tar.gz.

File metadata

  • Download URL: dir2prompts-0.1.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for dir2prompts-0.1.0.tar.gz
Algorithm Hash digest
SHA256 22b65aa1e86d9e83fe4592d2df9f31873c13235be5d3a8c8a3010ae05e8a95a5
MD5 8579d70690b649ae3c2b06def94b85c7
BLAKE2b-256 400984e9f30b0ca37a9cf1ea43b5efe37bbd7f24c81e72badeae1ca2eb7c1f92

See more details on using hashes here.

File details

Details for the file dir2prompts-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dir2prompts-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for dir2prompts-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 20e3ce4420b1fbb568de400434dbe4835aba7f31c7463b404661ae8c29f870eb
MD5 e06e68e83cb356d790d8570a57a75c28
BLAKE2b-256 51d9d4da20528a06a79509ce2600df362f325e33a2a9aad5e4b68bdee51740ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page