Skip to content

kenji0x02/pecorian

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pecorian

Pecorian Logo

Shell script tool to use peco without keymap or alias. For all peco lovers.

Demo

Many commands can be generated simply by selecting three items(scope, target, and action) via peco.

For example, you can change directory to a git repository using ghq.

Demo: git repository

Other example, you can select a process via peco and kill it.

process.gif

You can also use docker command (ex.docker top) to docker container

docker.gif

i.e. if you select scope, target, and action via peco according to your purpose, then the command is generated automaically. The scenario is predefined by the shell script in pecorian.d/*.sh.

Example

Purpose Scope Target Action Command ex.
cd after selecting repository via ghq Git repository(ghq) repository cd cd repository
kill running process Process PID kill kill PID
show top on a docker container Docker a container container top docker top ID
show log on docker-compose Docker containers/images container managed by Compose logs docker-compose logs -tf
select file and vi Current dir file vi vi file

Many other commands can be created.

Other Features

  • Support bash and zsh
  • Multi platform for some commands
  • Special keymap is defined for frequently used scenario
    • Ctrl + r : search history
    • Ctrl + h : search change directory
  • Item list is depends on the context. For example, if docker is not installed, docker scope is not shown in the list.

Install

  • Install peco. apt install peco
  • Copy .pecorian.sh to any directory.
  • Run source command. For example. source ~/.pecorian.sh

Install(old)

bash

$ go get github.com/kenji0x02/pecorian
$ echo 'source $GOPATH/src/github.com/kenji0x02/pecorian/.bashrc.pecorian' >> ~/.bashrc

zsh

$ go get github.com/kenji0x02/pecorian
$ echo 'source $GOPATH/src/github.com/kenji0x02/pecorian/.zshrc.pecorian' >> ~/.zshrc

After installation, Ctrl + j to start pecorian.

Requirements

  • peco>=0.4.8

Todo

  • Error handling when docker is not installed in WSL2
  • Add operations to Git repository

Licence

MIT

Author

kenji0x02

About

For all `peco` lovers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages