Skip to content

Install the CLI

jiayang is one program. You use it to deploy apps, share them and read the audit log. Your AI agent can use it too.

It runs on macOS (Apple silicon and Intel), Linux (arm64 and x86-64) and Windows (arm64 and x86-64).

  1. Run the install script.

    Terminal window
    curl -fsSL https://jiayang.cloud/install.sh | sh

    The script puts jiayang in ~/.jiayang/bin. It adds that directory to your PATH in your shell’s startup files (.profile, .bashrc, .zshrc and fish’s conf.d). If ~/.config/jiayang/env.sh is left from an install somewhere else, it writes it again for this one.

  2. Open a new terminal, so it picks up the new PATH. To use jiayang in the terminal you ran the script in, run the line it prints instead. In zsh, bash or sh that’s:

    Terminal window
    . "$HOME/.config/jiayang/env.sh"

    In fish, it’s source "$HOME/.config/jiayang/env.fish". On Windows, open a new terminal.

  3. Check that it works. Run jiayang --version, and it prints the version you have.

On macOS or Linux, with Homebrew:

Terminal window
brew install ss2d22/tap/jiayang

With npm:

Terminal window
npm install -g jiayang

The npm package downloads the build for your machine while it installs, so it needs to reach GitHub. It picks the build that matches Node: on Windows on Arm, the arm64 build if you have the arm64 Node, and the x86-64 build if you have the x86-64 Node.

The CLI doesn’t update itself. Update it the way you installed it:

Terminal window
curl -fsSL https://jiayang.cloud/install.sh | sh # the script, run again
brew upgrade ss2d22/tap/jiayang # Homebrew
npm install -g jiayang@latest # npm

On Windows, run the PowerShell line again.

To take the CLI off your computer, run jiayang uninstall. See Uninstall the CLI.

Two environment variables change what the install script does:

Variable Effect
JIAYANG_HOME Install into $JIAYANG_HOME/bin instead of ~/.jiayang/bin.
JIAYANG_NO_MODIFY_PATH=1 Leave your shell’s startup files and PATH alone.

Some company networks send all traffic through a proxy that re-signs TLS with its own certificate authority. Zscaler and Netskope do this.

The CLI trusts what your operating system trusts, the way your browser does. IT usually puts the proxy’s certificate authority there, so on most managed laptops the CLI works wherever your browser does, with nothing to set.

If the proxy’s certificate authority isn’t in your system’s store, every command that talks to Jiayang Cloud fails with a certificate error. To fix it, point JIAYANG_CA_FILE at the proxy’s CA bundle, in PEM:

Terminal window
export JIAYANG_CA_FILE=/etc/ssl/certs/corp-ca.pem

If JIAYANG_CA_FILE isn’t set, the CLI uses SSL_CERT_FILE, which your IT team may have set already for other tools. The CLI trusts the certificates in the file as well as your system’s.

If the CLI can’t use the file, the command stops before it connects, and names the file:

error: Reading /etc/ssl/certs/corp-ca.pem, set in JIAYANG_CA_FILE: No such file or directory (os error 2).
error: /etc/ssl/certs/corp-ca.pem, set in JIAYANG_CA_FILE, has no certificates in it.
error: /etc/ssl/certs/corp-ca.pem, set in JIAYANG_CA_FILE, isn't a PEM certificate bundle: base64 decode error: InvalidCharacter(33).
error: /etc/ssl/certs/corp-ca.pem, set in JIAYANG_CA_FILE, has a certificate we can't read: invalid peer certificate: BadEncoding.

You get the second when the file has no PEM certificate in it, for example a certificate saved as DER. You get the third when a certificate block’s base64 is broken, and the fourth when a block decodes but doesn’t hold a certificate.

Yun, our cloud, says hi over jiayang --help and turns up at a few other moments: when you sign in, when jiayang init writes a template, and at an app’s first deploy. Yun naps when you sign out, or when nobody is signed in, and looks a little sad when a deploy is turned down.

Yun only shows when you’re at a terminal. It never shows with --json, when the output goes to a pipe or a file, or when NO_COLOR or CI is set, so scripts and agents never see it. To turn Yun off everywhere else too:

Terminal window
export JIAYANG_NO_MASCOT=1