AgentLens has automated publishing pipelines for both the Python SDK (PyPI) and the Node.js backend (npm).
- Create a PyPI account at https://pypi.org/account/register/ (if you don't have one)
- Configure Trusted Publisher on PyPI (no API tokens needed):
- Go to https://pypi.org/manage/account/publishing/
- Add a new pending publisher:
- PyPI project name:
agentlens - Owner:
sauravbhattacharya001 - Repository:
agentlens - Workflow name:
publish-pypi.yml - Environment name:
pypi
- PyPI project name:
- (Optional) TestPyPI: Repeat at https://test.pypi.org/manage/account/publishing/ with environment
testpypi - Create GitHub environments:
- Go to repo Settings → Environments
- Create
pypienvironment (optionally add required reviewers for safety) - Create
testpypienvironment
- Automatic: Creating a GitHub Release triggers PyPI publishing
- Manual (TestPyPI): Go to Actions → "Publish Python SDK to PyPI" → Run workflow → select
testpypi - Manual (PyPI): Go to Actions → "Publish Python SDK to PyPI" → Run workflow → select
pypi
Update the version in two places before releasing:
sdk/pyproject.toml→version = "X.Y.Z"sdk/agentlens/__init__.py→__version__ = "X.Y.Z"
- Create an npm account at https://www.npmjs.com/signup (if you don't have one)
- Generate an access token:
- Go to https://www.npmjs.com/settings/~/tokens
- Create a new Automation token (for CI/CD)
- Add the token to GitHub Secrets:
- Go to repo Settings → Secrets and variables → Actions
- Add a new secret:
NPM_TOKEN= your npm automation token
- Create GitHub environment:
- Go to repo Settings → Environments
- Create
npmenvironment (optionally add required reviewers)
- Automatic: Creating a GitHub Release triggers npm publishing
- Manual (dry-run): Go to Actions → "Publish Backend to npm" → Run workflow → select
dry-run - Manual (npm): Go to Actions → "Publish Backend to npm" → Run workflow → select
npm
Update the version in backend/package.json before releasing:
cd backend && npm version patch # or minor/major