lsp is like ls command but more human-friendly

Overview

lsp: list files in a mildly human-frendlier manner

Build Status

lsp lists files, like ls command, but it does not attempt to meet that archaic POSIX specification, so instead of this:

(bash)$ ls -l

total 16
-rw-r--r--  1 peterborzov  staff  1079  9 Aug 00:22 LICENSE
-rw-r--r--  1 peterborzov  staff    60  9 Aug 00:22 README.md

you get this: screenshot

Features

File Groups

Files grouped by type (with -l key or in modes when file type not shown). lsp distinguishes binary, text and executable files, symlinks and is aware of weird types like devices and unix socket thingy: lsp can show files grouped by type

Modification time in human-friendly format

-t key for when you are interested in modification time. It turns to the mode that makes most sense to me when I want to look up modtimes, sorted within file groups from recent to latest: Sometimes relative times are not very readible as well (like when you are interested in a specific date), use two flags -sl to show the full UTC timestamp in properties.

Size in human-friendly format

-s key, similarly to modtime key, shows file sizes and sorts within file groups from largest to smallest:

Async Timeout

The file information is collected asynchronously, BFS-like, with a separate thread for each file and a timeout threshold.

That means that the execution is not going to freeze because of some low-response device driver (like external hard drive or optical drive) or collecting info about a huge directory.

Align by left

I have been playing with aligning files and descriptions by center, and I like that you can see files with the same extension right away, but there are deifinitely cases when it gets weird. For now, there is -p key to render the file table in the left-aligned columns:

