• Stars
    star
    146
  • Rank 252,769 (Top 5 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 3 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

📦 Package manager for CLI

AFX - Package manager for CLI

AFX is a package manager for command-line tools and shell plugins. afx can allow us to manage almost all things available on GitHub, Gist and so on. Before, we needed to trawl web pages to download each package one by one. It's very annoying every time we set up new machine and also it's difficult to get how many commands/plugins we installed. So afx's motivation is coming from that and to manage them with YAML files (as a code).

Full document is here: AFX

Features

  • Allows to manage various packages types:
    • GitHub / GitHub Release / Gist / HTTP (web) / Local
    • gh extensions
  • Manages as CLI commands, shell plugins or both
  • Easy to install/update/uninstall
  • Easy to configure with YAML
    • Environment variables for each packages
    • Aliases for each packges
    • Conditional branches
    • Build steps
    • Run snippet code
    • Dependency between packages
    • etc...
  • Works on bash, zsh and fish

Quick Start plus!

1. Install packages

Write YAML file with name as you like in ~/.config/afx/. Let's say you write this code and then put it into github.yaml. After than you can install packages with install command.

+ github:
+ - name: stedolan/jq
+   description: Command-line JSON processor
+   owner: stedolan
+   repo: jq
+   release:
+     name: jq
+     tag: jq-1.5
+   command:
+     link:
+     - from: '*jq*'
+       to: jq
$ afx install

2. Load packages

You can enable installed packages to your current shell with this command:

$ source <(afx init)

Take it easy to run afx init because it just shows what to apply in your shell to Stdout.

If you want to automatically load packages when you start new shell, you need to add above to your shell-rc file.

3. Update packages

All you have to do for updating is just to update version part (release.tag) to next version then run update command.

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

4. Uninstall packages

Uninstalling is also almost same as install. Just to remove unneeded part from YAML file then run uninstall command.

- github:
- - name: stedolan/jq
-   description: Command-line JSON processor
-   owner: stedolan
-   repo: jq
-   release:
-     name: jq
-     tag: jq-1.6
-   command:
-     link:
-     - from: '*jq*'
-       to: jq
$ afx uninstall

Advanced tips

Shell completion

For zsh user, you can enable shell completion for afx:

# .zshrc
source <(afx completion zsh)

bash and fish users are also available.

Installation

Download the binary from GitHub Release and drop it in your $PATH.

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

curl -sL https://raw.githubusercontent.com/b4b4r07/afx/HEAD/hack/install | bash

License

MIT

More Repositories

1

enhancd

🚀 A next-generation cd command with your interactive filter
Shell
2,426
star
2

dotfiles

A repository that gathered files starting with dot
Shell
759
star
3

emoji-cli

😱 Emoji completion on the command line
Shell
424
star
4

gomi

🗑️ Replacement for UNIX rm command!
Go
304
star
5

httpstat

It's like curl -v, with graphs and colors
Shell
254
star
6

gist

:octocat: A simple gist editor for CLI
Go
130
star
7

zsh-vimode-visual

Implement the vim-like visual mode to vi-mode of zsh
Shell
109
star
8

stein

A linter for config files with a customizable rule set
Go
97
star
9

zsh-history

A plugin for zsh history extended by golang, dealing it like SQL
Go
84
star
10

github-labeler

Declarative way to configure GitHub labels
Go
74
star
11

iap_curl

A CLI that is curl wrapper for making HTTP request to IAP-protected app, more easier than curl
Go
61
star
12

history

A CLI to provide enhanced history for your shell
Go
59
star
13

ssh-keyreg

A CLI tool add ssh key to github.com user account
Shell
54
star
14

git-bump

Bump version (git tag) to next one with semver.
Go
49
star
15

zsh-gomi

🚮 zsh-gomi implements CLI gomi written in Go.
Shell
32
star
16

brionac

🐉 A simple alternative means of the Brewfile
Go
28
star
17

zgencomp

A generator for Zsh completion function
Go
25
star
18

go-finder

CLI finder wrapper (fzf, peco, etc) for golang
Go
21
star
19

vim-sqlfmt

A plugin for SQL formatter like gofmt
Vim Script
18
star
20

manyawk

🐒 GNU AWK library
Awk
18
star
21

vim-shellutils

🐚 A simple UNIX Shell commands emulator that works within Vim
Vim Script
18
star
22

favdir

Save favorite directory on bash and zsh
Shell
16
star
23

go-pipe

Unix-like pipelines for Go
Go
15
star
24

cli-finder

📁 A command-line finder with fzf
Shell
14
star
25

ultimate

Ultimate is a simple theme for minimalistic zsh users
Shell
12
star
26

crowi-cli

A simple Crowi client for CLI
Go
12
star
27

cli

Get binaries from GitHub releases
Shell
12
star
28

gch

⚡ List the changes that are applied to the repository in the $GOPATH/src directory.
Go
11
star
29

yamato-bot

JavaScript
11
star
30

tellme.tokyo

🗼 @babarot's blog
CSS
11
star
31

vim-ansible-vault

Encrypt/Decrypt the file contents on the buffer from Vim command line with ansible-vault
Vim Script
11
star
32

zle-vimode

Shell
10
star
33

twistd

🐦 Twitter Streaming Daemon
Go
9
star
34

gotcha

gotcha is a simple tool that grabs Go packages
Go
9
star
35

action-changed-objects

GitHub Action to get changed files compared with origin/master
Shell
9
star
36

zgit

[WIP] zgit is simple git interface
Shell
9
star
37

http_code

http_code returns HTTP status code description
Shell
9
star
38

action-opa

Run opa test command with GitHub Actions
Shell
8
star
39

peco-tmux.sh

Run piping peco opening new tmux pane like fzf-tmux
Shell
8
star
40

copy

Shell
8
star
41

zspec

zspec is a testing framework for zsh
Shell
7
star
42

epoch-cat

Epoch time converter and filter like less
Go
7
star
43

easy-oneliner

Shell
7
star
44

pkill.sh

Kill processes by filtering tool
Shell
6
star
45

vtest

Unix `test` command for Version comparison
Go
6
star
46

bashmark

Directory bookmarks for the shell
Shell
6
star
47

cdhist

Cdhist adds 'web-browser like history' to your bash shell.
Shell
6
star
48

vim-sunset

Automatically set background on local sunrise/sunset time
Vim Script
6
star
49

kubeabc

A toolkit for k8s developers
Go
6
star
50

git-br

Shell
5
star
51

tmux-git-prompt

Git status on Tmux status line
Shell
5
star
52

vim-buftabs

A plugin for buffer like the tabpages in statusline
Vim Script
5
star
53

zsh-prompt-minimal

Super super minimal prompt for zsh
Shell
5
star
54

vim-crowi

A simple vim plugin for Crowi
Vim Script
5
star
55

zplug-cd

4
star
56

fzf-plugins

Plugins for fzf
Shell
4
star
57

vim-autocdls

🐾 A Vim plugin to run shell like ls command after :cd, :lcd and so on
Vim Script
4
star
58

misc

📥 Miscellaneous files which don't belong to any project
Shell
4
star
59

git-fzf

Shell
4
star
60

git-conflict

Shell
3
star
61

zsh-history-ltsv

🔍 Command history tool available on Zsh enhanced drastically
Shell
3
star
62

git-powertools

Shell
3
star
63

tmux-k8s-context-indicator

Shell
3
star
64

git-switch

Shell
3
star
65

ltsv.sh

A simple ltsv parser with extended awk
Shell
3
star
66

zplug-rm

3
star
67

action-conftest

Run conftest test command with GitHub Actions
Shell
3
star
68

github-comment

Post a text to GitHub issue / pull request
Go
3
star
69

release-go

Helper script for goreleaser to make it easy to release Go artifacts
Shell
3
star
70

tmux-powertools

Shell
3
star
71

git-ls

List file entries like GitHub file browser
Shell
3
star
72

vim-favdir

Save favorite directory on vim
Vim Script
3
star
73

releases

The easiest way which grabs binaries from GitHub Releases
Shell
3
star
74

gocli

Examples of CLI command implementation pattern for golang
Go
3
star
75

cursor-x.nvim

Lua
2
star
76

blog

A CLI tool for editing blog built by Hugo
Go
2
star
77

neoplug.vim

Manage Vim plugins by neobundle but install them with vim-plug
Shell
2
star
78

ls.zsh

Shell
2
star
79

vim-pt

💎 Vim plugin for the_platinum_searcher, 'pt'
Vim Script
2
star
80

go-colon

Parse colon-separated strings like PATH
Go
2
star
81

make_iap_request

Sample scripts which make the HTTP request to IAP-protected app
Python
2
star
82

enhancd3

WIP
Shell
2
star
83

action-github-comment

GitHub Actions to post a text to GitHub issue / pull request
Dockerfile
2
star
84

hashtag-bot

Go
2
star
85

open-link.sh

Shell
2
star
86

nginx-config-tester

Shell
2
star
87

lab-for-github-actions

Lab for GitHub Actions
Shell
1
star
88

talks

Hosted original sources related to my presentations and talks
Go
1
star
89

glob2regex

Shell
1
star
90

zpath

Shell
1
star
91

zplug-doctor

1
star
92

para

PAger wRApper written in golang
Go
1
star
93

noc

Count number of commands a day
C
1
star
94

changed-objects

Get changed objects in Git commit
Go
1
star
95

kube

DEPRECATED
Go
1
star
96

zsh_plugin

Shell
1
star
97

go-pathshorten

A go port of pathshorten() defined on Vim script
Go
1
star
98

.vim

Vim Script
1
star
99

git-relnotes

wip
Shell
1
star
100

til

Makefile
1
star