2026.04.14
Call Claude from CLI without API Key using claude -p
Call AI from CLI without an API key using claude -p. Run as a subprocess from a Slack Bot for quick personal automation.
Using Claude Code’s claude -p, you can call AI directly from the CLI without an API key.
By running claude -p as a subprocess from a Slack Bot, you can use authenticated Claude as-is — making it incredibly useful for personal development automation.
Key Points
- No API Key required: As long as you’re logged into Claude Code, you can use the existing session
- Run as subprocess: Easy to call from Python, Node.js, or any other language
- Combine with Slack Bot: Quickly integrate Claude as a backend for your bot
When you want to add a quick AI feature to a personal project, being able to test it immediately without API applications or billing setup is a huge win.