> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cowagent.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# ls - ディレクトリ一覧

> ディレクトリの内容を一覧表示

**単一ディレクトリ**の内容をアルファベット順にソートして一覧表示します。ディレクトリには `/` が付与され、隠しファイルも含まれます。

## 依存関係

追加の依存関係は不要で、デフォルトで利用可能です。

## パラメータ

| パラメータ   | 型       | 必須  | 説明                                                   |
| ------- | ------- | --- | ---------------------------------------------------- |
| `path`  | string  | いいえ | ディレクトリパス。デフォルトはワークスペースのルート。相対パスはワークスペースディレクトリを基準とします |
| `limit` | integer | いいえ | 返すエントリの最大数、デフォルト500                                  |

## 出力例

```
__init__.py
__pycache__/
credentials.py
diff.py
file_state.py
```

500件または50KBを超えると切り詰められます。

<Note>
  `ls` は1階層のみを対象とし、「このディレクトリに何があるか」に答えます。ディレクトリを横断して再帰的にファイルを探す場合は、[`search_files`](/ja/tools/search-files) の `target=files` をご利用ください。
</Note>

## ユースケース

* プロジェクト構造の閲覧
* ディレクトリの存在と中身の確認
* ファイルを書き込む前に同階層の既存ファイルを確認
