Skip to content
/ yay Public
Notifications You must be signed in to change notification settings

hs7t/yay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Nov 27, 2025
e1108af · · Nov 27, 2025

History

21 Commits
Nov 26, 2025
Nov 27, 2025
Nov 27, 2025
Nov 27, 2025
Nov 27, 2025

Repository files navigation

The yay logo

yay 0.1

yay is a format for easily defining cross-platform scripts. It's extremely easy to write and not that useful right now..

asciicast

yay scripts are based on instructions. This is an example of a simple yay script:

% yay 0.1
% title  "Example script"
% revision 1
% supports s '*'


! print "Hello, world!"


! clone 'https://github.com/hs7t/yay.git'

! navto randomrepo

Let's walk through it.

These four instructions define a few meta values:

% yay 0.1
% title  "Example script"
% revision 1
% supports s "*"

That % is a command. All instructions start with a command, and the Set Global//% command is used for definitions. % yay 0.1 sets the value of the meta property yay to a number, 0.1. In JavaScript, that would be something like this::

meta.yay = 0.1;

Isn't that neat?

These values we just set are useful for the yay trampoline (in less silly words, runner - more on that later). meta.yay sets the version of yay we're using (for compatibility purposes). meta.title is the name of your script, revision is the version of your script, and supports is the OS your script supports. (I recommend setting supports to "*", a wildcard for all OSes. You probably shouldn't use any other values.))

Let's look at the next instruction:

! print "Hello, world!"

This is another command! Run Action/! runs an action. It's the core of this whole thing. Many commands are different in different shells. yay makes supporting more platforms easier by abstracting the shell away..

With ! print "Hello, world!", we're printing the string "Hello, world!" to the user's console. Awesome!!

The next instruction looks like this:

! clone 'https://github.com/hs7t/yay.git'

Which would be equivalent to writing...

$ git clone 'https://github.com/hs7t/yay.git'

Here's something fun - that line above is also a valid yay instruction! So if you're for some reason using Mercurial, you could do something like this:s:

! print "I'm a happy Mercurial user!"
$ hg clone  'hg clone https://www.mercurial-scm.org/repo/hg/'

That $ command we're using is called Shell Run. When the instruction $ hg clone "https://www.mercurial-scm.org/repo/hg/" is run, hg clone "https://www.mercurial-scm.org/repo/hg/" will be passed to the shell. Nice!!

The trampoline

The yay trampoline is multi-platform CLI that reads and runs yay scripts. It's written in some very messy Python..

It currently supports:

  • PowerShell 5.1+
  • Bash
  • Windows Command Prompt
  • POSIX shell
  • Z shell

Hop on!

Downloading a binary

Grab yourself a binary from the Releases tab. They're available::

  • for Linux (x86-64 / arm64): trampoline-linux-[x86_64 or arm64]
  • for macOS: trampoline-macos-[arm64 or x86_64]
  • for Windows: trampoline-windows-[x86_64 or arm64].exe

Tip

Not sure what you need? If you're running Windows or Linux, your device is most likely to work with the x86_64 version (unless you're using a Snapdragon processor or something). If you're on an Apple Silicon (M1, M2, M3...) Mac, choose the arm64 binary.ry.

Linux and Mac

Before you can run the binary you just downloaded on Linux or your Mac, you have to mark it as an executable. From your terminal, run this command::

chmod +x binary     # for example, chmod +x trampoline-macos-arm64

Optional: Update your PATH

Follow these steps:

  1. Move the binary into its own folder (wherever you want - not Downloads!)
  2. Run a command appropriate for your OS:
    • macOS (zsh):
      export PATH="$PATH:/path/to/folder"
      
      source ~/.zshrc
    • Linux (bash):
      export PATH="$PATH:/path/to/folder"
      
      source ~/.bashrc    # or ~/.profile, depending on your shell
    • Windows (PowerShell)
      [Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\path\to\folder", "User")

Tip

Try renaming the binary to yay (or yay.exe on Windows) to use it by just typing yay!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages