A minimal CLI for TensorHub endpoint workflows:
- Login
- Build (publish a release from source)
- Deploy (promote a release tag, usually
prod)
git clone https://github.com/cozy-creator/cozyctl.git
cd cozyctl
go build -o cozyctl .
./cozyctl --helpAuthenticate and save a profile.
# Token login
cozyctl login --api-key <TOKEN> --owner <org-slug>
# Username/password login
cozyctl login --email <email-or-username> --password <password> --owner <org-slug>
# Custom API URL
cozyctl login --hub-url http://localhost:3867 --api-key <TOKEN> --owner <org-slug>Notes:
--ownersets the default owner/org used by build/deploy.--tenant-idis kept as a deprecated alias for--owner.
Publish endpoint source to TensorHub and queue a release build.
# Publish and wait for build completion
cozyctl build --dir ./my-endpoint --endpoint image-gen --wait
# Use a specific owner/org for this command
cozyctl build --dir ./my-endpoint --owner my-org --endpoint image-gen
# Stream SSE build events while waiting (default true)
cozyctl build --dir ./my-endpoint --endpoint image-gen --stream --sse-debug
# Local Docker build only (no TensorHub publish)
cozyctl build --local --dir ./my-endpointBehavior:
- Uploads source tarball to
POST /api/v1/endpoints/:owner/:endpoint/releases - Reads status from
GET /api/v1/endpoints/:owner/:endpoint/releases/:release_id
Promote a release to a tag (default prod).
# Promote release to prod
cozyctl deploy image-gen a1b2c3d4e5f6a1b2c3d4e5f6
# Promote to a custom tag
cozyctl deploy image-gen a1b2c3d4e5f6a1b2c3d4e5f6 --tag staging
# Skip waiting for release readiness check
cozyctl deploy image-gen a1b2c3d4e5f6a1b2c3d4e5f6 --wait=false
# Stream SSE events while waiting (default true)
cozyctl deploy image-gen a1b2c3d4e5f6a1b2c3d4e5f6 --stream --sse-debugBehavior:
- Promotes via
PUT /api/v1/endpoints/:owner/:endpoint/tags/:tagwith{ "release_id": "..." }
Profiles are stored in ~/.cozy/ and include:
hub_urltokenowner
You can select profile/name per command:
cozyctl build --name work --profile prod --dir . --endpoint image-genFor TensorHub publish/build, your project should include the endpoint source contract expected by TensorHub (for example endpoint.toml, pyproject.toml, uv.lock, and Dockerfile).