Git Product home page Git Product logo

open's Introduction

Open

open url in browser.

image

$ open alias ls | fzf --preview 'open alias info {}' --bind 'enter:execute(open alias run {})'

Installation

go install github.com/fzdwx/open@latest 

about auth

  1. use gh cli: gh auth login
  2. or export GH_TOKEN=xxx

use case

available commands:

## Commands
alias [subcommand]                  | Manage custom aliases                                     
completion                          | Generate the autocompletion script for the specified shell
gh [search keyword] | [subcommand]  | open github repo in browser                                  
help [command]                      | Help about any command                                    
history                             | Show open history                                         
log                                 | Show open log                                             
url                                 | open the specified url

open url

open the specified url

$ open https://www.bilibili.com/
$ open url https://www.bilibili.com/
$ open /root/

open alias

User can add alias for url.

## add
$ open alias add https://fzdwx.github.io/ --name blog
$ open alias add https://google.com/search?q=%s --name google

## delete
$ open alias remove blog

## list
$ open alias list

## run
$ open google "hello world"

open gh

open github repo in browser

## Examples
$ open gh        -> open https://github.com
$ open gh .      -> open current dir in github
$ open gh fzdwx  -> open https://github.com/search?q=fzdwx
$ open gh -l java sky -> open https://github.com/search?q=sky&l=java
$ open gh fzdwx -u -> https://github.com/search?q=fzdwx&type=users

## Commands
profile p | open your github profile in browser. eg: https://github.com/fzdwx   
repo    | search github repo. default is interactive

## Flags
-f, --closed      | search issues,pr status is closed             
-c, --commits     | set search type is commits                    
-d, --debug       | show log in console                           
-s, --discussions | set search type is discussions                
-h, --help        | help for gh                                   
-i, --issues      | set search type is issues                     
-l, --lang string | search programming languages. eg: go,java,rust
-m, --marketplace | set search type is marketplace                
-o, --open        | search issues,pr status is open               
-g, --packages    | set search type is packages                   
-p, --pr          | set search type is pull requests              
-r, --repo        | set search type is repositories               
-t, --topics      | set search type is topics                     
-u, --users       | set search type is users                      
-w, --wikis       | set search type is wikis

config (env)

GH_TOKEN=xxx
OPEN_PREVIEW=bat(fallback to cat)

RodeMap

  • history
    • history record
    • history view
  • custom alias
    • add alias
    • delete alias
    • list alias

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.