Share Text and Data from Codex CLI Using the AgentPatch Paste Tool
Codex often produces things worth sharing: analysis results, formatted reports, configuration output, API response summaries. Getting that content out of the terminal and into a link someone else can open requires extra steps — copy to a file, upload somewhere, share the URL. The AgentPatch Paste tool collapses that into a single agent action.
Why This Matters
There’s no built-in way for a CLI agent to produce a public URL for content it generates. The usual options — piping to a service like pastebin, using a file host, or spinning up a local server — all require setup outside the agent. With AgentPatch connected, Codex can call the Paste tool directly and return a link in the same turn.
The tool accepts text/plain, text/html, and application/json. Pastes expire automatically — up to 7 days. You control the expiry per call. It costs 25 credits and requires no additional configuration beyond your existing AgentPatch connection.
Setup
Add AgentPatch to ~/.codex/config.toml:
[mcp_servers.agentpatch]
url = "https://agentpatch.ai/mcp"
bearer_token_env_var = "AGENTPATCH_API_KEY"
Then set your API key:
export AGENTPATCH_API_KEY=your_api_key
Replace your_api_key with your actual key from the AgentPatch dashboard. Codex discovers all AgentPatch tools automatically on next start.
Example
You’ve asked Codex to analyze a set of log files and produce a summary report. The output is a few hundred lines — more than you want to paste into a Slack message.
“Analyze the logs in ./logs/ from the last 24 hours and write a summary of the top 10 error types with counts and example messages.”
Codex reads the logs and produces the report as plain text. Then:
“Upload that summary as a paste and give me the URL.”
Codex calls the AgentPatch Paste tool with the report content, text/plain as the content type, and a 3-day expiry. The tool returns a URL:
https://agentpatch.ai/paste/a1b2c3d4e5f6
Codex reports back with the link. You drop it into Slack. Anyone with the URL can open it in a browser — no login, no download. It disappears automatically after 3 days.
You can also ask Codex to set a shorter window:
“Same thing, but make the paste expire in 1 day.”
Or structure the output for easier machine consumption:
“Format that summary as JSON and upload it as a paste.”
Codex shapes the data into a JSON object, calls the Paste tool with application/json, and returns a URL to the JSON paste. Useful when the consumer is another script or service rather than a person reading in a browser.
Wrapping Up
Paste is one of the simpler tools in the AgentPatch marketplace, but it fills a real gap — getting agent output into a shareable link without breaking out of your workflow. The same AgentPatch connection also gives Codex access to web search, email, image generation, and dozens of other tools. Visit agentpatch.ai to explore what else is available.