Files written to a local project do not disappear when a conversation ends. Retention in a remote environment depends on that environment. Use AnyCap Drive when you need shared storage or delivery across environments; inspect the returned resource information and URLs.
Native tools and integrations can both support a complete workflow. Add AnyCap when its supported models, explicit CLI controls, or delivery operations match a concrete need.
Here's how to add cloud storage to Codex. Three approaches, with real command examples.
Codex / Drive
Codex is OpenAI's coding agent, available through terminal, IDE, desktop, and cloud workflows. Local and worktree tasks run on your computer; cloud tasks run remotely. See the environment documentation. Files written to a local project do not disappear when a conversation ends. Retention in a remote environment depends on that environment. Use AnyCap Drive when you need shared storage or delivery across environments; inspect the returned resource information and URLs.
A skill contains instructions and may reference scripts or resources. An MCP server exposes tools; one server may expose several capabilities. Install and authenticate a CLI separately when a skill needs it. Inspect the tools actually available in the current task.
What Codex + Cloud Storage Unlocks
When you add cloud storage to Codex, generated assets become persistent and shareable:
- Files written to a local project do not disappear when a conversation ends. Retention in a remote environment depends on that environment. Use AnyCap Drive when you need shared storage or delivery across environments; inspect the returned resource information and URLs.
- Shareable links for review. Codex generates an asset, uploads it, and returns a URL your team can open in a browser — no file transfer required.
- Assets embed in published pages. Codex generates a hero image, uploads it to cloud storage, embeds the URL in the landing page it's building — all in one session.
- Upload one existing file with
anycap drive upload <file>, then inspect the returned node identifier. Sharing is a separate operation: useanycap drive share <node-id>and inspect the returned link and expiration. The checked CLI does not providedrive downloador upload options named--nameand--format url. See Drive and Page documentation. - CI and automation pipelines. Automated Codex jobs generate report assets, upload them, and share links in a Slack notification or commit comment.
Method 1: Direct Cloud Provider Integration
Codex can install and call the AWS CLI, Google Cloud SDK, or Azure CLI in its sandbox:
# AWS S3 example
pip install awscli
aws s3 cp ./generated-hero.jpg s3://your-bucket/assets/generated-hero.jpg --acl public-read
echo "https://your-bucket.s3.amazonaws.com/assets/generated-hero.jpg"
Setup required:
- Cloud provider account and bucket/container configuration
- IAM credentials or service account with upload permissions
- CLI installed and authenticated in the Codex sandbox
- Public URL or signed URL generation logic
This works but requires provider-specific setup. Different providers have different CLIs, different authentication patterns, and different URL formats. When Codex switches projects that use different storage backends, the integration scripts diverge.
Method 2: MCP Server for File Storage
MCP servers can expose file storage as a structured tool:
- AWS S3 MCP — upload and retrieve from S3 buckets
- Google Drive MCP — manage files in Google Drive
- Cloudflare R2 MCP — S3-compatible storage via Cloudflare
Configure the MCP server once. Codex calls it like any tool. Cleaner than maintaining provider-specific shell scripts.
A skill contains instructions and may reference scripts or resources. An MCP server exposes tools; one server may expose several capabilities. Install and authenticate a CLI separately when a skill needs it. Inspect the tools actually available in the current task.
Method 3: One CLI Across Upload, Share, and Retrieve
This is the approach where Codex handles file storage through the same CLI it uses for image generation, video generation, and web search:
# Upload files and get shareable links
anycap drive upload hero.jpg
anycap drive upload product-demo.mp4
# Upload with a custom name
anycap drive upload ./output/hero.jpg
# Retrieve a file from a previous session
anycap drive ls
# List stored files
anycap drive ls
One auth. One CLI. Codex doesn't maintain separate credentials for storage versus image generation versus search — it's all one tool.
Install AnyCap for Codex:
npm i -g anycap
anycap login && anycap status
The Full Codex Generate → Upload → Embed Pipeline
The most powerful pattern: Codex generates an asset, uploads it immediately, and embeds the live URL in the page it's building — all in one session.
# Step 1: Generate the hero image
anycap image generate \
--prompt "developer dashboard, dark theme, neon blue accents, product photography style" \
--model seedream-5 \
-o hero.jpg
# Step 2: Upload to Drive and get the shareable URL
anycap drive upload hero.jpg
# Step 3: Codex embeds the URL in the landing page HTML
anycap drive share --help
Upload one existing file with anycap drive upload <file>, then inspect the returned node identifier. Sharing is a separate operation: use anycap drive share <node-id> and inspect the returned link and expiration. The checked CLI does not provide drive download or upload options named --name and --format url. See Drive and Page documentation.
Practical Patterns for Codex + Cloud Storage
Pattern 1: Generate and Share for Review
# Generate a set of variations, upload all, return links for team review
anycap image generate --prompt "hero v1 style" --model seedream-5 -o hero-v1.jpg
anycap image generate --prompt "hero v2 style" --model seedream-5 -o hero-v2.jpg
anycap drive upload hero-v1.jpg
anycap drive upload hero-v2.jpg
# Codex returns both URLs in a review summary message
Pattern 2: Video Production Pipeline
# Full generate → animate → store pipeline
anycap image generate \
--prompt "product hero shot, dark theme, neon accents" \
--model seedream-5 \
-o hero.jpg
anycap video generate \
--prompt "interface animates in sequence, gentle camera push-in" \
--model seedance-2 \
--mode image-to-video \
--param images=./hero.jpg \
-o hero-animated.mp4
# Upload both
anycap drive upload hero.jpg
anycap drive upload hero-animated.mp4
Pattern 3: Cross-Session Asset Retrieval
# Session 1: Generate and store
anycap image generate --prompt "brand hero image" --model seedream-5 -o brand-hero.jpg
anycap drive upload brand-hero.jpg
# Session 2: Retrieve and use
anycap drive ls
anycap drive share --help
Pattern 4: Automated Report with Uploaded Assets
# CI pipeline: generate chart, upload, include URL in Slack notification
anycap image generate --prompt "weekly metrics chart, bar graph style" --model nano-banana-pro -o weekly-chart.jpg
anycap drive upload weekly-chart.jpg
anycap drive share --help
Storage + Other Capabilities: The Full Stack
The most powerful Codex setup combines storage with the full AnyCap capability set:
| Capability | Command | Use in Codex |
|---|---|---|
| Image generation | anycap image generate |
Create visual assets |
| Video generation | anycap video generate |
Animate stills, create demos |
| Web search | anycap search |
Research before coding |
| URL crawl | anycap crawl |
Read live docs and pages |
| Cloud storage | anycap drive upload |
Persist and share all of the above |
| Web publish | anycap page publish |
Host generated content at a live URL |
One install covers all of these. The same credentials that authenticate image generation authenticate file storage. Codex doesn't maintain separate API keys for each capability.
Cross-Agent: Same Commands, Different Agents
Cloud storage commands work identically across Codex, Claude Code, and Cursor. Only the skill installation target changes:
| Agent | Install target | Unique advantage for storage |
|---|---|---|
| Codex | ~/.codex/skills/ |
CLI-native — storage commands chain with && like any shell command |
| Claude Code | ~/.claude/skills/ |
Parallel uploads — Claude Code can upload batches via subagents simultaneously |
| Cursor | ~/.cursor/skills/ |
In-IDE — generated assets upload and embed directly from within the editor |
FAQ
Does Codex have native file persistence?
Files written to a local project do not disappear when a conversation ends. Retention in a remote environment depends on that environment. Use AnyCap Drive when you need shared storage or delivery across environments; inspect the returned resource information and URLs.
How long are uploaded files stored?
Upload one existing file with anycap drive upload <file>, then inspect the returned node identifier. Sharing is a separate operation: use anycap drive share <node-id> and inspect the returned link and expiration. The checked CLI does not provide drive download or upload options named --name and --format url. See Drive and Page documentation.
Can I retrieve files from a previous Codex session?
Upload one existing file with anycap drive upload <file>, then inspect the returned node identifier. Sharing is a separate operation: use anycap drive share <node-id> and inspect the returned link and expiration. The checked CLI does not provide drive download or upload options named --name and --format url. See Drive and Page documentation.
Are uploaded files public?
Upload one existing file with anycap drive upload <file>, then inspect the returned node identifier. Sharing is a separate operation: use anycap drive share <node-id> and inspect the returned link and expiration. The checked CLI does not provide drive download or upload options named --name and --format url. See Drive and Page documentation.
Can I use cloud storage in automated Codex pipelines?
A skill contains instructions and may reference scripts or resources. An MCP server exposes tools; one server may expose several capabilities. Install and authenticate a CLI separately when a skill needs it. Inspect the tools actually available in the current task.
Can Codex embed the uploaded file URL directly into code?
Upload one existing file with anycap drive upload <file>, then inspect the returned node identifier. Sharing is a separate operation: use anycap drive share <node-id> and inspect the returned link and expiration. The checked CLI does not provide drive download or upload options named --name and --format url. See Drive and Page documentation.
→ Give Codex cloud storage — one install, all capabilities
📖 What to Read Next
- How to Generate Images with Codex (2026) — Generate the assets you'll store.
- How to Generate Video with Codex (2026) — Video generation companion guide.
- How to Give Codex Web Search (2026) — Add research capability alongside storage.
- AI Image-to-Video: The Complete Pipeline — The full generate → animate → store workflow in detail.
Related Articles
- What Is a Capability Runtime? — The infrastructure that bundles image, video, search, and storage into one CLI.
- Terminal Agent Showdown: Claude Code vs Codex vs Windsurf — How Codex compares to other terminal agents on capability breadth.
- How to Give Claude Code Cloud Storage — The Claude Code variant of this guide.
Native tools and integrations can both support a complete workflow. Add AnyCap when its supported models, explicit CLI controls, or delivery operations match a concrete need.