A CLI tool to download the source files of a Lovable project to your local machine.
cargo install lovable-downloaderOr from source:
cargo install --path .lovable-downloader [OPTIONS] <URL>
Arguments:
<URL> Lovable project URL (e.g. https://lovable.dev/projects/<uuid>)
Options:
--force Write into the output directory even if it already exists
-h, --help Print help
-V, --version Print version
lovable-downloader https://lovable.dev/projects/550e8400-e29b-41d4-a716-446655440000Files are written to ./projects/<uuid>/ relative to the current directory.
The tool requires a Lovable bearer token.
Option 1 — Environment variable (recommended for scripts):
export BEARER_TOKEN="your-token-here"
lovable-downloader <url>Option 2 — .env file:
# .env
BEARER_TOKEN=your-token-hereOption 3 — Interactive prompt:
If BEARER_TOKEN is not set, the tool will prompt for it at startup.
- Open lovable.dev in your browser and log in.
- Open DevTools → Network tab.
- Open or reload a project.
- Find any API request to
api.lovable.devand copy theauthorizationheader value. - You can supply the full
Bearer <token>string or just the token — the tool normalizes it.
| Environment variable | Default | Description |
|---|---|---|
BEARER_TOKEN |
(required) | Lovable API bearer token |
LOVABLE_VALID_DOMAIN |
lovable.dev |
Override the expected project domain |
projects/
<project-uuid>/
src/
main.rs
...
README.md
...
Files that exceed the API size limit are skipped with a message. A summary count is printed at the end.
By default the tool refuses to write into an existing project directory. Use --force to allow it:
lovable-downloader --force https://lovable.dev/projects/<uuid>--force writes new and changed files but does not delete stale files from a previous download.
- No watch/sync mode.
- No parallel downloads.
- Files exceeding the API size limit are skipped; there is no workaround at this time.
- Token must be obtained manually from browser DevTools.