Skip to content

Libraries

A library is a collection of commands that you can install and use. Libraries can come from two places:

  • Git sources — any git repository containing a mycli.yaml manifest, added with my source add
  • Registry — public libraries installed by name with my library install

Both types make commands available as my <library> <slug> (e.g., my ops deploy).

After installing a library (from either a source or the registry), its commands are available as top-level subcommands:

Terminal window
my ops deploy api -e production
my kubernetes logs my-pod -f

Libraries can have aliases, so you can use a shorter name. For example, my k as an alias for my kubernetes.

Use my <library> --help to see all commands available in a library.

A source is a git repository that contains one or more libraries of commands. No account is needed.

Terminal window
my source add https://github.com/user/example-library.git
Terminal window
my source add https://github.com/user/example-library.git --ref v1.0
Terminal window
my source add https://github.com/user/example-library.git --name my-tools
Terminal window
my source list # List installed git sources
my source update # Update all sources (git pull)
my source update my-tools # Update a specific source
my source remove my-tools # Remove a source

Install libraries from the public registry by name:

Terminal window
my library install kubernetes

Uninstall a registry library:

Terminal window
my library uninstall kubernetes

Sync registry libraries manually to fetch the latest commands:

Terminal window
my library sync
Terminal window
my library list # List all installed libraries (from any source)
my library list --json # Output as JSON
Terminal window
my library search kubernetes

Browse libraries interactively with the TUI:

Terminal window
my library explore

View details about a library:

Terminal window
my library info kubernetes
  • Directorymy-library/
    • mycli.yaml Manifest (required)
    • Directoryops/ Library directory
      • deploy.yaml Command spec (slug: “deploy”)
      • status.yaml Command spec (slug: “status”)
    • Directoryk8s/
      • logs.yaml Command spec (slug: “logs”)
mycli.yaml
schemaVersion: 1
name: my-library
description: A collection of useful commands
libraries:
ops:
name: Operations
description: Deployment and operations commands
path: ops
k8s:
name: Kubernetes
description: Kubernetes helper commands
path: k8s
  • schemaVersion must be 1
  • Each key in libraries is the library slug (must match ^[a-z][a-z0-9-]*$)
  • path points to a directory containing command spec files
  • Each spec file’s metadata.slug must match the filename (minus extension)

mycli.yml, mycli.json, and the older shelf.yaml/shelf.yml/shelf.json are also accepted for backward compatibility.

Run my library release to create a versioned release. Without arguments it prompts you to pick a version bump:

Terminal window
my library release
# Latest release: v1.0.0
# Bump to:
# 1) v1.0.1 (patch)
# 2) v1.1.0 (minor)
# 3) v2.0.0 (major)
# 4) Custom

You can also pass a tag directly:

Terminal window
my library release v1.1.0

Use --push to push the new tag to origin in one step, or --dry-run to preview without making changes:

Terminal window
my library release v1.1.0 --push
my library release --dry-run
  • Source repos are cloned to ~/.my/sources/repos/ (path derived from URL)
  • The source registry lives at ~/.my/sources/sources.json