npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kitops/kitops-ts

v0.0.3

Published

TypeScript library for KitOps CLI

Downloads

310

Readme

kitops-ts

npm version CI License

TypeScript/Node.js SDK for the KitOps CLI. Provides a type-safe functional API for packing, pushing, pulling, and inspecting ModelKits — without having to shell out manually.

Similar to pykitops but for TypeScript/JavaScript.

Requirements

  • Node.js >= 23
  • KitOps CLI installed and available in PATH (or set KITOPS_CLI_PATH to the full path of the binary)

Installation

npm install @kitops/kitops-ts
# or
pnpm add @kitops/kitops-ts

Quick start

import { login, pack, push } from '@kitops/kitops-ts';

await login('registry.example.com', process.env.REGISTRY_USER!, process.env.REGISTRY_PASS!);
await pack('.', { tag: 'registry.example.com/org/my-model:v1.0.0' });
await push('registry.example.com/org/my-model:v1.0.0');

API

init(path?, flags?)

Scans a directory for ML artifacts and generates a Kitfile. Automatically detects models, datasets, code, and docs by file extension.

const result = await init('./my-model', {
  name: 'my-model',
  desc: 'Sentiment analysis model',
  author: 'ML Team',
  force: true, // overwrite existing Kitfile
});

console.log(result.kitfilePath); // absolute path to the generated Kitfile

info(repository, tag, flags?)

Returns the parsed Kitfile for a ModelKit. The result also carries a non-enumerable _raw property with the original YAML string.

const kitfile = await info('registry.example.com/org/my-model', 'v1.0.0');
console.log(kitfile.package?.name);
console.log(kitfile.model?.path);

inspect(repository, tag, flags?)

Returns the full OCI manifest and parsed Kitfile. Use flags.remote to inspect directly from a registry without pulling first.

const result = await inspect('registry.example.com/org/my-model', 'v1.0.0', { remote: true });
console.log(result.digest);
console.log(result.manifest.layers);

pack(directory?, flags?)

Packages a directory containing a Kitfile into a ModelKit.

await pack('.', {
  tag: 'registry.example.com/org/my-model:v1.0.0',
  compression: 'zstd',
});

unpack(destination, flags?)

Extracts a ModelKit into a directory. Use flags.filter to pull out specific layers or paths.

// Extract everything
await unpack('./output');

// Model layer only
await unpack('./output', { filter: 'model' });

// A specific dataset and the full docs layer
await unpack('./output', { filter: 'datasets:validation,docs' });

// Don't fail if files already exist
await unpack('./output', { ignoreExisting: true });

list(repository?)

Lists ModelKits. Omit the argument to list local storage; pass a registry/repository to list remote tags.

const local = await list();
const remote = await list('registry.example.com/org/my-model');

for (const kit of local) {
  console.log(kit.repository, kit.tag, kit.size, kit.digest);
}

push(source, destination?)

Pushes a ModelKit to a registry. Supply destination to push under a different reference (e.g. promote from staging to production).

await push('registry.example.com/org/my-model:v1.0.0');

// Push to a different registry under a different tag
await push('staging.example.com/my-model:rc1', 'registry.example.com/org/my-model:v1.0.0');

pull(reference)

Pulls a ModelKit from a registry into local storage.

await pull('registry.example.com/org/my-model:v1.0.0');

loginUnsafe(registry, username, password)

Authenticates with a registry. The password is passed as a CLI argument and will be visible in the process list — use login instead for production.

await loginUnsafe('registry.example.com', 'user', 'pass');

login(registry, username, password)

Same as login but passes the password via stdin, keeping it out of the process list. Preferred for CI and automated workflows.

await login(
  'registry.example.com',
  process.env.REGISTRY_USER!,
  process.env.REGISTRY_PASS!,
);

logout(registry)

await logout('registry.example.com');

tag(source, destination)

Assigns a new tag to an existing local ModelKit without re-packing. Use push afterward to publish it.

await tag('registry.example.com/org/my-model:rc1', 'registry.example.com/org/my-model:v1.0.0');

remove(registry, repository, tagOrDigest, flags?)

Removes a ModelKit from local storage or a remote registry.

// Remove a specific tag
await remove('registry.example.com', 'org/my-model', 'v0.9.0');

// Remove all locally cached ModelKits
await remove('', '', '', { all: true });

// Force-remove from the remote registry
await remove('registry.example.com', 'org/my-model', 'v0.9.0', { force: true, remote: true });

version()

Returns version information for the installed kit binary.

const { version, commit, built, goVersion } = await version();
console.log(`kit ${version} (${commit})`);

kit(command, args, options?)

Low-level escape hatch for running any kit subcommand directly, useful when the higher-level wrappers don't expose a flag you need.

const result = await kit('pack', ['.', '--tag', 'my-model:latest'], { cwd: '/path/to/project' });
console.log(result.stdout);

Error handling

All functions reject with a string message that includes the exit code and stderr output from the CLI. Wrap calls in try/catch to handle failures:

try {
  await push('registry.example.com/org/my-model:v1.0.0');
} catch (err) {
  console.error(err); // "Kit command failed with exit code 1: ..."
  process.exit(1);
}

Environment variables

| Variable | Description | |---|---| | KITOPS_CLI_PATH | Full path to the kit binary. Defaults to kit (resolved via PATH). |

Examples

See the examples/ directory for runnable scripts covering common workflows:

Development

pnpm install
pnpm build       # compile TypeScript
pnpm dev         # watch mode
pnpm test        # run tests
pnpm typecheck   # type-check without emitting

Related