Install the Ysra CLI on Windows with PowerShell, how commands are approved there, and how to run them contained with WSL.

On this page

The CLI runs on Windows from version 1.1.0.

Install#

In PowerShell:

irm https://ysra.ai/install.ps1 | iex
  • No administrator rights are needed.
  • The download is checked against its published checksum before it is installed.
  • ysra.exe goes into %LOCALAPPDATA%\Ysra\bin, which is added to your PATH. Open a new terminal afterwards.

Then:

ysra login
cd C:\code\billing-service
ysra

Your sign-in is stored encrypted for your Windows account. ysra update and ysra uninstall work as on other systems.

How commands work on Windows#

On macOS and Linux I run commands contained to your folder. Windows has no equivalent, so there commands aren't contained, and I ask before every one.

Run this command?
  npm test
  in C:\code\billing-service
Commands on Windows aren't contained: this can reach the network and anything
your account can.
  [Run once]  [Allow `npm test` for this session]  [Don't run]
Answer What it does
Run once Runs this command, this time
Allow … for this session Runs it, and the same command again in this session without asking
Don't run I don't run it, and I don't try it again
  • A shell or inline code (cmd, powershell, python -c, node -e) can only ever be run once. It is never allowed for the session, because it could run anything.
  • No answer within 15 minutes counts as Don't run.
  • Auto mode never answers this.
  • Stopping ends everything a command started.

Read the command and the folder before you answer. What I say about commands being contained elsewhere in these docs applies to macOS, Linux and WSL, not to plain Windows.

Contained commands with WSL#

If you have WSL, I can run commands inside it, contained to your folder as on Linux, with no card for each one.

  1. Install WSL yourself if you don't have it (wsl --install in PowerShell). I never install it for you.
  2. Inside WSL, install what I need:

    sudo apt install bubblewrap socat ripgrep
    
  3. Turn it on (see below).

Your project's tools then have to exist inside WSL too: Node.js, Python and so on are the WSL ones, not the Windows ones.

Other Windows behaviour#

  • Files keep their line endings. A CRLF file stays CRLF; an LF file stays LF.
  • I refuse names Windows treats specially, such as CON.txt or a name ending in a dot, and I won't work on a drive root or on C:\Users itself. Pick the project folder.

Turn WSL on or off#

ysra wsl        # run commands contained inside WSL
ysra wsl off    # back to asking before each command

ysra doctor shows which one is in effect on its commands line.

YsraDocs