「AI/ClaudeCode/実行環境構築」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→環境について) |
(→起動初期やり取り) |
||
| (同じ利用者による、間の1版が非表示) | |||
| 行33: | 行33: | ||
claude --model my-model | claude --model my-model | ||
</pre> | </pre> | ||
| + | |||
| + | ==起動初期やり取り== | ||
| + | <pre> | ||
| + | Accessing workspace: | ||
| + | |||
| + | /d/www/unity/test | ||
| + | |||
| + | Quick safety check: Is this a project you created or one you trust? (Like your own code, a well-known open source project, | ||
| + | or work from your team). If not, take a moment to review what's in this folder first. | ||
| + | |||
| + | Claude Code'll be able to read, edit, and execute files here. | ||
| + | |||
| + | Security guide | ||
| + | |||
| + | ❯ 1. Yes, I trust this folder | ||
| + | 2. No, exit | ||
| + | </pre> | ||
| + | ClaudeCodeが、このフォルダにアクセスしてよいか聞いてくるので、Yesの1で、Enter | ||
==vscodeからclaudecode実行== | ==vscodeからclaudecode実行== | ||
2026年3月9日 (月) 16:08時点における最新版
環境について
5種類ぐらいある
- Anthropic公式API(標準)
- Ollama
- OpenAI互換API
- Docker環境
- CI / GitHub Actions
Anthropic公式API(標準)
一番普通の使い方です。
export ANTHROPIC_API_KEY=sk-xxxxx claude
Ollama
ローカルLLMを Anthropic互換APIとして使う方法。
export ANTHROPIC_BASE_URL=http://localhost:11434 export ANTHROPIC_AUTH_TOKEN=ollama claude --model gpt-oss:120b
OpenAI互換API
Claude Codeは OpenAI互換サーバーでも動きます。
LM Studioなど
export ANTHROPIC_BASE_URL=http://localhost:8000 export ANTHROPIC_AUTH_TOKEN=dummy claude --model my-model
起動初期やり取り
Accessing workspace: /d/www/unity/test Quick safety check: Is this a project you created or one you trust? (Like your own code, a well-known open source project, or work from your team). If not, take a moment to review what's in this folder first. Claude Code'll be able to read, edit, and execute files here. Security guide ❯ 1. Yes, I trust this folder 2. No, exit
ClaudeCodeが、このフォルダにアクセスしてよいか聞いてくるので、Yesの1で、Enter
vscodeからclaudecode実行
vscodeで、terminalを開いて、ollamaであれば、 以下をコードを実行する。
export ANTHROPIC_BASE_URL=http://localhost:11434 export ANTHROPIC_AUTH_TOKEN=ollama claude --model gpt-oss:120b
