Skip to content

Running Commands

Your local catalog is synced automatically when you run my cli login or my library add. You can also update libraries manually:

Terminal window
my library update

This pulls the latest changes from all installed library repos. The API catalog is synced with ETag support for efficient caching and stored locally at ~/.my/cache/.

Terminal window
my cli run <slug> [-- args...]

For example:

Terminal window
my cli run deploy -- production
my cli run greet -- --name World

Arguments after -- are parsed by the command spec. Positional arguments are matched in order, and flags use --name value syntax.

If a command has requireConfirmation: true in its policy, use -y to skip the prompt:

Terminal window
my cli run deploy -y -- production

Run a spec file directly without pushing to the registry:

Terminal window
my cli run -f command.yaml -- production

This is useful for local development and testing.

View details of a cached command:

Terminal window
my cli show deploy
my cli show deploy --raw # Output raw JSON spec
Terminal window
my cli history
my cli history -n 50 # Show last 50 entries

History is stored as JSONL at ~/.my/history.jsonl.

When you run a command, mycli:

  1. Loads the cached spec (or reads the file with -f)
  2. Parses positional args and flags from the command line
  3. Renders Go templates in run lines and env values
  4. Executes each step sequentially using the specified shell
  5. Records the run in history