Skip to content

Libraries

A library is a collection of commands that you can install and use. Libraries can come from the registry or from any git repository — no account needed.

  1. my library add <identifier> installs from the registry by name, or clones a git URL and reads its manifest (shelf.yaml)
  2. Each library in the manifest maps to a directory of command spec files
  3. Commands become available as my <library> <slug> (e.g., my ops deploy)
  4. my library update pulls the latest changes from all installed libraries

library has alias lib (e.g., my lib add kubernetes).

Terminal window
my library add kubernetes
Terminal window
my library add https://github.com/user/example-library.git
Terminal window
my library add https://github.com/user/example-library.git --ref v1.0
Terminal window
my library add https://github.com/user/example-library.git --name my-tools

After installing a library, its commands are available as top-level subcommands:

Terminal window
my ops deploy -- production
my k8s logs -- my-pod
Terminal window
my library list # List all installed libraries
my library list --json # Output as JSON
my library update # Update all libraries
my library update my-tools # Update a specific library
my library remove my-tools # Remove a library
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/
    • shelf.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”)
shelf.yaml
shelfVersion: 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
  • shelfVersion 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)

shelf.yml and shelf.json are also accepted for backward compatibility.

Create a versioned release from a git tag:

Terminal window
my library release v1.0.0
  • Library repos are cloned to ~/.my/libraries/repos/ (path derived from URL)
  • The library registry lives at ~/.my/libraries/libraries.json