hyper-visual
v2.2.1
Published
Frequently Used CLI command now listed in a clickable GUI.
Downloads
51
Maintainers
Readme
hyper-visual
CLI commands from the history and the context now listed in a clickable GUI. A plugin for hyper.
Auto Command Recommendations
As you type recommendation from these place will show up:
~/.bash_history
and~/.zsh_history
√- scripts from nearest
package.json
√ - history in current context WIP
- followed colleague's gist WIP
Install
- Put
hyper-visual
into.hyper.js
's plugin list. - Or run
hyper i hyper-visual
if you have hyper cli installed.
Then you can filter result with typing in terminal, click on any command to execute it.
Config
Then add config if needed, they are all optional. Belows are the default values of configs:
{
config: {
// ...others
visual: {
// is panel default opened
opened: true,
// panel's margin-top
top: '35px',
// panel's margin-bottom
bottom: '1px',
// hotkey to toggle panel (broken)
hotkey: 'Ctrl+G',
// setting of contexts
context: {
// setting for npm scripts
node: {
// choose npm or yarn
tool: 'npm',
},
}
}
}
}
Changing margin-bottom makes hyper-visual works better with other plugins likes hyper-search:
Context
Some command will only be used in specific circumstance.
Say you have a folder like this:
.(my-docker-project)
├── CHANGELOG.md
├── backend
│ └── Dockerfile
├── docker-compose.yml
└── frontend
└── Dockerfile
Then you will frequently type docker-compose rm -f && docker-compose pull && docker-compose up --build -d
in ./my-docker-project
. But you won't type it in ./my-docker-project/frontend
, where you will frequently type yarn start
.
This is folder path based context, another possible context is git context. If you are inside a folder with ./.git
, then git related command that you used before will come into recommendation.
And sure there are some command that you will use globally, likes ssh some-server
. They are not belong to any local context.
Existing task runner
Task runner like yarn
is depended on some config file likes package.json
. If current folder contains any of those config file, tasks inside will come into recommendation.
Folder with those config file is a kind of context.
SSH to a server (WIP)
It maybe tricky to read userHome/.bash_profile
on the server you ssh to. So we regard remote server as another global context.
Upload sharable context (WIP)
You may have collect tons of context for different situation. If you want, you can share it with your colleague! So just after your colleague handing his project to you, you get to know how to get his project run immediately.
Publish (WIP)
Local context knowledge resides in ~/.hyper-visual.json
.
You can publish it to a github gist for a backup. You can also select your favorite parts and publish them separately, so others will subscript some of them as needed.
Subscript (WIP)
If you want to adopt others context file, just add its gist address to .hyper.js
:
{
config: {
// ...others
visual: {
...
gists: ['some gist id']
}
}
}
Hotkey (WIP)
Quickly select suggestion by pushing number keys.
Reference
This project is heavily inspired by hyper-history's implementation and autoJump's concept. And I found that xiki hub have a similar vision.
And I also read code from these projects: