Overview
The Filesystem API provides endpoints for browsing repository files and discovering git repositories on the local filesystem. Base URL:http://localhost:8887/api/filesystem
List Directory
List files and subdirectories in a given path.Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | ✅ | Directory path to list |
showHidden | boolean | ⚠️ | Include hidden files (default: false) |
recursive | boolean | ⚠️ | Recursively list subdirectories (default: false) |
maxDepth | integer | ⚠️ | Max recursion depth (default: 1) |
Response Fields
| Field | Type | Description |
|---|---|---|
path | string | Directory path that was listed |
entries | array | List of files and directories |
entries[].name | string | File or directory name |
entries[].path | string | Absolute path |
entries[].type | enum | file or directory |
entries[].isGitRepo | boolean | Is a git repository (directories only) |
entries[].hidden | boolean | Hidden file/directory |
entries[].size | integer | Size in bytes |
entries[].modifiedAt | string | Last modified timestamp |
entries[].permissions | string | Unix-style permissions |
totalEntries | integer | Total number of entries |
directories | integer | Number of directories |
files | integer | Number of files |
gitRepos | integer | Number of git repositories found |
List Git Repositories
Discover all git repositories under a given path.Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | ✅ | Root path to search |
maxDepth | integer | ⚠️ | Max directory depth (default: 3) |
includeSubmodules | boolean | ⚠️ | Include git submodules (default: true) |
Response Fields
| Field | Type | Description |
|---|---|---|
searchPath | string | Root path that was searched |
repositories | array | List of discovered git repositories |
repositories[].name | string | Repository name (directory name) |
repositories[].path | string | Absolute path to repository |
repositories[].gitPath | string | Path to .git directory |
repositories[].isSubmodule | boolean | Is a git submodule |
repositories[].branch | string | Current branch |
repositories[].hasUncommittedChanges | boolean | Has uncommitted changes |
repositories[].hasUnpushedCommits | boolean | Has unpushed commits |
repositories[].remotes | array | Configured git remotes |
repositories[].lastCommit | object | Most recent commit info |
totalFound | integer | Total repositories found |
searchDepth | integer | Depth of search performed |
searchDuration | integer | Search duration in milliseconds |
Use Cases
Project Selection
Use filesystem browsing to help users select a git repository when creating a new Forge project:Repository Discovery
Automatically discover all git repositories on the system:File Browser
Build a file browser interface for selecting files to include in task context:SDK Examples
JavaScript/TypeScript
Python
Security Considerations
Path Traversal Protection: The Filesystem API includes built-in protection against path traversal attacks. Requests attempting to access paths outside allowed directories will be rejected.
Allowed Directories
By default, filesystem access is restricted to:- User’s home directory
- Common project directories (
~/projects,~/Documents,~/workspace) - Directories explicitly added to Forge projects
Blocked Paths
The following paths are always blocked:/etc- System configuration/var- System variables/sys- System files/proc- Process information- Root filesystem access (requires explicit configuration)

