Release SDK packages to NuGet, PyPI, and npm. Bumps versions, updates READMEs if needed, builds, tests, and publishes. Use when the user says "release", "publish", "bump version", "push to registry", or "new version".
Publish one or more SDK packages to their registries (NuGet, PyPI, npm).
Parse $ARGUMENTS for:
$0): the semantic version to release (e.g. 0.2.0). Required.csharp, python, typescript.
If none specified, release all three.If no version is provided, stop immediately:
"Usage: /release <version> [csharp|python|typescript...]"
Before doing anything, verify the repo is in a clean state:
cd /home/najgeetsrev/ClariveSDK
Run . If there is ANY output (staged files exist), stop immediately and report: "There are staged files in the working tree. Commit or unstage them before releasing."
git diff --cached --name-onlyCheck for uncommitted changes. Run git status --porcelain. If there is output,
warn the user but don't stop — version bumps will create new changes anyway.
Check branch. Run git branch --show-current. Warn if not on main.
Check environment variables. For each SDK being released, verify the corresponding API key env var is set:
NUGET_API_KEYPIPY_API_KEY (note: this is the env var name, not a typo)NPM_API_KEYIf any required key is missing, stop and report which one.
Run the full test suite for the SDKs being released:
make test-csharp # if releasing C#
make test-python # if releasing Python
make test-typescript # if releasing TypeScript
If any tests fail, stop immediately. Do not proceed to version bumping.
Update the version string in all relevant files for each SDK being released.
The version argument from $0 is the new version (e.g. 0.2.0).
C#:
sdks/csharp/src/ClariveSDK/ClariveSDK.csproj — update <Version>X.Y.Z</Version>Python:
sdks/python/pyproject.toml — update version = "X.Y.Z"sdks/python/src/clarive/__init__.py — update __version__ = "X.Y.Z"TypeScript:
sdks/typescript/package.json — update "version": "X.Y.Z"Use the Edit tool for each file. Do NOT use sed — use precise string replacement.
For each SDK being released, read the README and check:
If any README needs changes, make them now.
Also check the root README.md — if it references specific versions, update those too.
Build each SDK being released:
C#:
cd /home/najgeetsrev/ClariveSDK/sdks/csharp
dotnet pack src/ClariveSDK/ClariveSDK.csproj -c Release
Python:
cd /home/najgeetsrev/ClariveSDK/sdks/python
rm -rf dist/
uv run python -m build
TypeScript:
cd /home/najgeetsrev/ClariveSDK/sdks/typescript
pnpm run build
If any build fails, stop and report the error.
Push each SDK to its registry:
C# → NuGet:
dotnet nuget push sdks/csharp/src/ClariveSDK/bin/Release/ClariveSDK.{version}.nupkg \
--api-key "$NUGET_API_KEY" \
--source https://api.nuget.org/v3/index.json
Python → PyPI:
cd sdks/python
uv run twine upload dist/* --username __token__ --password "$PIPY_API_KEY"
TypeScript → npm:
cd sdks/typescript
echo "//registry.npmjs.org/:_authToken=${NPM_API_KEY}" > .npmrc
npm publish --access public
rm -f .npmrc
If any publish fails, stop and report. Do NOT continue to the next SDK — the user needs to investigate before retrying.
After all selected SDKs are published:
Stage all changed files:
git add -A
Create a single commit:
chore: release v{version} ({list of SDKs released})
Published:
- ClariveSDK {version} → NuGet (if C# was released)
- clarive-sdk {version} → PyPI (if Python was released)
- clarive-sdk {version} → npm (if TypeScript was released)
Create a git tag:
git tag v{version}
Push commit and tag:
git push origin main
git push origin v{version}
Print a summary:
## Release Complete: v{version}
| SDK | Registry | Package | Status |
|-----|----------|---------|--------|
| C# | NuGet | ClariveSDK {version} | Published |
| Python | PyPI | clarive-sdk {version} | Published |
| TypeScript | npm | clarive-sdk {version} | Published |
Commit: {short hash}
Tag: v{version}
.npmrc files with tokens after publishing