Updating the question.
I am developing a command-line tool for a framework.
and I am struggling with how to detect if the current directory is a project of my framework.
I have two solutions in mind.

some hidden file in the directory
detect the project structure by files and folders.

What do you think is the best approach?
Thank you,
Shay
Thank you very much
In my opinion, a good idea would be to either have a project directory structure that you can use a signature for the project/framework, that you can use within the tool as a list of signature-like structures, for example
PROJECT_STRUCTURE_SIGNATURES = [ "custom_project", "custom_project/tests", "custom_project/build", "custom_project/config", "config/environments" ] and then just check if any(signature in os.getcwd() for signature in PROJECT_STRUCTURE_SIGNATURES).
if the project structure is not too complex, I suppose that would be a start in order to identify the requirements that you're looking for.
However, if this is not the case, then I suppose a dictionary-like structure that you could use to traverse the key-value pairs similar to the project's file structure and check the current directory against those would be a better idea, where if none of the elements from the nested dictionary traversal matches, then the directory is not within the project structure.
Detect if folder content match file and folders pattern