Delete a project file
delete_fileDelete a file from an Overleaf project's local clone, staging the removal for the next push so co-authors keep the file until it is published.
Instructions
Delete a file from the project. The file is removed from the local clone only: it stays in Overleaf, and co-authors keep seeing it, until push_changes publishes the removal. Until then discard_local_changes brings it back, and show_diff shows the pending deletion. Deleting a file a co-author still cites or includes will break their compile, so confirm it is unused first with search_project on its path or label. To replace a file's contents instead, use write_file. path is relative to the project root, as list_files prints it; a directory is refused, and a file sparse checkout keeps off disk is still deleted from the project. Pulls from Overleaf first. Returns a confirmation, or says the path is not in the project and deletes nothing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path of the file to delete, relative to the project root, e.g. sections/old-draft.tex. Directories cannot be deleted, only files. | |
| project | No | Which project to use: its Overleaf address, its 24-character id, or a registered project name. Omit to use the default project. |