Installation
arrai is a command-line tool written in Go. There are a variety of ways to install it, depending on your OS and use case.
Summary
- Docker:
docker run --rm -it -v $HOME:$HOME -w $(pwd) anzbank/arrai:latest - Go:
GO111MODULE=on go get -u github.com/arr-ai/arrai/cmd/arrai - Source:
git clone https://github.com/arr-ai/arrai.git
cd arrai
make install - Binary: download from the GitHub releases page to your
PATH
Check the installation with arrai help.
Requirements
Pre-compiled binary
-
Download the pre-compiled binaries matching your OS from the releases page.
-
Uncompress the archive and move the
arraibinary to your desired location:- On your
PATHto run it witharrai - Elsewhere to run it with
./arrai, or some otherpath/to/arrai
- On your
Go get it
First make sure you've installed Go:
go version
Fetch the arrai command's Go module:
GO111MODULE=on go get -u github.com/arr-ai/arrai/cmd/arrai
Do NOT run this from inside a Go source directory that is module enabled, otherwise it gets added to go.mod/go.sum.
Docker
You can use arrai within a Docker container (created from this Dockerfile):
docker run --rm -it -v $HOME:$HOME -w $(pwd) anzbank/arrai:latest
For example:
docker run --rm \
-v $PWD:/go/src/github.com/arr-ai/arrai \
-w /go/src/github.com/arr-ai/arrai \
anzbank/arrai:latest run -v examples/simple/simple.arrai
Mac and Linux users can create an alias for the arrai command:
alias arrai="docker run --rm -it -v $HOME:$HOME -w $(pwd) anzbank/arrai:latest"
arrai can then be used from the same terminal window. Alternatively, add the alias to your .bashrc or .zshrc file to keep it permanently.
Compile from source
git clone https://github.com/arr-ai/arrai.git
cd arrai
GOPATH=$(go env GOPATH) make install
Try it out
If the installation worked, you should be able to run:
arrai
usage: arrai [<flags>] <command> [<args> ...]
...
You can always check your setup of arrai with:
arrai --version
arrai info
VS Code Extension
Arr.ai has a VS Code extension which provides syntax highlighting for .arrai files. Get it from here, or search Extensions for "arrai".
Shortcuts
Installing via make install will set up symlinks:
ai=>arrai i: interactive shellax=>arrai x: transform
If your installation method did not set up similar shortcuts, you may like to do so yourself (e.g. with alias ai="arrai i" in Bash).