Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: Export the code Agent Lee generates
description: Agent Lee can now package the code it generates into a temporary, cloneable repository so you can pull it onto your own machine.
date: 2026-08-12
---

When Agent Lee generates a project for you — a starter static site, a Worker, a scaffold — you can now take the source with you. Agent Lee packages the generated files into a temporary repository and gives you a one-time command to clone it to your own machine.

Previously, generated code lived only in the conversation. You had to copy files out of the chat by hand, which is tedious for anything larger than a single snippet and easy to get wrong.

### How it works

- Ask Agent Lee to build something, then ask it to export the code.
- An export card appears listing the files and a countdown to expiry.
- Select **Copy clone command**. Agent Lee fetches a fresh command and copies it to your clipboard.
- Run it in your terminal, then point the repository at your own Git host and push:

```sh
git remote set-url origin https://your-git-host.example/you/your-repo.git
git push -u origin main
```

### Good to know

- **The export is temporary.** The repository expires about 36 hours after it is created and is then deleted automatically. The clone credential expires about an hour after it is issued. Clone promptly, then push to a repository you control.
- **No credential appears in the chat.** The clone command and its read-only credential are delivered only when you select **Copy clone command** — never in the message text or conversation history.
- **Nothing is written to your account.** The temporary repository lives in Cloudflare-managed storage, and connecting a GitHub or GitLab account is not required.
- **Intended for small projects.** An export can include up to 50 files, up to 100 KB per file and 2 MB in total.

Agent Lee remains in beta. Features and behaviors may change as the product evolves.

For details, see [Export generated code](/agent-lee/take-home-code/).
3 changes: 2 additions & 1 deletion src/content/docs/agent-lee/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Agent Lee does not currently use your conversations, prompts, or account data to

Agent Lee cannot:

- Write Workers scripts or generate application code
- Deploy applications on your behalf or run code for you (it can generate small starter projects and [export the source](/agent-lee/take-home-code/) for you to clone)
- Replace [Cloudflare Support](https://support.cloudflare.com) for billing issues, account recovery, or outages
- Access payment methods, billing history, or API tokens
- Operate across multiple accounts: sessions are scoped to your authenticated account
Expand All @@ -129,6 +129,7 @@ Agent Lee is built on Cloudflare's own developer platform using the same primiti

## Related resources

- [Export generated code](/agent-lee/take-home-code/)
- [Agents SDK](/agents/)
- [Human in the Loop](/agents/concepts/agentic-patterns/human-in-the-loop/)
- [Workers AI](/workers-ai/)
Expand Down
85 changes: 85 additions & 0 deletions src/content/docs/agent-lee/take-home-code.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
title: Export generated code
description: Take the source code Agent Lee generates with you by exporting it to a temporary, Git-cloneable repository.
pcx_content_type: how-to
tags:
- AI
sidebar:
order: 2
head:
- tag: title
content: Export generated code
products:
- agent-lee
---

import { Description, Steps } from "~/components";

<Description>

Take the source code Agent Lee generates with you by exporting it to a temporary, Git-cloneable repository.

</Description>

:::note[Beta]
Code export is part of the Agent Lee beta. Behaviors and limits described here may change.
:::

When Agent Lee generates a small project for you — for example, a starter static site or a Worker — you can export the source so you can keep working on it locally. Agent Lee packages the generated files into a temporary repository and gives you a one-time command to clone it to your machine.

This is a **take-home** flow: the repository is short-lived and lives in Cloudflare-managed storage, not in your account. It is meant for getting generated code onto your own machine, after which you push it to a Git host of your choice. You do not need to connect a GitHub or GitLab account.

## How it works

- **Temporary repository.** When you export, Agent Lee writes the generated files to a repository that expires about 36 hours after it is created. Once it expires, the export card disables the copy button and the code can no longer be cloned.
- **On-demand clone command.** Agent Lee does not put a clone command or credential in the chat transcript. Instead, the export card shows a **Copy clone command** button that fetches a fresh command when you select it. The command embeds a read credential that is valid for about one hour.
- **Export card.** The card shows the project name, the list of exported files, and a countdown to expiry so you know how long you have to clone.

## Export and clone your code

<Steps>

1. Ask Agent Lee to build something that produces code, then ask it to export the code. For example: "Export this project so I can clone it."

2. In the export card that appears, review the file list and the expiry countdown.

3. Select **Copy clone command**. Agent Lee fetches a fresh command and copies it to your clipboard.

4. Paste the command into your terminal and run it. What you copied is already a complete `git clone` invocation, so do not add anything to it. It has the following shape, where the credential is embedded in the remote URL and the final argument is the local directory to create:

```sh
git clone https://<credential>@<host>/<repository>.git <project-name>
```

5. Change into the new directory, point the repository at your own Git host, and push it there to keep it:

```sh
cd <project-name>
git remote set-url origin https://your-git-host.example/you/your-repo.git
git push -u origin main
```

</Steps>

## Security and privacy

- **No credential in chat.** The clone command and its read credential are delivered only when you select **Copy clone command** — never in the message text, conversation history, or model context. Agent Lee will not type the clone command into the chat, so do not ask it to.
- **Short-lived access.** The read credential expires about an hour after it is issued. If the command stops working before the repository expires, return to the export card and copy a fresh one.
- **Nothing is written to your account.** The temporary repository lives in Cloudflare-managed storage. Agent Lee does not create repositories, tokens, or other resources in your Cloudflare account to perform an export.
- **Automatic cleanup.** The temporary repository is deleted automatically once it expires. Clone and push to your own host before then.

## Limitations

- Exported repositories are temporary and are not backed up. Once a repository expires, it cannot be recovered.
- The clone credential is read-only and single-purpose. You cannot push back to the temporary repository — push to your own Git host instead.
- Code export is intended for small, self-contained projects that Agent Lee generates during a conversation. A single export can include:
- up to 50 files
- up to 100 KB per file
- up to 2 MB in total

Agent Lee tells you if a project is too large to export. If that happens, ask it for a smaller subset of the project.

## Related resources

- [Agent Lee overview](/agent-lee/)
- [Workers](/workers/)
Loading