dirlens 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +39 -12
  2. package/dirlens.py +2 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -21,6 +21,7 @@ Desktop/ (2 dirs, 2 files, 3.74 MB)
21
21
  └── readme.txt (50 KB)
22
22
 
23
23
  5 ディレクトリ, 5 ファイル
24
+ .py ×2 .txt ×1 .zip ×1 .png ×1
24
25
  ```
25
26
 
26
27
  ---
@@ -32,7 +33,12 @@ Desktop/ (2 dirs, 2 files, 3.74 MB)
32
33
  - **自動サイズ変換** — bytes / KB / MB / GB / TB
33
34
  - **ディレクトリサイズ** — サブディレクトリの合計サイズを自動計算
34
35
  - **アイテム数表示** — 各ディレクトリの直下にある dirs / files 数を表示
35
- - **隠しファイル対応**`-a` で表示切り替え(アイテム数にも反映)
36
+ - **拡張子統計**ツリー全体のファイル種別を集計してサマリーに表示
37
+ - **`.gitignore` 対応** — `-g` で `node_modules/` などを自動除外
38
+ - **最終更新日時** — `--date` で各ファイル・ディレクトリの更新日時を相対表示
39
+ - **拡張子フィルタ** — `-t py` など指定した拡張子のみ表示
40
+ - **Markdown出力** — `-m` でコードブロック形式に出力、AIチャットにそのままペースト可
41
+ - **隠しファイル対応** — `-a` で表示切り替え(アイテム数・統計にも反映)
36
42
  - **サイズ順ソート** — `-s` で大きいものから表示
37
43
 
38
44
  ---
@@ -137,27 +143,47 @@ dirlens -a
137
143
  # サイズの大きい順に並べる
138
144
  dirlens -s
139
145
 
146
+ # .gitignore に記載されたファイル・ディレクトリを除外
147
+ dirlens -g
148
+
149
+ # 最終更新日時を相対表示(例: 3日前、2時間前)
150
+ dirlens --date
151
+
152
+ # 指定した拡張子のファイルのみ表示
153
+ dirlens -t py
154
+ dirlens -t md
155
+
156
+ # Markdown コードブロック形式で出力(AI チャットへのペースト用)
157
+ dirlens -m
158
+
140
159
  # カラーなし(パイプ・ファイル書き出し向け)
141
160
  dirlens --no-color
142
161
 
143
- # 組み合わせ例:Desktop を深さ 3・サイズ順で表示
144
- dirlens ~/Desktop -d 3 -s
162
+ # 組み合わせ例:gitignore 除外 + Python のみ + 日付表示
163
+ dirlens -g -t py --date
164
+
165
+ # AI に貼り付けやすい形式で出力
166
+ dirlens -g -m
145
167
 
146
168
  # テキストファイルに書き出す
147
- dirlens --no-color > tree.txt
169
+ dirlens --no-color > dirlens.txt
148
170
  ```
149
171
 
150
172
  ---
151
173
 
152
174
  ## オプション一覧
153
175
 
154
- | オプション | 省略形 | 説明 |
155
- |------------------|--------|------------------------------------------|
156
- | `path` | — | 対象ディレクトリ(省略時はカレント) |
157
- | `--depth N` | `-d N` | 表示する最大の深さ |
158
- | `--all` | `-a` | 隠しファイル・ディレクトリも表示 |
159
- | `--sort-size` | `-s` | サイズが大きい順に並べる |
160
- | `--no-color` | | カラー表示を無効化(リダイレクト時に推奨) |
176
+ | オプション | 省略形 | 説明 |
177
+ |------------------|----------|-------------------------------------------------|
178
+ | `path` | — | 対象ディレクトリ(省略時はカレント) |
179
+ | `--depth N` | `-d N` | 表示する最大の深さ |
180
+ | `--all` | `-a` | 隠しファイル・ディレクトリも表示 |
181
+ | `--sort-size` | `-s` | サイズが大きい順に並べる |
182
+ | `--gitignore` | `-g` | `.gitignore` に記載されたファイルを除外(サブディレクトリも対応) |
183
+ | `--date` | — | 最終更新日時を相対表示(例: 3日前) |
184
+ | `--type EXT` | `-t EXT` | 指定した拡張子のファイルのみ表示(例: `-t py`) |
185
+ | `--markdown` | `-m` | Markdown コードブロック形式で出力(カラー自動無効) |
186
+ | `--no-color` | — | カラー表示を無効化(リダイレクト時に推奨) |
161
187
 
162
188
  ---
163
189
 
@@ -175,8 +201,9 @@ dirlens --no-color > tree.txt
175
201
 
176
202
  ## 仕様・注意事項
177
203
 
178
- - ディレクトリのサイズは **全サブファイルの合計**(隠しファイルを含む)
204
+ - ディレクトリのサイズは **全サブファイルの合計**(隠しファイルを含む、`.gitignore` 対象も含む)
179
205
  - **シンボリックリンク先のディレクトリ**は展開せず `→` マークで表示
180
206
  - 権限がないディレクトリは `[アクセス拒否]` と表示してスキップ
181
207
  - 非常に深いディレクトリ(1万階層以上)は `-d` で深さを制限してください
182
208
  - **ホームフォルダ(`~/`)やルート(`/`)で実行すると固まる場合があります** — サイズ計算は `-d` の表示制限に関わらず底まで全再帰するため、`~/Library` や iCloud Drive など大容量・ネットワークマウントのディレクトリで時間がかかります。プロジェクトフォルダなど範囲を絞って実行してください
209
+ - **`-g` の否定パターン(`!` から始まる行)は現時点で非対応**です
package/dirlens.py CHANGED
@@ -308,7 +308,8 @@ def main():
308
308
  " dirlens --date 最終更新日時を表示\n"
309
309
  " dirlens -t py .py ファイルのみ表示\n"
310
310
  " dirlens -m Markdown コードブロックで出力\n"
311
- " dirlens --no-color カラーなしで表示"
311
+ " dirlens --no-color カラーなしで表示\n"
312
+ " dirlens > dirlens.txt dirlens.txtに書き出す"
312
313
  ),
313
314
  )
314
315
  ap.add_argument("path", nargs="?", default=".", help="対象ディレクトリ(省略時はカレント)")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dirlens",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Directory tree viewer with file sizes / ファイルサイズ付きディレクトリツリー表示ツール",
5
5
  "bin": {
6
6
  "dirlens": "./bin/dirlens"