This Tampermonkey script allows you to easily upload your Claude AI chats to a Gitlab repository directly from the chat page. With just a few clicks, you can save your conversations and store them in a structured manner on Gitlab.
- Automatically adds an "Upload To Gitlab" button to the Claude AI chat page
- Supports creating new chat files or updating existing ones in the Gitlab repository
- Allows specifying a custom path within the repository to organize chat files
- Retrieves the chat data from the Claude AI API and uploads it to Gitlab
- Opens the Gitlab URL of the uploaded chat file for easy access
- Persists Gitlab configuration (domain, token, project ID, branch, path) for convenience
- Make sure you have the Tampermonkey browser extension installed in your web browser.
- Open the raw script file from the GitHub repository.
- Copy the script source
- Open Tampermonkey in your browser and click the Add Script tab (icon with a plus symbol)
- Paste the source into the script window and hit save
- Voila!
To use this script, you need to configure a few settings:
- Go to your Gitlab user settings by clicking on your profile picture and selecting "Preferences".
- Navigate to the "Access Tokens" section.
- Click on the "Create personal access token" button.
- Give the token a name and select the "api" scope.
- Click on the "Create personal access token" button to generate the token.
- Copy the generated token and keep it secure.
- Open your Gitlab repository in a web browser.
- Go to the repository's "Settings" page.
- In the "General" section, you will find the "Project ID".
- Copy the project ID.
- Open a chat conversation on the Claude AI chat page.
- Click on the "Upload To Gitlab" button that appears near the chat controls.
- Fill in the required information in the modal:
- Gitlab Domain: Enter the domain of your Gitlab instance (e.g.,
gitlab.com
). - Gitlab Token: Paste your Gitlab personal access token.
- Gitlab Project ID: Enter the project ID of your Gitlab repository.
- Project Branch: Specify the branch where you want to upload the chat files (e.g.,
main
). - Path (optional): Provide a custom path within the repository to organize chat files (e.g.,
chats/
).
- Gitlab Domain: Enter the domain of your Gitlab instance (e.g.,
- Click on the "Upload" button to upload the chat to Gitlab.
- The script will check if the chat file already exists in the repository and either create a new file or update the existing one.
- Once the upload is successful, the Gitlab URL of the uploaded chat file will open in a new tab.
This script was written by Claude, an AI assistant created by Anthropic. Special thanks to the Claude AI team for providing an excellent conversational AI platform.
If you have any questions, suggestions, or issues, please feel free to open an issue on the GitHub repository.
Happy uploading!