New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

huik-module

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

huik-module

Modules for my scripts.

  • 0.1.22
  • PyPI
  • Socket score

Maintainers
1

huik-module

python version Alt text

How to install:

    pip install huik-module

Command Line Interface Usage

Command Line Interface are built with Click.

Use command --help for built in help info.

tool list module tl

Tool list (tl) provide a way to make user defined shortcuts for frequently used shell commands.

  • tl to start tool list.

  • tl --help to show help menu.

  • tl [command key] to quickly invoke saved shell command.

    Hint: Shell commands are ran in a new process, if a command is changing shell behavior this change will not be reflected in the current shell. If user want to retain such behavior, one way to use exec shell or exec zsh at the end of command. (see folder module for example)

folder module fd

Folder (fd) can mark folder as favorites and let user quickly navigate to that folder in terminal.

  • fd [favorite folder shortcut] cd to saved folder.

  • fd -c config use bash or zsh as default shell.

    Under the hood, fd uses python subprocess to run shell script.

    subprocess.run("cd /path/to/folder;exec zsh",shell=True,)
    

    The subprocess start another process and run shell command. Without exec zsh, after the subprocess exits, the current shell will remain in the same folder. exec zsh or exec bash start a shell in the subprocess and allow user input in that process.

OK module ok

OK module let user write / install plugins to extend its function.

OK module also manages to import/export/sync configuration and plugins.

Some included plugins are: Dictionary def; calculator cal; github tools git

One would need to use plugins if simple shell command is not sufficient in certain complex using scenarios. For example, to handle user inputs or pull data from the web.

  • ok or ok --help to show help menu.
  • ok sync to configure Github gist id and user token for upload settings to github. User token is not needed for download public gist settings but required for create/upload settigns.
  • ok [command] to run plugin commands.
  • ok plugins --help to show help menu for configure plugins.
  • ok plugins -sf or --show-folder show plugins folder.
Plugins

Plugins are single python files and stored under cli/plugins folder. These individual files are read and loaded at runtime.

Basic structure:

import click 
# other imports if needed 

@click.command() # optionally use click.group() to allow multicommands.
@click.option('--option') # add other options or arguments if needed.
def cli(option):
    """
    Documents
    """
    # handle option 

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc