一键导入
codex-chatgpt-control-bridge
Drive visible ChatGPT web sessions from Codex agents for planning, research, and deep reasoning workflows
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Drive visible ChatGPT web sessions from Codex agents for planning, research, and deep reasoning workflows
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | codex-chatgpt-control-bridge |
| description | Drive visible ChatGPT web sessions from Codex agents for planning, research, and deep reasoning workflows |
| triggers | ["consult chatgpt for planning","ask chatgpt web for research","use chatgpt pro for deep reasoning","open a chatgpt thread","continue the chatgpt conversation","upload files to chatgpt","download chatgpt artifacts","get a second opinion from chatgpt"] |
| version | 1.0.0 |
Skill by ara.so — Codex Skills collection.
codex-chatgpt-control is an unofficial SDK that lets Codex agents control visible ChatGPT web sessions through a browser bridge. It enables structured workflows where Codex handles execution (local files, commands, tests) while delegating planning, research, brainstorming, or deep reasoning to the ChatGPT web product the user can see.
Key capabilities:
What this is NOT:
codex plugin marketplace add adamallcock/codex-chatgpt-control --ref main
codex plugin add codex-chatgpt-control@codex-chatgpt-control
Update to latest:
codex plugin marketplace upgrade codex-chatgpt-control
codex plugin add codex-chatgpt-control@codex-chatgpt-control
npm install codex-chatgpt-control
pip install codex-chatgpt-control
For browser control:
globalThis.agentFor file uploads:
chrome://extensions for the Codex bridge extensionFor development/testing:
import { createChatGPT } from "codex-chatgpt-control";
const chatgpt = createChatGPT({ agent: globalThis.agent });
// Define an agent with instructions
const reviewer = chatgpt.agent({
name: "reviewer",
instructions: "Review carefully and return detailed Markdown analysis."
});
// Run a new thread workflow
const result = await chatgpt.runner.run(reviewer, {
input: "Analyze this project's architecture and suggest improvements.",
thread: { type: "new" },
response: { format: "markdown" }
});
console.log(result.output_text);
console.log(result.status); // completed, stopped_by_user, or blocker reason
// User has already opened chatgpt.com/c/<id> in browser
const result = await chatgpt.askInThread({
thread: {
type: "url",
url: "https://chatgpt.com/c/abc123"
},
existingTab: true, // Don't replace the user's tab
prompt: "Continue with the next implementation step.",
wait: true,
read: { format: "markdown" }
});
console.log(result.text);
// Paths must be absolute on the backend host machine
const result = await chatgpt.askWithFiles({
thread: { type: "new" },
prompt: "Review these design documents and suggest improvements.",
files: [
"/home/user/project/docs/architecture.md",
"/home/user/project/docs/design.pdf"
],
wait: true,
read: { format: "markdown" }
});
Path requirements:
/home/you/file.pdf or /mnt/c/work/file.pdfC:\\Users\\you\\file.pdf or \\\\server\\share\\file.pdfC:Users\\file.pdf// Wait for ChatGPT to generate a file
await chatgpt.artifacts.wait({
kind: "file", // or "image" for image generations
requireDownload: true,
timeoutMs: 30000
});
// Download to local directory
const downloaded = await chatgpt.artifacts.downloadLatest({
destDir: "/absolute/path/to/output/dir"
});
console.log(downloaded.path);
console.log(downloaded.filename);
// Images are artifacts, not text messages
await chatgpt.ask({
thread: { type: "new" },
prompt: "Generate a system architecture diagram.",
wait: true
});
// Check if response is an image (messages.readLatest may return not_found)
await chatgpt.artifacts.wait({
kind: "image",
requireDownload: true
});
const image = await chatgpt.artifacts.downloadLatest({
destDir: "/path/to/images"
});
from codex_chatgpt_control import (
Agent, BackendClient, Runner, StdioBackendTransport
)
# Connect to Node backend
backend = BackendClient(StdioBackendTransport(
command=["npx", "--yes", "--package", "codex-chatgpt-control",
"codex-chatgpt-control-backend"]
))
runner = Runner(backend)
try:
# Run consultation workflow
result = runner.run_sync(
Agent(
name="planner",
instructions="Create detailed implementation plans."
),
{
"input": "Plan the next feature implementation.",
"thread": {"type": "new"},
"response": {"format": "markdown"},
},
)
print(f"Status: {result.status}")
print(f"Response: {result.output_text}")
finally:
backend.close()
result = runner.run_sync(
Agent(name="reviewer", instructions="Review uploaded files."),
{
"input": "Review these specifications.",
"thread": {"type": "new"},
"response": {"format": "markdown"},
"files": [
"/home/user/project/specs.md",
"/home/user/project/requirements.pdf"
]
}
)
const planner = chatgpt.agent({
name: "strategic-planner",
instructions: "Create detailed, actionable implementation plans with clear milestones."
});
const plan = await chatgpt.runner.run(planner, {
input: `Review our current codebase structure and plan the migration to microservices.
Context:
- Monolithic Express.js app, ~50k LOC
- PostgreSQL database
- Need to maintain backward compatibility
- 6-month timeline`,
thread: { type: "new" },
response: { format: "markdown" }
});
// Save plan locally
await fs.writeFile("migration-plan.md", plan.output_text);
const researcher = chatgpt.agent({
name: "research-synthesizer",
instructions: "Gather information, compare approaches, and synthesize findings into actionable recommendations."
});
const research = await chatgpt.runner.run(researcher, {
input: "Research current best practices for WebAssembly in Node.js applications. Compare available runtimes and toolchains.",
thread: { type: "new" },
response: { format: "markdown" }
});
// Upload multiple files for holistic review
const review = await chatgpt.askWithFiles({
thread: { type: "new" },
prompt: `Perform a comprehensive security and architecture review.
Focus on:
1. Authentication/authorization flows
2. Data validation and sanitization
3. API design consistency
4. Error handling patterns
5. Performance considerations`,
files: [
"/project/src/auth/middleware.js",
"/project/src/api/routes.js",
"/project/src/db/queries.js"
],
wait: true,
read: { format: "markdown" }
});
// Start thread
const initial = await chatgpt.ask({
thread: { type: "new" },
prompt: "Let's design a caching strategy for this API.",
wait: true,
read: { format: "markdown" }
});
const threadUrl = initial.thread_url;
// Continue thread with follow-up
const followup = await chatgpt.askInThread({
thread: { type: "url", url: threadUrl },
existingTab: false,
prompt: "Now consider Redis vs Memcached for this use case.",
wait: true,
read: { format: "markdown" }
});
// Another iteration
const final = await chatgpt.askInThread({
thread: { type: "url", url: threadUrl },
existingTab: false,
prompt: "Generate configuration examples for the recommended approach.",
wait: true,
read: { format: "markdown" }
});
The SDK returns structured stop reasons when workflows cannot proceed:
const result = await chatgpt.runner.run(agent, config);
switch (result.status) {
case "completed":
// Success - use result.output_text
console.log(result.output_text);
break;
case "stopped_by_user":
// User interrupted - respect the stop
console.log("User stopped the workflow");
break;
case "browser_bridge_unavailable":
// No bridge access - report to user, don't retry
console.log("Browser bridge not available. Check Codex bridge status.");
break;
case "login_required":
// ChatGPT session expired
console.log("ChatGPT login required. User needs to sign in.");
break;
case "captcha_or_verification":
// Human verification needed
console.log("ChatGPT requires verification. User must complete captcha.");
break;
default:
// Other blocker
console.log(`Workflow stopped: ${result.status}`);
}
Important: Do not retry blindly on blockers. These are user-actionable states.
Generate privacy-preserving local reports:
const report = chatgpt.createReport({
title: "Feature Planning Session",
description: "Consulted ChatGPT for microservices architecture plan",
includeContent: false, // Default: omit prompts and responses
metadata: {
task: "architecture-planning",
project: "api-migration"
}
});
// Add run entry
report.addRun({
agent: "strategic-planner",
status: "completed",
thread_url: "https://chatgpt.com/c/abc123",
input: "Plan migration...", // Only if includeContent: true
output_text: "..." // Only if includeContent: true
});
// Save report
await chatgpt.reports.save(report, "/path/to/reports/dir");
// List all available commands
const commands = chatgpt.commands();
console.log(commands);
// Get command-specific help
const help = chatgpt.describe("askWithFiles");
console.log(help);
// General help
chatgpt.help();
// Check if bridge is available before starting workflows
const session = chatgpt.session;
const status = await session.check();
if (status.bridge_available) {
// Proceed with browser workflows
} else {
console.log("Bridge unavailable. Switch to API-only workflows.");
}
// Markdown (default, recommended)
const md = await chatgpt.ask({
thread: { type: "new" },
prompt: "Explain async/await",
wait: true,
read: { format: "markdown" }
});
// Plain text (strips formatting)
const txt = await chatgpt.ask({
thread: { type: "new" },
prompt: "Explain async/await",
wait: true,
read: { format: "text" }
});
Cause: No globalThis.agent available or bridge not initialized.
Fix:
Cause: Missing file URL permissions or upload gate.
Fix:
chrome://extensionsCause: ChatGPT session expired or requires human verification.
Fix:
Cause: Artifact may not be ready or ChatGPT returned text instead.
Fix:
artifacts.wait() with appropriate timeoutmessages.readLatest()) or artifactCause: Excessive ChatGPT requests may hit rate limits.
Fix:
Good use cases:
Bad use cases:
docs/architecture.mddocs/browser-bridge.mddocs/safety.mdConvert attached object images into code-only, animation-ready procedural Three.js models through guided sculpting workflow
Create and manage AI video storyboard projects with automated asset generation through Codex Storyboard workspace
Continue-thinking middleware that detects and handles reasoning truncation in Codex/OpenAI Responses-compatible APIs
Desktop manager for OpenAI Codex CLI with prompt injection, provider switching, and TOML/Auth visualization
Inject unrestricted developer mode instructions into Codex CLI (GPT-5.5) to bypass content filters
Install and use TradingCodex to build Codex-native investment research workflows with fixed-role agents, order approval gates, and local Django service plane