ls Xtended : A command line utility which lets you navigate through terminal like a pro 😎.

Overview


lsx

Navigate through terminal like a pro 😎

license codebeat badge go report card

πŸ’» Demo β€’ βš—οΈ Installation β€’ 🐜 Contribution β€’ ❗ Known Issues

❓ Why?

It's a pain to cd and ls multiple times to reach desired directory in terminal. ls-Xtended (lsx) solves this problem by allowing users to smoothly navigate and search directories on the go with just one command. It also allows to create alias for paths making it easier for users to remember the path to the desired directory.

πŸ’» Demo

Note: once you reach the desired destination, use ctr+c to exit and stay in the desired destination

Navigate through terminal and perform search:

  • use / to trigger search and start typing to search
lsx

lsx

Show hidden files as well

lsx -a

lsx

Set alias for directory paths

lsx set-alias -n somealias -p path/to/be/aliased

or

lsx set-alias --path-name somealias --path path/to/be/aliased

lsx

Updating Alias

set-alias can also be used to update any existing alias. Let's say alias abc already exists for path a/b/c. on can update it like so:

lsx set-alias -n abc -p d/e/f

List alias created by user

lsx alias

lsx

Remove existing alias

lsx remove-alias aliasname

lsx

πŸ“‹ Todo

  • make a logo
  • add icons
  • -a/--all mode
  • search
  • allow User can navigate to previous directory from the one they started (#1)

βš—οΈ Install

Note: make sure to have Go installed and your GOPATH is added to PATH

Step-1:

Clone the repo:

git clone https://github.com/souvikinator/lsx.git

Step-2:

cd lsx

chmod u+x install.sh

./install.sh

after installation is successful, add the following line at the end of your current running shell resource file (.zhsrc, .bashrc ...)

source ~/.config/lsx/lsx.sh

and restart your terminal. Enjoy!

Note: Feel free to open an issue if any problems faced during installation.

If you liked the project, feel free to drop a star :)

🐜 Contribution

You can improve this project by contributing in following ways:

  • report bugs
  • fix issues
  • request features
  • asking questions (just open an issue)

and any other way if not mentioned here.

❗ Known Issues

As of now the installation process is painful and the reason is a program runs as a child process in a terminal so eveything happens withing that child process. When we change the directory from go program the directory changes for that executable or to be specific "for that child process" and not of the shell. Which is why one needs to source a script in their shell resource file (.zshrc, .bashrc...).

The script contains a bash function as a wrapper around the lsx binary to make the whole cd thing work. This is what is prevent lsx to be distributed using some package manager.

If anyone can comeup with something then feel free to open issue.

