2.2.1 • Published 4 years ago

hyper-visual v2.2.1

Weekly downloads
89
License
-
Repository
github
Last release
4 years ago

hyper-visual

CLI commands from the history and the context now listed in a clickable GUI. A plugin for hyper.

Auto Command Recommendations

screenshot

As you type recommendation from these place will show up:

  1. ~/.bash_history and ~/.zsh_history
  2. scripts from nearest package.json
  3. history in current context WIP
  4. 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:

work-with-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:

2.2.1

4 years ago

2.2.0

4 years ago

2.1.11

5 years ago

2.1.10

5 years ago

2.1.9

6 years ago

2.1.8

6 years ago

2.1.7

6 years ago

2.1.5

6 years ago

2.1.4

6 years ago

2.1.3

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.11

6 years ago

2.0.10

6 years ago

2.0.9

6 years ago

2.0.8

6 years ago

2.0.7

6 years ago

2.0.6

6 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago