# tmuxp.workspace.finders.find_workspace_file

- **Module:** tmuxp.workspace.finders
- **Package:** tmuxp
- **Language:** Python
- **Kind:** function
- **Source:** https://github.com/tmux-python/tmuxp/blob/153acdf6ff1268b14d3d03ed488f545a7123c8f1/src/tmuxp/workspace/finders.py#L285
- **Page:** https://libtmux.org/en/py/latest/workspace/reference/tmuxp-workspace-finders-find_workspace_file/

```
tmuxp.workspace.finders.find_workspace_file(workspace_file: StrPath, workspace_dir: StrPath | None = None) -> str
```

Return the real config path or raise an exception.

If workspace file is directory, scan for .tmuxp.{yaml,yml,json} in directory. If
one or more found, it will warn and pick the first.

If workspace file is ".", "./" or None, it will scan current directory.

If workspace file is has no path and only a filename, e.g. "my_workspace.yaml" it
will search workspace dir.

If workspace file has no path and no extension, e.g. "my_workspace", it will scan
for file name with yaml, yml and json. If multiple exist, it will warn and pick the
first.

## Parameters

- `workspace_file` (StrPath): Workspace file, valid examples:
- a file name, my_workspace.yaml
- relative path, ../my_workspace.yaml or ../project
- a period, .
- `workspace_dir` (StrPath | None)

## Returns

str
    Resolved absolute path to workspace file.

## Raises

- `FileNotFoundError`: If workspace file cannot be found.
