Skip to content

feat: add getTags/get_tags to list all tags for a template#1132

Merged
mishushakov merged 5 commits intomainfrom
get-template-tags
Mar 3, 2026
Merged

feat: add getTags/get_tags to list all tags for a template#1132
mishushakov merged 5 commits intomainfrom
get-template-tags

Conversation

@beran-t
Copy link
Copy Markdown
Contributor

@beran-t beran-t commented Feb 14, 2026

Summary

  • Add GET /templates/{templateID}/tags endpoint to the OpenAPI spec
  • Add Template.getTags() to JS/TS SDK
  • Add Template.get_tags() (sync) and AsyncTemplate.get_tags() (async) to Python SDK
  • Returns a list of TemplateTag objects with tag, buildId, and createdAt fields

Test plan

  • Added unit tests for JS SDK (Template.getTags happy path + 404 error)
  • Added unit tests for Python SDK (sync + async, happy path + error)

Add support for listing all tags for a template, matching the existing
infra API endpoint. Includes OpenAPI spec update, regenerated clients,
SDK methods, types, and unit tests for both SDKs.
- Add explicit type for `item` parameter in getTemplateTags .map() to
  fix TS7006 error in CLI build
- Rewrite generated Python files to match CI's openapi-python-client
  output style (Union/Optional syntax, f-strings, no __future__ import)
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 14, 2026

🦋 Changeset detected

Latest commit: b17e297

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
e2b Patch
@e2b/python-sdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown
Member

@mishushakov mishushakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks very very good, some minor nits. also pls. update the docs

TemplateBuildStatus,
TemplateBuildStatusResponse,
TemplateClass,
TemplateTag,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to export this from index.ts as well

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In index.ts there is
94: export * from './template'

Which probably takes care of this? Everything works for me when testing it.

import pkg from './packages/js-sdk/dist/index.js'
const { Template, TemplateTag } = pkg

console.log('TemplateTag:', TemplateTag)

const tags = await Template.getTags('w8h2fkcozzr3bz100iyl')
console.log(`Found ${tags.length} tags:`)
for (const tag of tags) {
  console.log(`  Tag: ${tag.tag}, Build: ${tag.buildId}, Created: ${tag.createdAt}`)
}

Comment thread packages/python-sdk/e2b/template/types.py
Comment thread packages/python-sdk/e2b/template_async/build_api.py
# Conflicts:
#	packages/js-sdk/src/api/schema.gen.ts
#	packages/python-sdk/e2b/api/client/api/tags/get_templates_template_id_tags.py
#	packages/python-sdk/e2b/api/client/models/template_tag.py
#	spec/openapi.yml
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

Package Artifacts

Built from 355b87e. Download artifacts from this workflow run.

JS SDK (e2b@2.13.1-get-template-tags.0):

npm install ./e2b-2.13.1-get-template-tags.0.tgz

CLI (@e2b/cli@2.7.4-get-template-tags.0):

npm install ./e2b-cli-2.7.4-get-template-tags.0.tgz

Python SDK (e2b==2.14.0+get-template-tags):

pip install ./e2b-2.14.0+get.template.tags-py3-none-any.whl

@beran-t
Copy link
Copy Markdown
Contributor Author

beran-t commented Mar 3, 2026

@mishushakov mishushakov merged commit e83cf86 into main Mar 3, 2026
33 of 34 checks passed
@mishushakov mishushakov deleted the get-template-tags branch March 3, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants