项目作者: 0rax

项目描述 :
A simple docker wrapper (docker, docker-machine & docker-compose) for fish-shell.
高级语言: Shell
项目地址: git://github.com/0rax/narwhal.git
创建时间: 2016-02-27T17:34:46Z
项目社区:https://github.com/0rax/narwhal

开源协议:MIT License

下载


Narwhal

A simple docker wrapper (docker, docker-machine & docker-compose) for fish-shell.

Usage

  1. # narwhal 1.0.0 (https://github.com/0rax/narwhal)
  2. A simple docker wrapper (docker, docker-machine & docker-compose) for fish-shell.
  3. Usage:
  4. narwhal COMMAND [OPTIONS]
  5. Commands:
  6. machine [args...]
  7. Call docker-machine with args
  8. Alias for `docker-machine [args...]`
  9. compose [args..]
  10. Call docker-compose with args
  11. Alias for `docker-compose [args...]`
  12. [clean|cleanup] [images|img|containers|ctn|volumes|vol|all] [-f|--force|-d|--dry]
  13. Remove dangling images, volumes or exited containers
  14. The --dry options shows the entities that would be removed by a cleanup
  15. [env|unenv] [machine_name]
  16. Get fish-compatible environment for specified Docker Machine
  17. Alias for `docker-machine env --shell fish [-u|machine_name]`
  18. [mstart|mtstop|mrestart] [machine_name]
  19. Easily manage your Docker Machine
  20. Alias for `docker-machine [start|stop|restart] [machine_name]`
  21. status [machine_name]
  22. Get Status of specified Docker Machine
  23. Alias for `docker-machine status [machine_name]`
  24. ip [machine_name]
  25. Get IP of specified Docker Machine
  26. Alias for `docker-machine inspect -f "{{ .Driver.IPAddress }}" [machine_name]`
  27. help
  28. Print this help
  29. docker_subcommand [args...]
  30. All other subcommand are passed to docker
  31. Alias for `docker [docker_subcommand] [args...]`
  32. Notes:
  33. [machine_name] represent the name of a Docker Machine.
  34. When not specified, it is set to "default" to better wrap docker-toolbox.

Installation

  1. # This method allows you to update bd automatically via `fisher update`
  2. fisher install narwhal
  1. # This method allows you to update narwhal by just doing a 'git pull'
  2. git clone https://github.com/0rax/narwhal.git ~/.config/fish/narwhal
  3. mkdir -p ~/.config/fish/functions/ ~/.config/fish/completions/
  4. ln -s ~/.config/fish/narwhal/functions/{narwhal.fish,__narwhal_*.fish} ~/.config/fish/functions/
  5. ln -s ~/.config/fish/narwhal/completions/narwhal.fish ~/.config/fish/completions/

Using Make

  1. make install # Assumes your fish config directory is '~/.config/fish'

Manual Install

  1. set -l FISH_CONFIG_FOLDER ~/.config/fish/
  2. cp functions/{narwhal.fish,__narwhal_*.fish} $FISH_CONFIG_FOLDER/functions/
  3. cp completions/narwhal.fish $FISH_CONFIG_FOLDER/completions/

Use Narwhal as drop-in wrapper for Docker

Narwhal can be used directly as a drop-in wrapper for Docker, this way you can add alias docker narwhal in your $HOME/.config/fish/config.sh and use narwhal as if you are using docker.

The only thing to take in account is that docker help will now show narwhal help but you will still be able to show docker help via docker --help.

This will allow you to extend the docker command with the different wrappers available in narwhal. As for the autocompletion, narwhal inherit the system docker fish completion and extend it with its own other wrapper.

Note that currently, narwhal machine and narwhal compose does not have complete autocompletion for docker-machine and docker-compose.