Skip to main content
Skip to main content

Plugins

argsh supports plugin libraries that extend its functionality beyond the core. Plugins are installed per-project and imported like any other library.

Quick start

# Add a plugin
argsh lib add jaml

# Use it
import jaml

local domain
jaml::get config.yaml domain=.spec.cluster.domain

How it works

Plugins are distributed as OCI artifacts or GitHub release tarballs. They install to your project's .argsh/libs/ directory and are resolved via the standard import system.

myproject/
├── .argsh.yaml # declares dependencies
├── .argsh/
│ └── libs/ # installed plugins (gitignored)
│ └── jaml/
│ ├── jaml # executable argsh script
│ └── argsh-plugin.yml
└── script.sh

Commands

CommandDescription
argsh lib add <name>Install a plugin
argsh lib add <name>@<version>Install a specific version
argsh lib listList installed plugins
argsh lib remove <name>Remove a plugin
argsh lib installInstall all from .argsh.yaml

Project configuration

Declare dependencies in .argsh.yaml:

defaults:
path_libs: .argsh/libs

registries:
# argsh registry (ghcr.io/arg-sh/libs) is built-in
myco:
endpoint: harbor.mycompany.com/argsh

libs:
argsh@jaml: ^0.1.0
myco@k8s-utils: ^0.2.0

Import resolution

When you import jaml, argsh looks for it in this order:

  1. Relative to caller — standard import path
  2. Plugin libs.argsh/libs/jaml/jaml
  3. Bundled corelibraries/

Available plugins

PluginDescriptionStatus
jamlStructured YAML/JSON accessv0.1.0

Core vs plugins

Core libraries (is::, to::, string::, args, etc.) ship with argsh and are always available. Plugins are optional — install only what you need.

Core librariesPlugins
Locationlibraries/*.sh.argsh/libs/
InstallBuilt-inargsh lib add
DocsLibrary ReferenceThis section
Sourcearg-sh/argsharg-sh/libs
Was this section helpful?