To access Claude Code in your terminal, follow these steps to install and run the CLI (Command Line Interface):
1. Install Claude Code
Open your terminal and run the command matching your operating system: macOS, Linux, or WSL (Windows Subsystem for Linux):
bash
curl -fsSL https://claude.ai/install.sh | bash
Use code with caution.
Windows (PowerShell):
powershell
irm https://claude.ai/install.ps1 | iex
Use code with caution.
Windows (Command Prompt):
cmd
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
Use code with caution.
Alternative (Homebrew): If you use Homebrew, you can run brew install claude-code.
2. Authenticate
Once installed, type claude and hit Enter. The terminal will prompt you to log in.
You can use a Claude Pro/Team/Enterprise subscription (recommended) or a Claude Console (API) account with pre-paid credits.
3. Start a SessionNavigate to your project: Use cd path/to/your/project to enter the directory you want Claude to work in.
Launch Claude: Simply type claude to start an interactive session.
Quick Task: Run a one-off command without entering the full interactive mode by typing:
claude "your task here" (e.g., claude "fix the lint errors in auth.ts").
Essential Terminal Commands
Command Action
claude Start interactive mode.
claude -c Continue the most recent conversation in the current directory.
claude --dangerously-skip-permissions Run without being asked for permission for every file edit.
/help Show all available internal commands while inside a session.
exit or Ctrl+C Close the Claude Code session.
Pro Tip: If you use VS Code, you can also access the CLI by opening the integrated terminal (Ctrl + \``) and typing claude`.
0 Comments