dstll

command module
v0.0.0-...-94e9f1b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 1 Imported by: 0

README

dstll

✨ Overview

dstll (short for "distill") gives you a high level overview of various constructs in your code files.

Usage

Languages supported:

  • go
  • scala 2
  • python
  • more to come

Motivation

Sometimes, you want to quickly understand how a project is organized. It could be a new repo you're working on or a specific part of a project you're unfamiliar with. When given a list of files you're curious about, dstll shows you a list of signatures representing different constructs found in those files, such as classes, functions, objects, etc.

💾 Installation

go:

go install github.com/dhth/dstll@latest

🛠️ Configuration

Create a configuration file that looks like the following. By default, dstll will look for this file at ~/.config/dstll/dstll.yml.

[tui]
view_file_command = ["your", "command"]
# for example, ["bat", "--style", "plain", "--paging", "always"]
# will run 'bat --style plain --paging always <file-path>'

⚡️ Usage

dstll can be run in both CLI and TUI mode. The former is the default.

CLI Mode

In CLI mode, dstll accepts a list of file paths from stdin.

git ls-files | dstll
# or
git ls-files | dstll -plain=true
# or
find . -name '*.go' | dstll
# or
fd . --extension=scala | head -n 4 | dstll
# or
ls -1 | dstll
# or
cat <<EOF | dstll
file1.py
dir/file2.py
EOF

Usage

TUI Mode

In TUI mode, dstll allows you to manually query for constructs with the help of a file browser.

dstll -mode=tui

Usage

Usage

Server Mode

dstll can present its findings via a web server which serves HTML output.

git ls-files | dstll -mode=server

Usage

TODO

  • go
    • Query methods
  • scala
    • Query Objects
  • python
    • Query classes
  • JS
  • TS

Examples

Running dstll in the scala repo gives the following output:

$ git ls-files src/compiler/scala/tools/tasty | head -n 3 | dstll

👉 src/compiler/scala/tools/tasty/AttributeUnpickler.scala

object AttributeUnpickler

def attributes(reader: TastyReader): Attributes

................................................................................

👉 src/compiler/scala/tools/tasty/Attributes.scala

object Attributes

private class ConcreteAttributes(val isJava: Boolean) extends Attributes

................................................................................

👉 src/compiler/scala/tools/tasty/ErasedTypeRef.scala

object ErasedTypeRef

class ErasedTypeRef(qualifiedName: TypeName, arrayDims: Int)

def signature: String

def encode: ErasedTypeRef

def apply(tname: TastyName): ErasedTypeRef

def name(qual: TastyName, tname: SimpleName, isModule: Boolean)

def specialised(qual: TastyName, terminal: String, isModule: Boolean, arrayDims: Int = 0): ErasedTypeRef

................................................................................

More examples can be found here.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
A modded version of https://github.com/charmbracelet/bubbles/blob/master/filepicker/filepicker.go
A modded version of https://github.com/charmbracelet/bubbles/blob/master/filepicker/filepicker.go
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL