Distribution Guide¶
This guide covers how to make claude-chat-extractor
available system-wide across different platforms.
1. PyPI Distribution (Recommended)¶
Prerequisites¶
- Python 3.12+
build
package:pip install build
twine
package:pip install twine
- PyPI account (create at https://pypi.org)
Build and Upload¶
-
Build the package:
python -m build
-
Upload to PyPI:
python -m twine upload dist/*
-
Install globally:
pip install claude-chat-extractor
Usage after installation:¶
# Full command
claude-chat-extractor extract -u <uuid> -i <input.json>
# Short aliases
claude-extract -u <uuid> -i <input.json>
cce -u <uuid> -i <input.json>
2. Homebrew (macOS)¶
Create Homebrew Formula¶
-
Create a formula file
claude-chat-extractor.rb
: ```ruby class ClaudeConversationExtractor < Formula desc "Extract Claude conversations to markdown" homepage "https://github.com/yourusername/claude-conversation-extractor" url "https://files.pythonhosted.org/packages/source/c/claude-chat-extractor/claude-chat-extractor-0.1.0.tar.gz" sha256 "YOUR_SHA256_HERE" license "MIT"depends_on "python@3.12"
def install system "python3", "-m", "pip", "install", *std_pip_args, "." end
test do system "#{bin}/cce", "--help" end end ```
-
Submit to Homebrew:
- Fork https://github.com/Homebrew/homebrew-core
- Add your formula
- Submit a pull request
Alternative: Personal Tap¶
# Create personal tap
brew tap yourusername/tap
# Add formula to your tap repository
3. Linux Package Managers¶
Debian/Ubuntu (.deb)¶
-
Install required tools:
sudo apt install python3-stdeb dh-python
-
Build package:
python3 setup.py --command-packages=stdeb.command bdist_deb
-
Install:
sudo dpkg -i deb_dist/python3-claude-chat-extractor_*.deb
RPM (Red Hat/CentOS/Fedora)¶
-
Install required tools:
sudo dnf install rpm-build python3-setuptools
-
Create spec file and build RPM package
Arch Linux (AUR)¶
Create a PKGBUILD file for the Arch User Repository.
4. Windows¶
Chocolatey¶
- Create nuspec file with package metadata
- Build and push to Chocolatey repository
Scoop¶
- Create manifest file in JSON format
- Submit to main bucket or create custom bucket
MSI Installer¶
Use tools like cx_Freeze
or PyInstaller
to create Windows executables.
5. Docker Distribution¶
Create Dockerfile¶
FROM python:3.12-slim
WORKDIR /app
COPY . .
RUN pip install .
ENTRYPOINT ["cce"]
Build and distribute¶
docker build -t claude-chat-extractor .
docker run claude-chat-extractor --help
6. Local Development Installation¶
Editable install¶
pip install -e .
From source¶
git clone https://github.com/yourusername/claude-conversation-extractor
cd claude-conversation-extractor
pip install .
7. CI/CD Pipeline¶
GitHub Actions Example¶
name: Build and Release
on:
push:
tags: ['v*']
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.12'
- run: |
pip install build twine
python -m build
python -m twine upload --username ${{ secrets.PYPI_USERNAME }} --password ${{ secrets.PYPI_PASSWORD }} dist/*
8. Testing Distribution¶
Test PyPI¶
# Upload to test PyPI first
python -m twine upload --repository testpypi dist/*
# Install from test PyPI
pip install --index-url https://test.pypi.org/simple/ claude-chat-extractor
Verify installation¶
# Check if commands are available
which cce
cce --help
9. Troubleshooting¶
Common Issues¶
- Command not found: Ensure
~/.local/bin
is in your PATH - Permission errors: Use
pip install --user
for user installation - Version conflicts: Use virtual environments for development
PATH Configuration¶
Add to your shell profile (.bashrc
, .zshrc
, etc.):
export PATH="$HOME/.local/bin:$PATH"
10. Maintenance¶
Version Management¶
- Use semantic versioning
- Update
pyproject.toml
version before releases - Tag releases in git
Dependency Updates¶
- Regularly update dependencies
- Test compatibility with new Python versions
- Monitor security vulnerabilities
User Support¶
- Maintain documentation
- Respond to issues and PRs
- Provide migration guides for breaking changes