Skip to content

cozy-creator/cozyctl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cozyctl

A minimal CLI for TensorHub endpoint workflows:

  1. Login
  2. Build (publish a release from source)
  3. Deploy (promote a release tag, usually prod)

Installation

git clone https://github.com/cozy-creator/cozyctl.git
cd cozyctl
go build -o cozyctl .
./cozyctl --help

Commands

login

Authenticate 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:

  • --owner sets the default owner/org used by build/deploy.
  • --tenant-id is kept as a deprecated alias for --owner.

build

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-endpoint

Behavior:

  • Uploads source tarball to POST /api/v1/endpoints/:owner/:endpoint/releases
  • Reads status from GET /api/v1/endpoints/:owner/:endpoint/releases/:release_id

deploy

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-debug

Behavior:

  • Promotes via PUT /api/v1/endpoints/:owner/:endpoint/tags/:tag with { "release_id": "..." }

Profiles

Profiles are stored in ~/.cozy/ and include:

  • hub_url
  • token
  • owner

You can select profile/name per command:

cozyctl build --name work --profile prod --dir . --endpoint image-gen

Project Requirements

For TensorHub publish/build, your project should include the endpoint source contract expected by TensorHub (for example endpoint.toml, pyproject.toml, uv.lock, and Dockerfile).

About

Developer CLI tool for creating deployments, and managing model-weights stored locally by interacting with Cozy-Hub's API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors