Useful Command-line Tools

PostgreSQL

The following commands might be useful when working with PostgreSQL. Make sure to change the credentials and other parameters if you're not using the defaults from .docker/.env.

Connect to your local instance

PGPASSWORD=permaplant psql -U permaplant -h localhost -d permaplant

Creating a database dump

PGPASSWORD=permaplant pg_dump -U permaplant -h localhost permaplant > database_dump.sql

Loading a database dump

PGPASSWORD=permaplant psql -U permaplant -h localhost -d postgres -c 'DROP DATABASE permaplant;'
PGPASSWORD=permaplant psql -U permaplant -h localhost -d postgres -c 'CREATE DATABASE permaplant;'
PGPASSWORD=permaplant psql -U permaplant -h localhost -d permaplant < database_dump.sql

glab

Documentation
A CLI tool that allows interaction with GitLab via your terminal.

glab needs to be authenticated with our GitLab instance at gitlab.tuwien.ac.at. One way to do this is via a personal access token.

  1. Create a token with at least the api and write_repository scopes in your settings page.
  2. In your command line start the interactive authentication process:
glab auth login --hostname gitlab.tuwien.ac.at
  1. Choose the Token authentication method and provide your token when asked for it. You can leave the default settings for other questions or adjust as needed.

Afterwards you should be ready to use glab. Some basic examples:

# list your open issues
glab issue list -a @me

# list your open MRs
glab mr list -a @me

# list MRs where a review was requested from me
glab mr list -r @me

# list MRs with the label "MRs::please review"
glab mr list -l "MRs::please review"

# checkout a MR by it's number with git
glab mr checkout 1234

# open the current MR in your browser
glab mr view --web

oh-my-zsh

Documentation
A framework for managing your zsh configuration. It includes many themes to customize your prompt and colors as well as plugins to improve shell auto-completion.

Starship

Documentation Starship is a highly customizable command prompt that can be integrated in any shell and be used to display information such as the current path or the git state such as the current branch or status (pull/push available, etc). It automatically detect files and displays information such as which node version that project/folder uses, etc.

zsh-autocomplete

Documentation zsh-autocomplete is a zsh plugin that can be used to complete recently used commands and show you a preview while typing.

zoxide

Documentation zoxide is a smarter cd command. As per the documentation: "It remembers which directories you use most frequently, so you can "jump" to them in just a few keystrokes." There is a video showcase available in the documentation.
It can also be integrated with fzf to enable fuzzy finding with recent paths.

tldr

Documentation
Provides examples for cli commands.

bat

Documentation
A cat replacement with syntax highlighting and Git integration.

fzf

Documentation
A command-line fuzzy finder. For example it can be used to quickly search your local files or your bash history.

ripgrep

Documentation
A modern, much faster replacement for grep which can respect your gitignore file.

uv

Documentation
An extremely fast Python package and project manager. It can be used to install and run tools published as Python packages or run standalone scripts with inline dependencies.

Example:

# use csvcut to remove columns from a csv file
uvx --from=csvkit csvcut spatialRelation/companion.csv -c "Plant 1 (unique name)","Plant 2 (unique name)"

csvkit

Documentation
Contains many tools that make working with CSV files easier in the command line.

lazydocker

Documentation
A simple terminal UI for docker.