Giter VIP home page Giter VIP logo

github-tui's Introduction

github-tui

A TUI interface to GitHub.

Warning

github-tui is in pre-alpha stage of development! Expect missing features, surprising behaviour and horrible bugs.

Completion: Done 26%/100% ๐ŸŒ•๐ŸŒ•๐ŸŒ—๐ŸŒ‘๐ŸŒ‘๐ŸŒ‘๐ŸŒ‘๐ŸŒ‘๐ŸŒ‘๐ŸŒ‘

Important

DISCLAIMER: github-tui is developed and maintained in free time voluntarily. The development may continue for decades or may stop tomorrow. You can use GitHub Sponsorship to support the development of this project.

Prerequisites

To use github-tui, you need to have the following installed:

  1. OCaml toolchain: to build the project
  2. bat version โฉพ 0.19.0
  3. Hack Mono Nerd Font

Development

Initialise the project when building for the first time:

opam switch create .

Build the project:

dune build

Run the project:

dune exec bin/main.exe -- owner/repo

Install dev dependencies:

opam install utop ocamlformat ocaml-lsp-server

github-tui's People

Contributors

chshersh avatar nihil2501 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

github-tui's Issues

Add ability to log

Since all the work is done behind the scenes and only TUI is shown, it can be really hard to know what's going on. This issue proposes to add support for optional logging. It can be useful for debugging issues.

Specifically,

  1. Add a CLI flag for an optional path to logs
  2. Add logger to the project to output data in the specified file (only when the file is given)
  3. Add log lines

At this point, I can see the following relevant log lines:

  • Cloning repo
  • Reading file contents
  • Every time bat is called
  • Received events

This should be a good start.

Messy output when trying to show a binary file

The entire layout just goes horribly wrong.

image

Solution:

  1. Check that the file is binary.
  2. Don't call bat if the file is binary (happens here)
    • github-tui/lib/fs/fs.ml

      Lines 32 to 37 in b2c44c1

      let read_file_contents path =
      let cmd =
      "bat --style=numbers,changes --color=always --italic-text=always \
      --paging=never --terminal-width=80 " ^ path
      in
      let contents = Shell.proc_stdout cmd in
  3. Instead, display some standard text saying that the file is binary
  4. Additionally, use the eae8 icon for the file icon when the file is binary
  • image

Open files in $EDITOR

Currently, the file contents are shown in the on-screen UI, supported by bat:

image

Instead, it can be desirable to open them in $EDITOR to edit in place.

Lazy directory contents reading

Currently, when a repository contains too many nested directories, opening it may take a while.

To improve the starting performance, let's make the directory contents reading a lazy operation. To do this, the type of fs needs to be changed:

(** A definition of a file tree. *)
type tree =
| File of string * file_contents lazy_t
| Dir of string * tree array

Directory contents should be tree array Lazy.t instead of tree array.

Configure Nix shell dev environment

It should be possible to configure a Dev env shell with one command (I'm thinking about: https://devenv.sh/) that brings into the scope:

  • Entire required OCaml toolchain
  • All dependencies
  • All dev tools
    • ocamlformat
    • ocaml-lsp
    • utop
  • Required runtime dependencies
    • bat
    • (Optional) Fonts

Do something with .gitignored files

The proposed design:

  • Don't show .gitignored files by default
  • Provide a CLI option --no-gitignore to show the files
  • When shown, highlight them in grey colour

Too many directories don't fit on the screen

A directory may contain too many files, and they might not fit onto the screen. It looks like this:

image

The solution would be to have some sort of scrolling or automatically switch to a fuzzy search view.

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.