Todo before v1.0

  • Rewrite outline formatting: with the current design too much space is wasted, long filenames break things
  • Mark executable files as such
  • Think about how to represent file rights and ownership
  • Approach hidden and generated files as outlined in issue#3
  • Better test coverage
  • Expand in this README on philosophy of the project (tool in the unix way, minimize surprises, nothing's to be configurable)
  • Think of TODO list points

Github Issues and pull requests are very welcome, feel free to message me if you are considering contributing. See CONTRIBUTING.md for intro to the codebase

Installation

lsp is written in the go programming language. It can be installed using go get.

 $ go get github.com/dborzov/lsp

Then make sure that your $PATH includes the $GOPATH/bin directory. To do that, you can put this line your ~/.bash_profile or .zshrc:

export PATH=$PATH:$GOPATH/bin

Once it becomes more functional, lsp will be distributed in native binaries (without dependencies) for all platforms (Linux, MacOS, Windows).

Misc

MIT license.

Issues
  • Ellisons don't play nice with column alignment

    Ellisons don't play nice with column alignment

    For example all rows with the [...] substituted in have slightly incorrect offsets for the following columns, for example the "Digital Marketing Executive - Ar..." entry below.

    dogecoin-logo.png                                                                             Binary File
    Digital Marketing Executive - Ar[...]                                   Binary File
    final.gif                                                                                     Binary File
    

    Output is from a 55x186 gnome terminal session.

    opened by BAXTER001 5
  • Need to link file after install

    Need to link file after install

    Hi, following your instructions results in lsp being installed in your $GOPATH directory, but it doesn't actually link it

    I had to

    sudo ln /usr/local/go/bin/lsp /usr/bin/lsp
    

    to use it as advertised.

    opened by sg-s 2
  • Some text is invisible in my terminal

    Some text is invisible in my terminal

    I seem to have some weird issue where some of my text is invisible when I run the lsp command. I'm using the solarized color scheme with zsh on arch linux.

    Here is an example picture: Example

    opened by tmuntaner 1
  • Usage information

    Usage information

    Using lsp would be much easier with a "usage" option, which would print out an explanation of the various flags and what they do. Perhaps a --help or --usage flag?

    opened by perimosocordiae 1
  • install from master

    install from master

    Was quite confused when I installed via go get github.com/dborzov and it looked nothing like the README.

    Using master may get more users to give it a try off the bat.

    cheers!

    opened by jonaustin 0
  • Don't print headings for empty sections

    Don't print headings for empty sections

    For example, in the LSP repo, using lsp -l results in

    lsp ➤ lsp -l
    -------------------------------------------------------------------------------
    
                                    --Regular files--
    
                                      --Text Files--
                               .travis.yml  
                                .gitignore  
                              arguments.go  
                         arguments_test.go  
                           CONTRIBUTING.md  
                                    fmt.go  
                               fileinfo.go  
                               filelist.go  
                            investigate.go  
                                   LICENSE  
                                   main.go  
                                  paths.go  
                                 README.md  
                                   sort.go  
                                tty_win.go  
                               traverse.go  
                                   trie.go  
                               tty_unix.go  
                                  utils.go  
    -------------------------------------------------------------------------------
    lsp "~/Dropbox/workspace/pulls/lsp", 20 files, 0 directories
     git repo (remote at https://github.com/siddharthist/lsp.git)
    

    Where there are no 'regular files'. Therefore, there is no reason to print 'regular files'. Strangely, this behavior doesn't apply to the executable files heading.

    opened by langston-barrett 0
  • Create --help flag

    Create --help flag

    LSP doesn't support either --help or --usage flags. This is a barrier to usability. Suggestion: for good command line flags using Go, I've used this package.

    opened by langston-barrett 2
  • panic: runtime error: invalid memory address or nil pointer dereference

    panic: runtime error: invalid memory address or nil pointer dereference

    Hello, I've installed lsp using go get github.com/dborzov/lsp and when I tried to run lsp in any directory I've got error like this:

    ➜  empty  ls -a
    .  ..
    ➜  empty  lsp
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal 0xb code=0x1 addr=0x40 pc=0x403362]
    
    goroutine 1 [running]:
    runtime.panic(0x4fd180, 0x6502e8)
            /usr/lib/golang/src/pkg/runtime/panic.c:266 +0xb6
    main.presentPath(0xc21004c640, 0x11, 0xc21004c820, 0x1b)
            /home/xaxes/.go/src/github.com/dborzov/lsp/paths.go:11 +0x32
    main.renderSummary()
            /home/xaxes/.go/src/github.com/dborzov/lsp/render.go:20 +0x7b
    main.render()
            /home/xaxes/.go/src/github.com/dborzov/lsp/render.go:15 +0x24
    main.main()
            /home/xaxes/.go/src/github.com/dborzov/lsp/main.go:23 +0x245
    
    goroutine 3 [sleep]:
    time.Sleep(0xbebc200)
            /usr/lib/golang/src/pkg/runtime/time.goc:31 +0x31
    main.func·002()
            /home/xaxes/.go/src/github.com/dborzov/lsp/utils.go:10 +0x26
    created by main.setTimeoutTimer
            /home/xaxes/.go/src/github.com/dborzov/lsp/utils.go:12 +0x21
    

    I'm using Fedora 20 and FS is XFS if it does matter

    opened by xaxes 4
Releases(v0.1)
Owner
Dmitry Borzov
is actually a potato
Dmitry Borzov
Command line tool for time tracking in a human-readable file format.

klog klog is a plain-text file format and a command line tool for time tracking. ?? Documentation – Learn how to use klog ?? Download – Get the latest

Jan Heuermann 346 May 7, 2022
A command line utility that automagically replaces UNIX timestamps with human interpretable timestamps.

Unfy unfy is a command line utility that automagically identifies and translated UNIX timestamps (since epoch) to human readable timestamps. Example B

Jens Rantil 39 Jan 15, 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
CLI tool (hcron) and Go library (cron) to convert CRON expression into human readable description.

cron cron is a Go library that parses a cron expression and outputs a human readable description of the cron schedule. For example, given the expressi

Quy Le 70 May 13, 2022
Clirunner - Package clirunner runs a legacy shell-style CLI as if a human were running it.

clirunner Package clirunner runs a legacy shell-style command-line interpreter (CLI) as if a human were running it. A shell-style CLI offers a prompt

Jeff Regan 0 Jan 4, 2022
💾 A visual du(1) alternative for human beings

dux A disk usage analyzer. Like du(1), but displays the results as an interactive treemap. testdata 111B (8 files) (4) ┌testdata/ 111B────────────

Jens Green Olander 1 Jan 15, 2022
🚀 goprobe is a promising command line tool for inspecting URLs with modern and user-friendly way.

goprobe Build go build -o ./bin/goprobe Example > goprobe https://github.com/gaitr/goprobe > cat links.txt | goprobe > echo "https://github.com/gaitr/

null 3 Oct 24, 2021
🎭👄 Like cowsay but it's random anime quote

?? ?? weebsay - cowsay but it's random anime quote ?? aesthetics inspired by TorchedSammy follow him he is a good guy Installation ?? go get -u github

Ilya Revenko 85 Apr 24, 2022
car is like tar, but for containers!

Mainly, car lets you list or extract files from an OCI (possibly Docker) image, regardless of the platform it was built for. For example, you can extract files from a windows/amd64 image even if you are running linux/arm64.

Tetrate Labs 21 May 10, 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 3 Apr 29, 2022
Flag is a simple but powerful command line option parsing library for Go support infinite level subcommand

Flag Flag is a simple but powerful commandline flag parsing library for Go. Documentation Documentation can be found at Godoc Supported features bool

null 120 Apr 1, 2022
Query, update and convert data structures from the command line. Comparable to jq/yq but supports JSON, TOML, YAML, XML and CSV with zero runtime dependencies.

dasel Dasel (short for data-selector) allows you to query and modify data structures using selector strings. Comparable to jq / yq, but supports JSON,

Tom Wright 3.2k May 17, 2022
Buildkite-cli - Command line tool for interacting with Buildkite pipelines, builds, and more

Buildkite CLI Command line tool for interacting with Buildkite pipelines, builds

Mark Skelton 1 Jan 7, 2022
Bk - Command line tool for interacting with Buildkite pipelines, builds, and more

Buildkite CLI Command line tool for interacting with Buildkite pipelines, builds

Mark Skelton 1 Jan 7, 2022
Bofin - A command line tool that can be used by to make Weblink development more productive

Bofin A command line tool that can be used by to make Weblink development more p

Gavin Bannerman 0 Jan 13, 2022
vgrep - a user-friendly pager for grep

vgrep is a pager for grep, git-grep, ripgrep and similar grep implementations, and allows for opening the indexed file locations in a user-specified e

Valentin Rothberg 568 May 9, 2022
Zenstring - Randomly generated, friendly & zen strings for your app

zenstring Randomly generated, friendly & zen strings for your app. Started as a

Ciprian 1 Feb 3, 2022
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 661 May 18, 2022
Modern ls command with vscode like File Icon and Git Integrations. Written in Golang

logo-ls modern ls command with beautiful Icons and Git Integrations . Written in Golang Command and Arguments supported are listed in HELP.md Table of

Yash Handa 865 May 10, 2022