• Stars
    star
    363
  • Rank 117,374 (Top 3 %)
  • Language
    Shell
  • License
    MIT License
  • Created about 9 years ago
  • Updated almost 2 years ago

Reviews

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

Repository Details

A minimalist package manager for fish shell

fundle Build Status

A minimalist package manager for fish inspired by Vundle.

All plugins are installed/updated using git, so the only requirement is to have git installed and on the path (and well, fish, obviously).

This package manager is compatible with oh-my-fish plugins. If you need the core functions of oh-my-fish, you can use the danhper/oh-my-fish-core plugin.

Installation

You can use the installer:

curl -sfL https://git.io/fundle-install | fish

Or if you don't like to pipe to a shell, just drop fundle.fish in your ~/.config/fish/functions directory and you are done.

mkdir -p ~/.config/fish/functions
wget https://git.io/fundle -O ~/.config/fish/functions/fundle.fish

Automatic install

If you want to automatically install fundle when it is not present, you can add the following at the top of your ~/.config/fish/config.fish.

if not functions -q fundle; eval (curl -sfL https://git.io/fundle-install); end

ArchLinux

fundle is available on the AUR, so you can install it system wide with

yaourt -S fundle-git

Updating

From fundle 0.2.0 and onwards, you can use fundle self-update to update fundle.

Usage

Sample config.fish

Add this to your ~/.config/fish/config.fish or any file that you use to load fundle's plugins (in /etc/fish for example):

fundle plugin 'edc/bass'
fundle plugin 'oh-my-fish/plugin-php'
fundle plugin 'danhper/fish-fastdir'
fundle plugin 'danhper/fish-theme-afowler'

fundle init

This will source the four plugins listed and load all the functions and completions found.

Note that the fundle init is required on each file loading a plugin, so if you load plugins in multiple .fish files, you have to add fundle init to each one of them.

After editing config.fish:

  1. Reload your shell (you can run exec fish for example)
  2. Run fundle install
  3. That's it! The plugins have been installed in ~/.config/fish/fundle

In depth

To add a plugin, you simply need to open ~/.config/fish/config.fish and add:

fundle plugin 'repo_owner/repo_name'

For example:

fundle plugin 'danhper/fish-fastdir'

will install the repository at https://github.com/danhper/fish-fastdir.

To pick a specific version of the plugins, you can append @ followed by a tag from the repo:

fundle plugin 'joseluisq/[email protected]'

will install Gitnow release 2.7.0 at https://github.com/joseluisq/gitnow/releases/tag/2.7.0.

If you need to change the repository, you can pass it with --url and it will be passed directly to git clone:

fundle plugin 'danhper/fish-fastdir' --url '[email protected]:danhper/fish-fastdir.git'

Keep in mind that this option overrides any tag set with '@'.

It also works with other repository hosts:

fundle plugin 'username/reponame' --url '[email protected]:username/reponame.git'

And it works with https remote as well (in case you have "the authenticity of host github can't be established"):

fundle plugin 'username/reponame' --url 'https://gitlab.com/username/reponame.git'

You can also use a branch, tag or any commit-ish by appending #commit-ish to the URL. For example:

fundle plugin 'danhper/fish-fastdir' --url '[email protected]:danhper/fish-fastdir.git#my-branch'

will use my-branch. If no commit-ish is passed, it will default to master.

If the fish functions or completions are in a subdirectory of the repository, you can use --path to choose the path to load.

fundle plugin 'tmuxnator/tmuxinator' --path 'completion'

After having made all the calls to fundle plugin, you need to add

fundle init

in your configuration file for the plugins to be loaded.

IMPORTANT: When you add new plugins, you must restart your shell before running fundle install. The simplest way to do this is probably to run exec fish in the running shell.

You can then run

fundle install

for fundle to download them.

You can also use

fundle update

to update the plugins.

Commands

  • fundle init: Initialize fundle, loading all the available plugins
  • fundle install: Install all plugins
  • fundle update: Update all plugins (deprecates: fundle install -u)
  • fundle plugin PLUGIN [--url PLUGIN_URL] [--path PATH]: Add a plugin to fundle.
    • --url set the URL to clone the plugin.
    • --path set the plugin path (relative to the repository root)
  • fundle list [-s]: List the currently installed plugins, including dependencies (-s gives a shorter version)
  • fundle clean: Cleans unused plugins
  • fundle self-update: Updates fundle to the latest version
  • fundle version: Displays the current version of fundle
  • fundle help: Displays available commands

Completions are available in the completions/fundle.fish. Note that you will need to install fish-completion-helpers to use them.

Plugin structure

A plugin basically has the following structure.

.
├── completions
│   └── my_command.fish
├── functions
│   ├── __plugin_namespace_my_function.fish
│   └── my_public_function.fish
├── init.fish
└── README.md
  • init.fish will be sourced directly, so it should not do anything that takes too long to avoid slowing down the shell startup. It is a good place to put aliases, for example.
  • functions is the directory containing the plugin functions. This directory will be added to fish_function_path, and will therefore be auto loaded. I suggest you prefix your functions with __plugin_name if the user will not be using them explicitly.
  • completions is the directory containing the plugin completions. This directory will be added to fish_complete_path.

NOTE: if no init.fish file is found, the root folder of the plugin is treated as a functions directory. This is to make the plugins compatible with oh-my-fish plugins themes.

Managing dependencies

fundle can manage dependencies for you very easily. You just have to add

fundle plugin 'my/dependency'

in your plugin init.fish and fundle will automatically fetch and install the missing dependencies when installing the plugin.

I created a minimal example in fish-nvm, which depends on edc/bass.

Profiling

Obviously, adding plugins makes the shell startup slower. It should usually be short enough, but if you feel your shell is becoming to slow, fundle has a very basic profiling mode to help you.

All you need to do is to change

fundle init

to

fundle init --profile

in your config.fish and fundle will print the time it took to load each plugin.

NOTE:

  • You will need the gdate command on OSX. You can install it with brew install coreutils.
  • This functionality simply uses the date command, so it prints the real time, not the CPU time, but it should usually be enough to detect if something is wrong.
  • When a plugin include dependencies, the load time for each dependency is added to the parent plugin load time.

Compatible plugins

Most oh-my-fish plugins should work out of the box or with danhper/oh-my-fish-core installed.

Please feel free to edit the wiki and add your plugins, or plugins you know work with fundle.

Contributing

Contributions are very appreciated. Please open an issue or create a PR if you want to contribute.

If you created a package compatible with fundle, feel free to add it to the Wiki.

Motivations

I know that oh-my-fish has a utility to install packages, but I wanted the simplest tool possible, not a whole framework.

Changelog

  • 2016-04-06 (v0.5.1): Fix fundle help to show clean command.
  • 2016-04-06 (v0.5.0): Add fundle clean. Deprecate fundle install -u and add fundle update thanks to @enricobacis.
  • 2015-12-22 (v0.4.0): Add --path option, thanks to @Perlence.
  • 2015-12-16 (v0.3.2): Fix profiling in OSX.
  • 2015-12-14 (v0.3.1): Fix incompatibility with oh-my-fish. Rename plugins to list.
  • 2015-12-14 (v0.3.0): Fix dependency load order. Add profiling mode.
  • 2015-12-14 (v0.2.2): Emit plugin initialization event
  • 2015-12-07 (v0.2.1): Use curl instead of wget for self-update
  • 2015-12-07 (v0.2.0): Add self-update command
  • 2015-12-07 (v0.1.0): Fix bug with dependency loading in fundle init
  • 2015-11-24: Allow the use of #commit-ish when using plugin repo. Checkout repository commit-ish instead of using master branch.

More Repositories

1

atomic-chrome

Edit Chrome textareas in Atom
JavaScript
916
star
2

opencov

Open source code coverage history webapp
Elixir
312
star
3

fish-ssh-agent

Shell
288
star
4

ex_cli

User friendly CLI apps for Elixir
Elixir
214
star
5

python-i18n

Easy to use i18n library for Python
Python
201
star
6

structomap

Easily and dynamically generate maps from Go static structures
Go
141
star
7

pushex

Push notifications for Elixir
Elixir
104
star
8

elixir-browser

Browser detection for Elixir
Elixir
95
star
9

atomic-chrome-atom

Edit Chrome textareas in Atom
CoffeeScript
93
star
10

elixir-temp

Temporary files and directories for Elixir
Elixir
74
star
11

plug-navigation-history

Elixir plug to keep navigation history
Elixir
71
star
12

elixir-git-cli

A simple interface to Git CLI for Elixir
Elixir
68
star
13

phoenix-active-link

Elixir/Phoenix view helper to manage "active" state of a link
Elixir
63
star
14

elixir-web-push-encryption

Elixir implementation of Web Push Payload encryption.
Elixir
59
star
15

eclair

A Solidity interpreter
Rust
49
star
16

bigcode-tools

Set of tools to help working with "Big Code"
Python
43
star
17

rust-simple-nn

Simple neural network implementation in Rust
Rust
34
star
18

seedex

Seed data generation for Ecto
Elixir
29
star
19

securerandom

Go
25
star
20

evm-analyzer

Code for Smart Contract Vulnerabilities: Vulnerable Does Not Imply Exploited
OCaml
23
star
21

fish-fastdir

Fast directory navigation for fish
Shell
19
star
22

suplearn-clone-detection

Cross language clone detection using supervised learning
Python
18
star
23

asdf-exec

Native command to run asdf shims
Go
16
star
24

node-git-cli

Simple CLI like git interface for Node.
CoffeeScript
16
star
25

defi-plf-analysis

Code and data for the paper: DeFi Protocols for Loanable Funds: Interest Rates, Liquidity and Market Efficiency
Jupyter Notebook
14
star
26

scalog

Datalog implementation in Scala.
Scala
12
star
27

atom-align-regexp

Regexp based alignment for Atom
JavaScript
11
star
28

koa-police

Policy based authentication library for Koa
JavaScript
9
star
29

fontawesome-icons-list

Fontawesome icons list
JavaScript
9
star
30

blockchain-analyzer

Tool to fetch and analyze blockchain transactions
Go
9
star
31

fish-kubectl

Shell
8
star
32

oh-my-fish-core

oh-my-fish core library extracted
Shell
7
star
33

sigma-bower

Bower repository for SigmaJS
JavaScript
6
star
34

dotfiles

TeX
5
star
35

ecto-secure-password

has_secure_password for Ecto models
Elixir
5
star
36

ocaml-monads

OCaml
5
star
37

fish-completion-helpers

Fish helper functions to simplify completions
Shell
5
star
38

go-sqs-client

Go
4
star
39

wedding

Simple webapp to manage guests and invitations for my wedding with Ai.
Ruby
4
star
40

ethereum-tools

Python
4
star
41

simple-bitcoin-parser

Simple Python Bitcoin parser/formatter implementation
Python
4
star
42

phd-thesis

TeX
3
star
43

deepsentence

和文文書からの要点抽出
Python
3
star
44

scala-simple-compiler

Scala
3
star
45

flashcards-cli

Text-based flashcards
OCaml
3
star
46

code-battle

HTML
3
star
47

fish-nvm

nvm wrapper for fish
Shell
3
star
48

fish-asdf

fish plugin for asdf vm
Shell
2
star
49

projare

Sample app using Elixir, Phoenix and RiotJS
JavaScript
2
star
50

sublime-file-commands

Commands to work with files in Sublime Text
Python
2
star
51

advent-2022

Rust
2
star
52

elixir-logger-sample

Elixir
2
star
53

meditable

WIP: markdown <-> html
JavaScript
2
star
54

easter-egg-hunt

Ruby
1
star
55

websocket-rails-bower

1
star
56

master-thesis

A study of machine learning approaches to cross-language code clone detection
TeX
1
star
57

advent-2020

Haskell
1
star
58

advent-2023

F#
1
star
59

vim-config

Vim Script
1
star
60

go-ethereum-customized

Fork of the official geth client
Go
1
star
61

word-frequency-analyzer

Simple word frequency analyzer with JavaFX rendering.
Scala
1
star
62

bachelor-thesis

Repository for my bachelor thesis
TeX
1
star
63

js-easy-params

Decorator for JS functions with optional arguments
JavaScript
1
star
64

scala-x-server

System to run an X server in a web browser
Scala
1
star
65

jsurl_ex

Elixir
1
star
66

tokyo-ex-1-slides

HTML
1
star
67

erlang-sqs-client

Erlang
1
star
68

revealjs-jade-starter

HTML
1
star
69

sublime-rails-status-snippets

ST2/3 snippets for HTTP codes symbols in RoR
Python
1
star
70

ansible-exrm

1
star
71

koa-police-jwt

JWT strategy for koa-police
JavaScript
1
star
72

django-twitter-auth-sample

Python
1
star
73

aleth

C++
1
star