An AI assistant works on the files in one folder: the folder where you start it. So before you start an assistant, you go to the right folder. This guide shows the four commands you need.
A folder (also called a directory) is a place that holds files and other folders. The terminal is always "in" one folder. That folder is the current folder. A new terminal usually starts in your home folder: the folder with your user name. On a Mac, ~ is a short name for the home folder.
You need an open terminal. If you do not have one, read How to open the terminal first.
See where you are
Mac: type this and press Return:
pwdpwd prints the full path of the current folder, for example /Users/yourname.
Windows PowerShell: the prompt already shows the current folder, for example PS C:\Users\YourName>.
List what is in the folder
Mac:
lsWindows PowerShell:
dirYou see the names of the files and folders inside the current folder. In PowerShell, ls also works: Microsoft lists ls and dir as short names for the same command.
Make a new project folder
Make a test folder for your first assistant session. The name my-first-project is only an example. Use a name without spaces.
Mac:
mkdir my-first-projectWindows PowerShell:
New-Item -Name "my-first-project" -ItemType "Directory"The command makes the folder inside the current folder. Type ls or dir again to see it.
Go into the folder
cd means "change directory". It works on a Mac and in Windows PowerShell:
cd my-first-projectThe prompt now shows the new folder name. You are in the project folder, so you can start your assistant here.
Go back up
To go to the folder above the current one, type cd and two dots:
cd ..Go to a folder you can see in Finder
On a Mac, type cd and a space. Then drag the folder from Finder into the Terminal window. The full path of the folder appears on the line. Press Return.
If a folder name has spaces, put the whole path in quotes, for example cd "My Projects".
Start your assistant in the folder
When you are in the right folder, start the assistant you installed:
| Assistant | Command | Guide |
|---|---|---|
| Claude Code | claude | First session with Claude Code |
| Codex CLI | codex | First session with Codex |
| Gemini CLI | gemini | First session with Gemini CLI |
Sources
- pubs.opengroup.org/onlinepubs/9799919799/utilities/cd.html
- pubs.opengroup.org/onlinepubs/9799919799/utilities/ls.html
- pubs.opengroup.org/onlinepubs/9799919799/utilities/mkdir.html
- pubs.opengroup.org/onlinepubs/9799919799/utilities/pwd.html
- support.apple.com/guide/terminal/apdb66b5242-0d18-49fc-9c47-a2498b7c91d5/mac
- support.apple.com/guide/terminal/trml106/mac
- learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/set-location?view=powershell-5.1
- learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-childitem?view=powershell-5.1
- learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/new-item?view=powershell-5.1