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
55 changes: 29 additions & 26 deletions shipkit/core/skills/update-shipkit/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,54 +26,57 @@ shipkit --version
Determine how shipkit was installed so we use the right upgrade command:

```bash
# Check if installed via uv tool
uv tool list 2>/dev/null | grep shipkit
# Find the package location
python3 -c "import shipkit; from pathlib import Path; p = Path(shipkit.__file__).parent.parent; print(p); print('git' if (p / '.git').exists() else 'pip')"
```

# Check if installed in a uv-managed environment
pip show shipkit 2>/dev/null | grep Location
```bash
# Also check if installed via uv tool
uv tool list 2>/dev/null | grep shipkit
```

- If the package root has `.git/`: it's a **local git clone** (most common for development)
- If `uv tool list` shows shipkit: it's a **uv tool install**
- If location is inside a `.venv`: it's a **uv/pip project install**
- Otherwise: it's a **regular pip install**
- Otherwise: it's a **pip install** (from PyPI or local)

### Step 3: Check Available Version on PyPI
### Step 3: Check for Updates

**Git clone install:**
```bash
# Prefer uv if available
uv pip index versions shipkit 2>/dev/null || pip index versions shipkit
cd <package-root>
git fetch origin
git log HEAD..origin/main --oneline
```
If no new commits, tell user and stop.
Show what changed (new commits, CHANGELOG entries).

**PyPI install:**
```bash
uv pip index versions shipkit 2>/dev/null || pip index versions shipkit
```
Compare current vs available. If already on latest, tell user and stop.

### Step 4: Confirm Upgrade

Show user:
```
Current: shipkit 0.1.2
Available: shipkit 0.1.5

New in 0.1.5:
- [Fetch from CHANGELOG if possible, or just show version bump]

Would you like to upgrade?
```
Show user what's new and ask to proceed.

### Step 5: Upgrade

Use the method matching the installation:

**uv tool install (recommended):**
**Git clone install:**
```bash
uv tool upgrade shipkit
cd <package-root>
git pull --rebase origin main
pip install --force-reinstall .
```
`--force-reinstall` is required because pip doesn't detect changes in a local clone
unless the version number bumped. Without it, pip sees "same version" and skips.

**uv pip (project venv):**
**uv tool install:**
```bash
uv pip install --upgrade shipkit
uv tool upgrade shipkit
```

**pip fallback:**
**pip from PyPI:**
```bash
pip install --upgrade shipkit
```
Expand Down
4 changes: 3 additions & 1 deletion shipkit/core/skills/update/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ Pull the latest code.
- Ask user how to resolve each
- Recommend taking upstream for package code
- Offer `git rebase --abort` as escape hatch
- After successful pull, run `uv sync` to update dependencies
- After successful pull, run `pip install --force-reinstall .` to install the updated code
(`--force-reinstall` is required because pip doesn't detect changes in a local clone unless the version bumped)
- Then run `uv sync` if the project uses uv to update dependencies

### 4. Verify

Expand Down
Loading