Export Documents to GitHub
Create archive of documents folder and upload to GitHub for download
Check the documents/ folder to confirm there's content to export.
Give the user a quick summary: approximate size and what kinds of files
are there (images, markdown, data files, etc.).
If documents/ is empty or doesn't exist, let them know there's nothing
to export.
Ask the user what they want to name their export repository.
Suggest "sauna-exports" as the default.
Explain that:
- A tar.gz archive will be created and uploaded
- The repository will be PRIVATE in their GitHub account
- They'll get a direct download link for the archive
Create the archive using bash. Run this command:
tar --exclude=".env" --exclude="credentials" --exclude=".pem" --exclude=".key" -czf ./session/documents-export.tar.gz -C . documents
Then verify the archive was created and note its size:
ls -lh ./session/documents-export.tar.gz
Present the export results to the user:
- Show the ONE-CLICK DOWNLOAD LINK prominently - this is what they want!
(The browser_download_url from the release asset) - Note the archive size
- Mention the repo is private (only they can access it)
- Link to the release page where they can see all exports
- Explain they can extract with: tar -xzf filename.tar.gz
Make the download link the hero of the response.
You MUST use a todo list to complete these steps in order. Never move on to one step if you haven't completed the previous step. If you have multiple CONSECUTIVE read steps in a row, read them all at once (in parallel). Otherwise, do not read a file until you reach that step.
Add all steps to your todo list now and begin executing.
## Steps
1. Check the documents/ folder to confirm there's content to export.
Give the user a quick summary: approximate size and what kinds of files
are there (images, markdown, data files, etc.).
If documents/ is empty or doesn't exist, let them know there's nothing
to export.
2. Ask the user what they want to name their export repository.
Suggest "sauna-exports" as the default.
Explain that:
- A tar.gz archive will be created and uploaded
- The repository will be PRIVATE in their GitHub account
- They'll get a direct download link for the archive
3. Create the archive using bash. Run this command:
tar --exclude="*.env*" --exclude="*credentials*" --exclude="*.pem" --exclude="*.key" -czf ./session/documents-export.tar.gz -C . documents
Then verify the archive was created and note its size:
ls -lh ./session/documents-export.tar.gz
4. [Gather Arguments: Upload Archive to GitHub Releases] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `repoName` (default: "sauna-exports"): Repository name from user (default: sauna-exports)
- `archivePath`: ./session/documents-export.tar.gz
5. [Run Code: Upload Archive to GitHub Releases]: Call `run_script` with:
```json
{
"file": {
"path": https://sk.ills.app/code/workspace.github.export/preview,
"args": [
"repoName",
"archivePath"
]
},
"packages": null
}
```
6. Present the export results to the user:
1. Show the ONE-CLICK DOWNLOAD LINK prominently - this is what they want!
(The browser_download_url from the release asset)
2. Note the archive size
3. Mention the repo is private (only they can access it)
4. Link to the release page where they can see all exports
5. Explain they can extract with: tar -xzf filename.tar.gz
Make the download link the hero of the response.