Skip to content

Installation

Ayooluwa Isaiah edited this page Sep 18, 2021 · 4 revisions

Focus is written in Go, so you can install it through go install (requires Go 1.16 or later):

$ go install github.com/ayoisaiah/focus/cmd/focus@latest

On Linux, the libasound2-dev package is required to compile Focus. Ubuntu or Debian users can install it through the command below:

$ sudo apt install libasound2-dev

NPM Package

You can also install Focus via through its NPM package:

With npm:

$ npm i @ayoisaiah/focus -g

With yarn:

$ yarn global add @ayoisaiah/focus

Debian / Ubuntu based distributions

Download the appropriate deb file for your system architecture from the releases page:

$ curl -LO https://github.com/ayoisaiah/focus/releases/download/v1.2.0/focus_1.2.0_linux_amd64.deb # 64-bit
$ sudo dpkg -i focus_1.2.0_linux_amd64.deb

Fedora / CentOS

Download the appropriate rpm file for your system architecture from the releases page:

$ curl -LO https://github.com/ayoisaiah/focus/releases/download/v1.2.0/focus_1.2.0_linux_amd64.rpm # 64-bit
$ sudo rpm -i focus_1.2.0_linux_amd64.rpm

Scoop (Windows)

$ scoop bucket add ayoisaiah-scoop-bucket https://github.com/ayoisaiah/scoop-bucket
$ scoop install focus

Download pre-compiled binaries

Pre-compiled binaries for Linux, Windows, and macOS on the releases page. Download the file archive for your operating system and architecture, then copy it to your $PATH:

For Linux:

# download archive
$ curl -LO https://github.com/ayoisaiah/focus/releases/download/v1.2.0/focus_1.2.0_linux_amd64.tar.gz

# extract archive
$ tar -xvzf focus_1.2.0_linux_amd64.tar.gz

# make binary executable
$ chmod +x focus

# move binary to path
$ sudo mv focus /usr/local/bin

For macOS:

# download archive
$ curl -LO https://github.com/ayoisaiah/focus/releases/download/v1.2.0/focus_1.2.0_darwin_amd64.tar.gz

# extract archive
$ tar -xvzf focus_1.2.0_darwin_amd64.tar.gz

# make binary executable
$ chmod +x focus

# move binary to path
$ sudo mv focus /usr/local/bin

For Windows:

Learn how to add a directory to your $PATH in Windows here.

# download archive
$ curl.exe -LO https://github.com/ayoisaiah/focus/releases/download/v1.2.0/focus_1.2.0_windows_amd64.tar.gz

# extract archive
$ tar -xvzf focus_1.2.0_windows_amd64.tar.gz

# move binary a directory in your path
$ move focus.exe C:\Users\<user>\.bin

Build from source

  1. Verify that you have Go v1.16 or later installed:
$ go version
go version go1.16 linux/amd64
  1. Clone this repository
$ git clone https://github.com/ayoisaiah/focus
$ cd focus
  1. Build and install binary to $GOBIN
$ go install ./...
  1. Run focus --version to see if it worked
$ focus --version