Using composer - basics with localhost Mamp
Posting as an answer instead of a comment.

You run Composer from the project directory, which is where your composer.json and .lock file (which will get generated for you) lives.

I can work on any project at any time in the CLI by cd ing to the project I want to work on. Composer understands that this is the working directory in that execution.

So, no matter where you are in your server, Composer will execute in the directory you are currently in.