# Claude CLI Runner

> Запуск Claude из Python БЕЗ API-ключа — claude CLI по подписке; модуль claude_cli.py. Триггеры: «клод из скрипта», «без API ключа».

- Skill: `jhamidun/claude-cli-runner` (Agent Skill)
- Install (CLI): `npx skillmds@latest add jhamidun/claude-cli-runner`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jhamidun/claude-cli-runner/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: JHamidun (https://skillmd.com/u/jhamidun)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/jhamidun/claude-cli-runner

---


# Claude CLI Runner

Use this skill when the user needs to run Claude models from Python code WITHOUT API keys — via the `claude` CLI binary that uses Claude Code's built-in authentication.

## When to Use

- User asks to "run Claude from Python" or "call Claude without API key"
- User needs to process text with Claude in a backend/script
- User wants to integrate Claude into a project that doesn't have API keys configured
- User mentions "claude CLI" or "claude binary"

## Module Location

`~/.claude/tools/claude_cli.py`

## Quick Usage

```python
import sys
sys.path.insert(0, "~/.claude/tools")
from claude_cli import claude, claude_async, claude_json, claude_stream, validate_response

# Simple call
result = claude("Fix spelling: Привет мр")

# With system prompt and model
result = claude(
    "Review this code for bugs",
    system="You are a senior developer",
    model="claude-opus-5",
)

# Async
result = await claude_async("Translate to English: ...")

# JSON output
data = claude_json("List 3 colors as JSON array")

# Streaming
for chunk in claude_stream("Write a story"):
    print(chunk, end="")

# Validate LLM response
ok, cleaned = validate_response(original_text, llm_response)
```

## Available Models

- `claude-opus-5` — most capable (алиас `opus`)
- `claude-fable-5-1` — канон text-субагентов/воркеров (алиас `fable`; `claude-fable-5` помечена Legacy)
- `claude-sonnet-5` — balanced (default)
- `claude-haiku-4-5` — fastest, cheapest

Канон актуальных ID/алиасов → `config/models.md`.

## Requirements

Claude CLI must be installed: `npm install -g @anthropic-ai/claude-code`

Or set `CLAUDE_CLI_PATH` env var to the binary path.

## On Server (your-server)

```bash
ssh your-server "which claude"  # verify installation
ssh your-server "claude -p --model claude-sonnet-5 'Hello'"  # test
```

