Article
AICLIdeveloper-toolsAnthropicaiclianthropiccode-generation
Claude Code
Install and use Anthropic's `claude-code` CLI to automate software engineering tasks. Leverage Claude's intelligence for autonomous coding, debugging, and multi-step task execution directly from your terminal, boosting developer productivity.
beginner5 min4 steps
The play
- Install Claude Code CLIInstall the `claude-code` Python package globally using pip.
- Set Your Anthropic API KeyObtain your Anthropic API key and export it as an environment variable. Replace `your_anthropic_api_key_here` with your actual key.
- Generate a Simple FunctionAsk Claude to write a basic function for you directly from the command line.
- Perform a Multi-step TaskRequest Claude to perform a task involving multiple steps, such as creating a file and writing content into it.
Starter code
export ANTHROPIC_API_KEY="your_anthropic_api_key_here" && claude-code "Write a Python function to calculate the Nth Fibonacci number."