このプロジェクトについて
Poe Codeは、お気に入りのコーディングエージェント(Claude Code、Codex、OpenCode、Gooseなど)をPoe API経由でルーティングするツールで、複数のプロバイダーやアカウントを管理する代わりに、Poeのサブスクリプションを1つだけ持つだけで済みます。一度設定すれば、エージェントの通常のCLIやデスクトップアプリで動作し、スクリプトやCI/CD用の一回限りのプロンプト生成にも対応しています。
## クイックスタート
エージェントのデフォルトプロバイダーとしてPoe Codeを設定します(設定ファイルを更新):
```bash
npx poe-code@latest configure
npx poe-code@latest configure codex # または claude, opencode, goose
```
`unconfigure`で上書きを削除します:
```bash
npx poe-code@latest unconfigure claude
```
## 認証
Poe APIキーを使用します。初回実行時には、ブラウザでのログイン(OAuth)が求められます。キーを直接指定することもできます:
```bash
npx poe-code@latest login
npx poe-code@latest login --api-key <your-key>
export POE_API_KEY=<your-key>
```
認証情報は`~/.poe-code/`に保存されます。`poe-code auth status`で状態を確認し、`logout`で削除します。
## ユーティリティ
- **一回限りのプロンプトを生成**:`npx poe-code@latest spawn codex "Say hello" --mode read`(モード:yolo、auto、edit、read。TTYなしのCIでは必須)。
- **GitHubリポジトリに対して生成**:`--cwd github://owner/repo`または`github://owner/repo#main:packages/auth`のようなref/subdirを指定。
- **stdinからプロンプトをパイプ**:`echo "Say hello" | npx poe-code@latest spawn codex --mode read`。
- **GitHub PRをレビュー**:`code-review install`、`code-review run <url>`、`code-review commit <url> --dry-run`。
- **設定済みサービスのテスト**:`npx poe-code@latest test codex`。
- **エージェントCLIのインストール**:`install claude-code`、`install codex`、`install opencode`、`install goose`。
- **オプションフラグ**:`--dry-run`(ディスクに触れずに変更を表示)、`--yes`(デフォルトを受け入れる)。
## 使用量と課金
コンピュートポイントの残高と使用履歴を確認します:
```bash
poe-code usage
poe-code usage list
poe-code usage list --limit 100
poe-code usage list --filter claude
```
## モデル
利用可能なPoe APIモデルを一覧表示し、エンドポイント、プロバイダー、検索でフィルタリングします:
```bash
poe-code models
poe-code models --endpoint /v1/responses
poe-code models --endpoint /v1/chat/completions
poe-code models --search claude
```
## SDK
Poe Codeを自分のコードでプログラム的に使用します:
```typescript
import { spawn, getPoeApiKey, getPoeAuthIdentity } from "poe-code";
const apiKey = await getPoeApiKey();
const identity = await getPoeAuthIdentity();
const result = await spawn("claude-code", {
prompt: "Fix the bug in auth.ts",
cwd: "/path/to/project",
model: "claude-sonnet-4-6"
});
console.log(result.stdout);
```
- `spawn(service, options)` – 単一のプロンプトを実行します。オプションには`prompt`、`cwd`(ローカルパスまたは`github://`ロケーター)、`model`、`mode`、`args`が含まれます。`{ stdout, stderr, exitCode }`を返します。
- `spawn.pretty(service, options)` – 同じですが、色付きのACPイベントストリームをレンダリングします。
- `getPoeApiKey()` – `POE_API_KEY`環境変数または認証情報ファイルを読み取ります。
- `getPoeAuthIdentity()` – PoeアカウントのIDを取得します。
プラグイン優先の構成には、`poe-code/agent`サブパスを`agent()`、`openaiResponsesPlugin()`、`systemPromptPlugin()`とともに使用します。
## 研究プレビュー
破壊的な変更の可能性がある機能:
- **SafeJS** – 明示的なホスト機能、実行予算、再開可能なチェックポイントを備えたJavaScriptインタープリター。`@poe-platform/safe-js`として公開。完全な適合性は確立されていません。
- **Pipeline** – 設定可能なステップ、ライブ進行状況、キューに入れられたフォローアップでタスクプランを実行します。
- **Ralph** – マークダウンドキュメントを反復処理するエージェンティックビルドループ。
- **Experiment loop** – Karpathyスタイルの最適化ループ(エージェントがコードを変更し、評価スコアを付け、gitで保持/破棄)。
- **Poe Agent** – 構成可能なエージェントランタイム。
## 更新
```sh
npx poe-code@latest update
npx poe-code@latest update --package-manager pnpm
```
バージョンチェック、ドライラン、管理されたワークツリーについては、完全なリファレンスを参照してください。
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.