basename
Extract the final filename from a full file path, stripping directory prefixes. Optionally remove a suffix from the basename.
Instructions
Return the final path component, stripping all directory prefixes. Read-only, no side effects. Returns JSON with the stripped filename. Use to extract filenames from full paths. Not for extracting directory portions — use 'dirname' for the inverse operation. See also 'dirname', 'realpath'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| raw | No | Write one basename per line without a JSON envelope. | |
| paths | Yes | Paths to transform. | |
| suffix | No | Remove suffix from each basename when present. |