Git Product home page Git Product logo

antibody's Introduction

GoReleaser Logo

Antibody

The fastest shell plugin manager.

Release Software License Travis Codecov branch Go Report Card Go Doc SayThanks.io Powered By: GoReleaser


Antibody can manage plugins for shells (zsh, for example), both loading them with source or export-ing them to PATH.

Why?

I was using Antigen before. It is a good plugin manager, but at the same time it's bloated and slow - 5+ seconds to load on my Mac... that's way too much to wait for a prompt to load!

Antibody is focused on performance, and, since v2.0.0, it manages more than just ZSH plugins, but also PATH plugins (those project with binaries) and it is easy enough to implement it for Fish and others.

asciicast

I'm aware that there are other attempts, like antigen-hs, but I don't want to install a lot of dependencies for this to work.

Why Go

Well, the compiled Go program runs anywhere and doesn't depend on any shared libraries. I also don't need to source it as it would be necessary with plain simple shell. I also can do things in parallel with Go routines.

What works

These are the only antigen commands I ever used:

  • bundle
  • update
  • apply

Antibody does just those three things, but you don't even need to apply. Running antibody bundle will already download and apply the given bundle.

antibody home also shows where the repositories are being downloaded.

What doesn't work

  • The theme command (although most themes might just work with bundle);
  • oh-my-zsh support: it looks very ugly to me and I won't do it;

Install

The simplest way to install Antibody is to run:

$ curl -sL https://git.io/antibody | bash -s
$ echo 'source <(antibody init)' >> ~/.zshrc

This will put the binary in /usr/local/bin/antibody and setup your ~/.zshrc to load what is needed on startup.

You can also use homebrew (on macOS):

$ brew install getantibody/tap/antibody

Or even using AUR on Arch Linux.

Usage

Now, you can just antibody bundle stuff, e.g., antibody bundle caarlos0/jvm. The repository will be cloned at your OS cache folder (check antibody home) folder.

The ZSH bundle implementation will try to load files that match:

  • *.plugin.zsh
  • *.zsh
  • *.sh
  • *.zsh-theme

The Path bundle implementation will just add the folder to your PATH.

You can change the implementation by adding kind:zsh or kind:path to the argument, as in antibody bundle 'caarlos0/ports kind:path'

You can also specify a branch to download, for example, antibody bundle caarlos0/jvm branch:v2 will download the v2 branch of that repository.

You may specify a subfolder if the repo you are bundling contains multiple, for example antibody bundle robbyrussell/oh-my-zsh folder:plugins/aws will look for the bundle files in that specific subfolder.

When you decide to update your bundles, just run antibody update: it will update all bundles inside the antibody home folder.

Protips

Prefer to use it like this:

$ cat plugins.txt
caarlos0/jvm
caarlos0/ports kind:path
djui/alias-tips
caarlos0/zsh-mkc
zsh-users/zsh-completions
caarlos0/zsh-open-github-pr
zsh-users/zsh-syntax-highlighting
zsh-users/zsh-history-substring-search

$ antibody bundle < plugins.txt

This way antibody can concurrently clone the bundles and return the shell line, so it will probably be faster than call each one separately.

In the wild

Static loading

You can use antibody in a static-loading manner (so you don't need to exec antibody every time you open a shell).

$ antibody bundle < bundles.txt > sourceables.sh
# In your zshrc (or whatever):
$ source sourceables.sh

Thanks

antibody's People

Contributors

akatrevorjay avatar caarlos0 avatar crdueck avatar mmlb avatar prayagverma avatar tresni avatar twang-rs avatar untoreh avatar waffle-iron avatar wkentaro avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.