Running Commands
Run library commands
Section titled “Run library commands”After installing a library, its commands are available as top-level subcommands:
my <library> <command> [args] [--flags]For example:
my kubernetes port-forward svc/my-service -p 8080my ops deploy api -e productionLibraries can have aliases, so my k8s logs may work as a shorthand for my kubernetes logs. Use my <library> --help to see available commands in a library.
Sync your catalog
Section titled “Sync your catalog”Your local catalog is synced automatically when you run my cli login or my source add. You can also update git-backed sources manually:
my source updateThis pulls the latest changes from all installed source repos. The API catalog is synced with ETag support for efficient caching and stored locally at ~/.my/cache/.
Run personal commands
Section titled “Run personal commands”Run your own published commands by slug:
my cli run <slug> [-- args...]For example:
my cli run deploy -- productionmy cli run greet -- --name WorldArguments after -- are parsed by the command spec. Positional arguments are matched in order, and flags use --name value syntax.
Skip confirmation
Section titled “Skip confirmation”If a command has requireConfirmation: true in its policy, use -y to skip the prompt:
my cli run deploy -y -- productionInteractive picker
Section titled “Interactive picker”Running my cli run with no arguments opens an interactive picker:
my cli runThe picker searches across all sources: local spec files in the current directory, personal (synced) commands, installed libraries, and git sources.
If the terminal is not a TTY (e.g., inside a script or CI), the command prints a table of available commands instead.
Run from a file
Section titled “Run from a file”Run a spec file directly without pushing to the registry:
my cli run -f command.yaml -- productionYou can also pass a directory to -f to auto-detect a spec file in the current directory:
my cli run -f .This is useful for local development and testing.
Inspect a command
Section titled “Inspect a command”View details of a cached command:
my cli show deploymy cli show deploy --raw # Output raw JSON specView run history
Section titled “View run history”my cli historymy cli history -n 50 # Show last 50 entriesHistory is stored as JSONL at ~/.my/history.jsonl.
How execution works
Section titled “How execution works”When you run a command, mycli:
- Loads the cached spec (or reads the file with
-f) - Parses positional args and flags from the command line
- Renders Go templates in
runlines andenvvalues - Executes each step sequentially using the specified shell
- Records the run in history