Issues
  • zsh: lsx: function definition file not found

    zsh: lsx: function definition file not found

    Hi!

    I'm on a MacBook Pro, running zsh on Catalina.

    Typing lsx gives

    zsh: lsx: function definition file not found

    I'm not a go user, so there might be issues with how it's set up on my machine.

    Thanks!

    bug 
    opened by m-bob 18
  • Fix permissions of config directory

    Fix permissions of config directory

    A directory with file perms 0664 cannot be cd'ed into. Needs the exec bit (+x), so we would normally create the directory with the perms 0755, but we'll use a more secure 0750.

    opened by herbygillot 7
  • Installation failed: open /bin/ls-x: permission denied

    Installation failed: open /bin/ls-x: permission denied

    go: downloading github.com/gookit/color v1.5.0
    go: downloading github.com/manifoldco/promptui v0.8.0
    go: downloading github.com/spf13/cobra v1.2.1
    go: downloading gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
    go: downloading github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
    go: downloading github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a
    go: downloading github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778
    go: downloading github.com/spf13/pflag v1.0.5
    go: downloading github.com/mattn/go-colorable v0.0.9
    go: downloading github.com/mattn/go-isatty v0.0.4
    go: downloading github.com/lunixbochs/vtclean v0.0.0-20180621232353-2d01aacdc34a
    go build github.com/souvikinator/lsx: copying /tmp/go-build2705181617/b001/exe/a.out: open /bin/ls-x: permission denied
    ERROR: build Failure!
    
    opened by walking-octopus 5
  • Remove stack struct, support

    Remove stack struct, support "true" file navigation

    This PR tries to fulfill #1. I removed the stack struct because it wasn't necessary anymore (or at least that i know) and because I didn't see any other references to it. If this was a mistake, please feel free to re-add it back

    opened by itslychee 5
  • fish shell support

    fish shell support

    fish: Unknown command: /home/zeus/go/bin/ls-x ~/.config/fish/functions/lsx.fish (line 15): $LSX ^ in function 'lsx'

    console output when I try to run lsx Sorry for not providing more info but just seem like a simple fish script syntax error I don't know how to write scripts in fish shell. I don't think this issue is on my end I just think fish doesn't use $ the same way bash or zsh do? EDIT: Syntax might change depending on version of fish I am on version 3.3.1-1

    opened by ZeusThundr 4
  • User cannot navigate to previous directory from the one they started

    User cannot navigate to previous directory from the one they started

    As of now if user starts from ~/abc then they can navigate forward in this path (~/abc/def/....), they can also navigate backward but only till point ~/abc after which user cannot go to the previous path of ~/abc.

    bug hacktoberfest 
    opened by souvikinator 4
  • Would love to have alias for file paths

    Would love to have alias for file paths

    One use case I particularly like is saving an alias in .bashrc to jump to the desired path of my choice I believe that is the fastest. For example, I save alias project="cd /home/skd/Documents/project" and then in terminal I write project and voila I am in that directory. Now the issues I have is to update these alias I have to open my .bashrc file and update it, same for viewing all the aliases I have made.

    Now It would be awesome if I have a way to have CRUD operations on them from the terminal itself. Also extending the functionality when I save a directory in alias it maps all the subdirectories so now, I can run project>testserver so something like this.

    enhancement 
    opened by Souvikns 3
  • ability to set file browsing to use the entire terminal window

    ability to set file browsing to use the entire terminal window

    Thanks for the great program ! It would be neat if there would be an option to use the entire terminal window for browsing or just make this default. Maybe I am overlooking something but it seems to be wasting terminal space by using only the upper part. Just a thought :)

    enhancement 
    opened by ThorCrowley 2
  • New logo

    New logo

    Added a new logo, gives off a gamer/power-user kind of vibe according to me. It's in SVG.

    I did not change the README.md file I could add the SVG here, but I think it would be far easier to just download it and see for yourself 😁

    opened by PK-cod3ch3mist 2
  • Add to homebrew and snapcraft (discuss the approach)

    Add to homebrew and snapcraft (discuss the approach)

    Allow users to install lsx using homebrew in macos. Interested can start a thread so that I can explain how and why the whole installation process works which is very important to understand before packaging it to homebrew.

    enhancement help wanted 
    opened by souvikinator 0
  • failed install

    failed install

    $ curl https://raw.githubusercontent.com/souvikinator/lsx/master/install.sh | bash
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     100  1980  100  1980    0     0   2379      0 --:--:-- --:--:-- --:--:--  2379
    Downloading required scripts...
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--       0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     100   528  100   528    0     0    932      0 --:--:-- --:--:-- --:--:--   932
    can't load package: package github.com/souvikinator/[email protected]: cannot find package "github.com/souvikinator/[email protected]" in any of:
    	/usr/lib/go-1.10/src/github.com/souvikinator/[email protected] (from $GOROOT)
    	/home/shared/applications/go/src/github.com/souvikinator/[email protected] (from $GOPATH)
    ERROR: Installation failed!
    

    Maybe I found the problem but not sure. I see in install.sh:

    ZSHRC="$HOME/.zshrc"
    ZSH_DIR="$HOME/.oh-my-zsh"
    ZSH_FUNC_DIR="$ZSH_DIR/functions"
    

    I don't keep my .zshrc or .oh-my-zsh in those locations; I keep them in a subdirectory of ~. I tried downloading the install.sh, hardcoding the first 2 variable and running it but got the same result so maybe it's not the point of failure.

    I see that the file ~/.config/lsx/lsx.sh is present but beyond that I can't follow what is supposed to be happening so not sure what's the problem.

    By the way I am not sure if this is helpful but as to the zsh files, the way I changed it from default is by setting the $ZDOTDIR environment variable in .zshenv. (Info on SE) As far as I found (I didn't look too hard) it wasn't possible to actually charge the name of the .zshrc file, which I would have preferred because it's sort of stupid to have a hidden file in a hidden directory. If that were possible and someone had done it then the below wouldn't work.

    At the top of the $ZDOTDIR/.zshrc file, the oh my zsh installer added:

    export ZSH="$ZDOTDIR/.oh-my-zsh"
    

    So as per the above if I was writing this I would probably use:

    ZSHRC="$ZDOTDIR/.zshrc"
    ZSH_DIR="$ZSH"
    

    but you should definitely check that with someone who knows what of they speak.

    opened by CouldBeThis 1
Releases(v0.1.9)
  • v0.1.9(Feb 9, 2022)

  • v0.1.8(Jan 9, 2022)

    What's Changed

    • Improved the installation process (Install without cloning the repository)
    • Updated README with the new installation process
    Source code(tar.gz)
    Source code(zip)
  • v0.1.7(Dec 11, 2021)

    What's Changed

    • Fix permissions of config directory by @herbygillot in https://github.com/souvikinator/lsx/pull/22

    New Contributors

    • @herbygillot made their first contribution in https://github.com/souvikinator/lsx/pull/22

    Full Changelog: https://github.com/souvikinator/lsx/compare/v0.1.6...v0.1.7

    Source code(tar.gz)
    Source code(zip)
  • v0.1.6(Dec 3, 2021)

  • v0.1.5(Nov 22, 2021)

    Changelog:

    • Now the directories get ranked based on the frequency and recency of their access, making it easier to navigate.
    • Removed bottom help menu
    • Directory count is shown along with current path
    Source code(tar.gz)
    Source code(zip)
  • v0.1.4(Nov 2, 2021)

    Changelog:

    • Changed $HOME/go/bin to $GOPATH/bin
    • Added support for fish shell
    • For ZSH, replaced source ~/.config/lsx/lsx.sh with autoload -Uz lsx.
    • Auto add source ~/.config/lsx/lsx.sh and autoload -Uz lsx to respective shell files during installation.

    Contributors: @Yeraze @Croissong

    Source code(tar.gz)
    Source code(zip)
  • v0.1.3(Oct 29, 2021)

    New Feature

    • user can now set aliases for different paths, making it easier to remember paths (#11)
    • set, remove and update functionality on alias
    • Colored output

    Misc

    • README updated with new demo gifs

    Contributor: @uzair-ali10 (fixed alias bug)

    Source code(tar.gz)
    Source code(zip)
  • v0.1.2(Oct 26, 2021)

  • v0.1.1(Oct 24, 2021)

Owner
Souvik
β€’//Ο‰//β€’
Souvik
A simple tool which you can use to move through your directories from the command line

Fe What is Fe ? Fe is a simple tool which you can use to move through your direc

Pranav Baburaj 8 Jan 1, 2022
yq lets you read YAML files easily on the terminal. You can find key/values easily

yq yq lets you read YAML files easily on the terminal. You can find key/values easily. Motivation Reading yaml configurations for k8s file becomes ard

Farhan 3 Nov 2, 2021
A command line tool that builds and (re)starts your web application everytime you save a Go or template fileA command line tool that builds and (re)starts your web application everytime you save a Go or template file

# Fresh Fresh is a command line tool that builds and (re)starts your web application everytime you save a Go or template file. If the web framework yo

null 0 Nov 22, 2021
A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a proxy.

Fake-SMS A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a pr

Narasimha Prasanna HN 692 Jun 30, 2022
🦜 Navigate github repos in a tui

goh Navigate github repos in a tui Why I am constantly refering to my github repos and repos from others for code snippets that are relevant to what I

Taylor Gamache 11 Dec 10, 2021
Hosty is a command-line utility that allows for fast inspection and editing of /etc/hosts-like files

Hosty Description Hosty is a command-line utility that allows for fast inspection and editing of /etc/hosts-like files. It is written in golang and us

null 11 Sep 3, 2021
a python command-line tool which draws basic graphs in the terminal

Termgraph A command-line tool that draws basic graphs in the terminal, written in Python. Graph types supported: Bar Graphs Color charts Multi-variabl

Marcus Kazmierczak 2.8k Jun 22, 2022
You-Get is a tiny command-line utility to download media contents (videos, audios, images) from the Web,

You-Get NOTICE: Read this if you are looking for the conventional "Issues" tab. You-Get is a tiny command-line utility to download media contents (vid

Mort Yao 44.3k Jun 26, 2022
The sntr command-line program gives you convenient access to Sentry directly from your terminal.

sntr: all of Sentry at your fingertips The sntr command-line program gives you convenient access to Sentry directly from your terminal. Disclaimer: th

Rodolfo Carvalho 0 Jan 31, 2022
Hasura-fzf - This command has a fzf-like UI that allows you to find and run the file version used by the hasura command

hasura-fzf This command has a fzf-like UI that allows you to find and run the fi

Shoki Hata 4 Jun 6, 2022
A command-line interface for the Riak database through its HTTP API

Riakg Description Is a development oriented command line tool that enables navigation on buckets, keys and values of a Riak KV data store using it's H

cristian 4 May 10, 2022
Vfkit - Simple command line tool to start VMs through virtualization framework

vfkit - Simple command line tool to start VMs through virtualization framework v

Christophe Fergeau 0 Feb 21, 2022
A fork of k3sup that lets you quickly deploy RKE2 clusters via the CLI.

k2sup This is an awful hack of a fork of Alex Ellis' k3sup - a light-weight utility to get from zero to KUBECONFIG, originally with K3s but now with R

Nick Jones 9 Apr 12, 2022
I like reading news but I also like the terminal. I am leaning and practicing my go.

I made an api and didn't know how to use it. Screenshots The initial screen when you first run the app. The screen after you specify an id. This app u

Daniel M. Matongo 2 Jan 14, 2022
An open-source GitLab command line tool bringing GitLab's cool features to your command line

GLab is an open source GitLab CLI tool bringing GitLab to your terminal next to where you are already working with git and your code without switching

Clement Sam 2k Jun 25, 2022
A command line tool to prompt for a value to be included in another command line.

readval is a command line tool which is designed for one specific purposeβ€”to prompt for a value to be included in another command line. readval prints

Venky 0 Dec 22, 2021
πŸ“· Command-line utility to download all photos from Instagram

Instagram Downloader This is a simple command-line tool, written in Go, to download all images from an Instagram account. Getting Started Install inst

Gregory Schier 21 May 31, 2022
A command line utility for generating language-specific project structure.

hydra hydra is a command line utility for generating language-specific project structures. ⏬ ✨ Features Build project templates with just one command

Shravan 18 Oct 8, 2021
A small utility command line application that can recursively download Notion pages

notionbackup A small utility command line application that can recursively download Notion pages. I needed something scriptable that could periodicall

Shayan 50 Jun 4, 2022