Skip to content

Getting Started#

Install the pre-compiled binary#

You can install the pre-compiled binary (in several different ways), compile from source.

Below you can find the steps for each of them.

bash script#

bash installer has been provided so you can install afx by running this one command at your own risk.

curl -sL | bash
curl -sL | AFX_VERSION=v0.1.24 bash
env description default
AFX_VERSION afx version, available versions are on releases latest
AFX_BIN_DIR Path to install ~/bin

go install#

For Go developers.

go install


Download the pre-compiled binaries from the OSS releases page and copy them to the desired location.

Write YAML#

Let's say you want to install jq and enhancd with afx. So please write YAML file like this:

- name: stedolan/jq
  description: Command-line JSON processor
  owner: stedolan
  repo: jq
    name: jq
    tag: jq-1.6
    - from: '*jq*'
      to: jq
- name: b4b4r07/enhancd
  description: A next-generation cd command with your interactive filter
  owner: b4b4r07
  repo: enhancd
      ENHANCD_FILTER: fzf --height 25% --reverse --ansi:fzy

This declaration means afx gets jq v1.6 from GitHub release and install it into PATH as a command.

Okay, then let's save this file in ~/.config/afx/main.yaml.

Install packages#

After preparing YAML files, you become able to run install command:

$ afx install

This command runs install based on what were declared in YAML files.

Initialize packages#

After installed, you need to run this command to enable commands/plugins you installed.

$ source <(afx init)

afx init is just showing what needed to run commands/plugins. As a test, try to run.

$ afx init
source /Users/babarot/.afx/
export ENHANCD_FILTER="fzf --height 25% --reverse --ansi:fzy"

As long as you don't run it with source command, it doesn't effect your current shell.

Initialize when starting shell#

Add this command to your shell config (e.g. .zshrc) enable plugins and commands you installed when starting shell.

# enable packages
source <(afx init)

Update packages#

If you want to update package to new version etc, all you have to do is just to modify YAML file and then run afx update:

  - name: stedolan/jq
    description: Command-line JSON processor
    owner: stedolan
    repo: jq
      name: jq
-     tag: jq-1.5
+     tag: jq-1.6
      - from: '*jq*'
        to: jq
$ afx update
✔ stedolan/jq

Configure shell completions#

You can also use shell completion with afx. To enable completion at starting a shell, you need to add below to your each shell "rc" files.

$ source <(afx completion bash)
$ source <(afx completion zsh)
$ afx completion fish | source