DEV Community

Cover image for Essential Command Line Tools for Developers
Patrick Organ for Permafrost Software

Posted on

Essential Command Line Tools for Developers

As a software developer, having a selection of great command line tools at your disposal is essential. Once you've harnessed the power of the command line, you're more productive; you have the tools necessary to quickly complete common tasks.

The following is a list of command line tools I've cultivated over the years in my career as a Software Engineer; most of which I use on a daily basis, and all of which enable me to be highly efficient and productive.

This list only includes projects that provide native binaries - npm packages such as eslint or prettier, while incredibly useful, aren't included.

General Utilities

zyedidia/eget

GitHub logo zyedidia / eget

Easily install prebuilt binaries from GitHub.

Eget: easy pre-built binary installation

Go Report Card Release MIT License

Eget is the best way to easily get pre-built binaries for your favorite tools. It downloads and extracts pre-built binaries from releases on GitHub. To use it, provide a repository and Eget will search through the assets from the latest release in an attempt to find a suitable prebuilt binary for your system. If one is found, the asset will be downloaded and Eget will extract the binary to the current directory. Eget should only be used for installing simple, static prebuilt binaries, where the extracted binary is all that is needed for installation. For more complex installation, you may use the --download-only option, and perform extraction manually.

Eget Demo

For software maintainers, if you provide prebuilt binaries on GitHub, you can list eget as a one-line method for users to install your software.

Eget has a number of detection mechanisms and should work out-of-the-box with most…

zyedidia/micro

GitHub logo zyedidia / micro

A modern and intuitive terminal-based text editor

micro logo

Test Workflow Go Report Card Release MIT License Join the chat at https://gitter.im/zyedidia/micro Snap Status

micro is a terminal-based text editor that aims to be easy to use and intuitive, while also taking advantage of the capabilities of modern terminals. It comes as a single, batteries-included, static binary with no dependencies; you can download and use it right now!

As its name indicates, micro aims to be somewhat of a successor to the nano editor by being easy to install and use It strives to be enjoyable as a full-time editor for people who prefer to work in a terminal, or those who regularly edit files over SSH.

Here is a picture of micro editing its source code.

Screenshot

To see more screenshots of micro, showcasing some of the default color schemes, see here.

You can also check out the website for Micro at https://micro-editor.github.io.

Table of Contents

stedolan/jq

GitHub logo jqlang / jq

Command-line JSON processor

jq

jq is a lightweight and flexible command-line JSON processor akin to sed,awk,grep, and friends for JSON data. It's written in portable C and has zero runtime dependencies, allowing you to easily slice, filter, map, and transform structured data.

Documentation

Installation

Prebuilt Binaries

Download the latest releases from the GitHub release page.

Docker Image

Pull the jq image to start quickly with Docker.

Building from source

Dependencies

  • libtool
  • make
  • automake
  • autoconf

Instructions

git submodule update --init # if building from git to get oniguruma
autoreconf -i               # if building from git
./configure --with-oniguruma=builtin
make -j8
make check
sudo make install
Enter fullscreen mode Exit fullscreen mode

Build a statically linked version:

make LDFLAGS=-all-static
Enter fullscreen mode Exit fullscreen mode

If you're not using the latest git version but instead building a released tarball (available on the release page), skip the autoreconf step, and flex or bison won't…

ggreer/the_silver_searcher (ag)

GitHub logo ggreer / the_silver_searcher

A code-searching tool similar to ack, but faster.

The Silver Searcher

A code searching tool similar to ack, with a focus on speed.

Build Status

Floobits Status

#ag on Freenode

Do you know C? Want to improve ag? I invite you to pair with me.

What's so great about Ag?

  • It is an order of magnitude faster than ack.
  • It ignores file patterns from your .gitignore and .hgignore.
  • If there are files in your source repo you don't want to search, just add their patterns to a .ignore file. (*cough* *.min.js *cough*)
  • The command name is 33% shorter than ack, and all keys are on the home row!

Ag is quite stable now. Most changes are new features, minor bug fixes, or performance improvements. It's much faster than Ack in my benchmarks:

ack test_blah ~/code/  104.66s user 4.82s system 99% cpu 1:50.03 total
ag test_blah ~/code/  4.67s user 4.58s system 286% cpu 3.227 total

Ack and Ag found the same…

chmln/sd

GitHub logo chmln / sd

Intuitive find & replace CLI (sed alternative)

sd - search & displace

sd is an intuitive find & replace CLI.

The Pitch

Why use it over any existing tools?

Painless regular expressions.   sd uses regex syntax that you already know from JavaScript and Python. Forget about dealing with quirks of sed or awk - get productive immediately.

String-literal mode.   Non-regex find & replace. No more backslashes or remembering which characters are special and need to be escaped.

Easy to read, easy to write.   Find & replace expressions are split up, which makes them easy to read and write. No more messing with unclosed and escaped slashes.

Smart, common-sense defaults.   Defaults follow common sense and are tailored for typical daily use.

Comparison to sed

While sed does a whole lot more, sd focuses on doing just one thing and doing it well. Here are some cherry-picked examples where sd shines.

Simpler syntax for replacing all occurrences:

sharkdp/bat

GitHub logo sharkdp / bat

A cat(1) clone with wings.

bat - a cat clone with wings
Build Status license Version info
A cat(1) clone with syntax highlighting and Git integration

Key FeaturesHow To UseInstallationCustomizationProject goals, alternatives
[English] [中文] [日本語] [한국어] [Русский]

Sponsors

A special thank you goes to our biggest sponsors:
WorkOS
Your app, enterprise-ready.
Start selling to enterprise customers with just a few lines of code.
Add Single Sign-On (and more) in minutes instead of months.

Warp
Warp is a modern, Rust-based terminal with AI built in
so you and your team can build great software, faster.

Feel more productive on the command line with parameterized commands,
autosuggestions, and an IDE-like text editor.

Syntax highlighting

bat supports syntax highlighting for a large number of programming and markup languages:

Syntax highlighting example

Git integration

bat communicates with git to show modifications with respect to the index (see left side bar):

Git integration example

Show non-printable characters

You can use the -A/…

charmbracelet/mods

GitHub logo charmbracelet / mods

AI on the command line

Mods!

Mods product art and type treatment
Latest Release Build Status

AI for the command line, built for pipelines.

a GIF of mods running

LLM based AI is really good at interpreting the output of commands and returning the results in CLI friendly text formats like Markdown. Mods is a simple tool that makes it super easy to use AI on the command line and in your pipelines. Mods works with OpenAI and LocalAI

To get started, install Mods and check out some of the examples below. Since Mods has built-in Markdown formatting, you may also want to grab Glow to give the output some pizzazz.

What Can It Do?

Mods works by reading standard in and prefacing it with a prompt supplied in the mods arguments. It sends the input text to an LLM and prints out the result, optionally asking the LLM to format the response as Markdown. This gives you a way to "question" the output of a command. Mods will…

Development

go-task/task

GitHub logo go-task / task

A task runner / simpler Make alternative written in Go

cli/cli

GitHub logo cli / cli

GitHub’s official command line tool

GitHub CLI

gh is GitHub on the command line. It brings pull requests, issues, and other GitHub concepts to the terminal next to where you are already working with git and your code.

screenshot of gh pr status

GitHub CLI is supported for users on GitHub.com and GitHub Enterprise Server 2.20+ with support for macOS, Windows, and Linux.

Documentation

For installation options see below, for usage instructions see the manual.

Contributing

If anything feels off, or if you feel that some functionality is missing, please check out the contributing page. There you will find instructions for sharing your feedback, building the tool locally, and submitting pull requests to the project.

If you are a hubber and are interested in shipping new commands for the CLI, check out our doc on internal contributions.

Installation

macOS

gh is available via Homebrew, MacPorts, Conda, Spack, Webi, and as a…

boyter/scc

GitHub logo boyter / scc

Sloc, Cloc and Code: scc is a very fast accurate code counter with complexity calculations and COCOMO estimates written in pure Go

Sloc Cloc and Code (scc)

scc

A tool similar to cloc, sloccount and tokei. For counting the lines of code, blank lines, comment lines, and physical lines of source code in many programming languages.

Goal is to be the fastest code counter possible, but also perform COCOMO calculation like sloccount and to estimate code complexity similar to cyclomatic complexity calculators. In short one tool to rule them all.

Also it has a very short name which is easy to type scc.

If you don't like sloc cloc and code feel free to use the name Succinct Code Counter.

Go Go Report Card Coverage Status Scc Count Badge Mentioned in Awesome Go

Dual-licensed under MIT or the UNLICENSE.

Install

Go Get

If you are comfortable using Go and have >= 1.17 installed:

go install github.com/boyter/scc/v3@latest

or bleeding edge with

go install github.com/boyter/scc@master

Snap

A snap install exists thanks to Ricardo.

$ sudo snap install scc

NB Snap installed applications cannot run…

dandavison/delta

GitHub logo dandavison / delta

A syntax-highlighting pager for git, diff, and grep output

image

CI Coverage Status Gitter

Get Started

Install it (the package is called "git-delta" in most package managers, but the executable is just delta) and add this to your ~/.gitconfig:

[core]
    pager = delta

[interactive]
    diffFilter = delta --color-only

[delta]
    navigate = true    # use n and N to move between diff sections
    light = false      # set to true if you're in a terminal w/ a light background color (e.g. the default macOS terminal)

[merge]
    conflictstyle = diff3

[diff]
    colorMoved = default
Enter fullscreen mode Exit fullscreen mode

Delta has many features and is very customizable; please see the user manual.

Features

  • Language syntax highlighting with the same syntax-highlighting themes as bat
  • Word-level diff highlighting using a Levenshtein edit inference algorithm
  • Side-by-side view with line-wrapping
  • Line numbering
  • n and N keybindings to move between files in large diffs, and between diffs in log -p views (--navigate

nektos/act

GitHub logo nektos / act

Run your GitHub Actions locally 🚀

act-logo

Overview push Join the chat at https://gitter.im/nektos/act Go Report Card awesome-runners

"Think globally, act locally"

Run your GitHub Actions locally! Why would you want to do this? Two reasons:

  • Fast Feedback - Rather than having to commit/push every time you want to test out the changes you are making to your .github/workflows/ files (or for any changes to embedded GitHub actions), you can use act to run the actions locally. The environment variables and filesystem are all configured to match what GitHub provides.
  • Local Task Runner - I love make. However, I also hate repeating myself. With act, you can use the GitHub Actions defined in your .github/workflows/ to replace your Makefile!

How Does It Work?

When you run act it reads in your GitHub Actions from .github/workflows/ and determines the set of actions that need to be run. It uses the Docker API to either pull or build the necessary images, as defined in your workflow…

caarlos0/svu

GitHub logo caarlos0 / svu

Semantic Version Util

svu

Build Status

Semantic Version Util is a tool to manage semantic versions at ease!

You can print the current version, increase patch/minor/major manually or just get the next tag based on your git log!

example usage

svu

Based on the log between the latest tag and HEAD, prints the next tag.

aliases: svu next and svu n

$ svu
v1.3.0
Enter fullscreen mode Exit fullscreen mode

commit messages vs what they do

Commit message Tag increase
fix: fixed something Patch
feat: added new button to do X Minor
fix: fixed thing xyz

BREAKING CHANGE: this will break users because of blah
Major
fix!: fixed something Major
feat!: added blah Major
chore: foo Nothing

svu current

Prints the current tag with no changes.

alias: svu c

Examples:

$ svu current
v1.2.3
$ svu current
v1.2.3-alpha.1+22
Enter fullscreen mode Exit fullscreen mode

svu major

Increases the major of the latest tag and prints it As per the Semver spec, it'll also clear the pre-release

permafrost-dev/stackup

GitHub logo permafrost-dev / stackup

a single application to spin up your entire dev stack.

logo

StackUp


Spin up your entire dev stack with one command.

StackUp offers many features and advanced functionality. Here are some of the highlights:

  • Define tasks that run on startup, shutdown, or on a schedule.
  • Customize tasks and preconditions using javascript.
  • Run tasks on a cron schedule, i.e. running php artisan schedule:run once every minute.
  • Load remote configurations via http or S3.
  • Fast in-memory cache skips http requests when possible.
  • Http request gateway prevents unwanted access to remote urls, domains and content types.
  • Send notifications with Telegram and Slack integrations.

Table of Contents

google/yamlfmt

GitHub logo google / yamlfmt

An extensible command line tool or library to format yaml files.

yamlfmt

yamlfmt is an extensible command line tool or library to format yaml files.

Goals

  • Create a command line yaml formatting tool that is easy to distribute (single binary)
  • Make it simple to extend with new custom formatters
  • Enable alternative use as a library, providing a foundation for users to create a tool that meets specific needs

Maintainers

This tool is not yet officially supported by Google. It is currently maintained solely by @braydonk, and unless something changes primarily in spare time.

Blog

I'm going to use these links to GitHub Discussions as a blog of sorts, until I can set up something more proper:

  • yamlfmt's recent slow development #149
  • Issues related to the yaml.v3 library #148

Installation

To download the yamlfmt command, you can download the desired binary from releases or install the module directly:

go install github.com/google/yamlfmt/cmd/yamlfmt@latest

This currently requires Go version 1.18 or greater.

NOTE: Recommended setup…

watchexec/watchexec

GitHub logo watchexec / watchexec

Executes commands in response to file modifications

CI status on main branch

Watchexec

Software development often involves running the same commands over and over. Boring!

watchexec is a simple, standalone tool that watches a path and runs a command whenever it detects modifications.

Example use cases:

  • Automatically run unit tests
  • Run linters/syntax checkers
  • Rebuild artifacts

Features

  • Simple invocation and use, does not require a cryptic command line involving xargs
  • Runs on OS X, Linux, and Windows
  • Monitors current directory and all subdirectories for changes
  • Coalesces multiple filesystem events into one, for editors that use swap/backup files during saving
  • Loads .gitignore and .ignore files
  • Uses process groups to keep hold of forking programs
  • Provides the paths that changed in environment variables or STDIN
  • Does not require a language runtime, not tied to any particular language or ecosystem
  • And more!

Quick start

Watch all JavaScript, CSS and HTML files in the current directory and all subdirectories for changes, running npm run build when a…

Linting

golangci/golangci-lint

GitHub logo golangci / golangci-lint

Fast linters Runner for Go

golangci-lint logo

golangci-lint

Fast linters runner for Go


golangci-lint is a fast Go linters runner. It runs linters in parallel, uses caching, supports yaml config, has integrations with all major IDE and has dozens of linters included.

Install golangci-lint

Documentation

Documentation is hosted at https://golangci-lint.run.

Badges

Build Status License Release Docker GitHub Releases Stats of golangci-lint

Contributors

This project exists thanks to all the people who contribute. How to contribute.

Core Team

About core team

The GolangCI Core Team is a group of contributors that have demonstrated a lasting enthusiasm for the project and community The GolangCI Core Team has GitHub admin privileges on the repo.

Responsibilities

The Core Team has the following responsibilities:

  1. Being available to answer high-level questions about vision and future.
  2. Being available to review longstanding/forgotten pull requests.
  3. Occasionally check issues, offer input, and categorize with GitHub issue labels.
  4. Looking out for up-and-coming members of the GolangCI community who…

dotenv-linter/dotenv-linter

GitHub logo dotenv-linter / dotenv-linter

⚡️Lightning-fast linter for .env files. Written in Rust 🦀

dotenv-linter

⚡️Lightning-fast linter for .env files. Written in Rust 🦀

GitHub Actions Coverage Status License Releases

dotenv-linter can check / fix / compare .env files for problems that may cause the application to malfunction.

Available checks:

    ✅ Duplicated key
    ✅ Ending blank line
    ✅ Extra blank line
    ✅ Incorrect delimiter
    ✅ Key without value
    ✅ Leading character
    ✅ Lowercase key
    ✅ Quote character
    ✅ Space character
    ✅ Substitution key
    ✅ Trailing whitespace
    ✅ Unordered key
    ✅ Value without quotes

What is a .env file?

    💡 A .env file or dotenv file is a simple text file containing all the environment variables of a project.
    Storing configuration in the environment variables is one of the tenets of the Manifesto of Twelve-Factor App.
    The .env file has a simple key-value format, for example: FOO=BAR.
    More information you can find in articles in English and Russian

The key features:

    ⚡️ Lightning-fast because it is written…

rhysd/actionlint

GitHub logo rhysd / actionlint

:octocat: Static checker for GitHub Actions workflow files

actionlint

CI Badge API Document

actionlint is a static checker for GitHub Actions workflow files. Try it online!

Features:

  • Syntax check for workflow files to check unexpected or missing keys following workflow syntax
  • Strong type check for ${{ }} expressions to catch several semantic errors like access to not existing property type mismatches, ...
  • Actions usage check to check that inputs at with: and outputs in steps.{id}.outputs are correct
  • Reusable workflow check to check inputs/outputs/secrets of reusable workflows and workflow calls
  • shellcheck and pyflakes integrations for scripts at run:
  • Security checks; script injection by untrusted inputs, hard-coded credentials
  • Other several useful checks; glob syntax validation, dependencies check for needs: runner label validation, cron syntax validation, ...

See the full list of checks done by actionlint.

actionlint reports 7 errors

Example of broken workflow:

on
  push:
    branch: main
    tags:
      - 'v\d+'
jobs:
  test:
    strategy:
      matrix:
        os
Enter fullscreen mode Exit fullscreen mode

hadolint/hadolint

GitHub logo hadolint / hadolint

Dockerfile linter, validate inline bash, written in Haskell

Haskell Dockerfile Linter

Build Status GPL-3 licensed GitHub release GitHub downloads pipecat

A smarter Dockerfile linter that helps you build best practice Docker images. The linter parses the Dockerfile into an AST and performs rules on top of the AST. It stands on the shoulders of ShellCheck to lint the Bash code inside RUN instructions.

🌐 Check the online version on hadolint.github.io/hadolint Screenshot

How to use

You can run hadolint locally to lint your Dockerfile.

hadolint <Dockerfile>
hadolint --ignore DL3003 --ignore DL3006 <Dockerfile> # exclude specific rules
hadolint --trusted-registry my-company.com:500 <Dockerfile> # Warn when using untrusted FROM images
Enter fullscreen mode Exit fullscreen mode

Docker comes to the rescue, providing an easy way how to run hadolint on most platforms Just pipe your Dockerfile to docker run:

docker run --rm -i hadolint/hadolint < Dockerfile
# OR
docker run --rm -i ghcr.io/hadolint/hadolint < Dockerfile
Enter fullscreen mode Exit fullscreen mode

or using Podman:

podman run --rm -i docker.io/hadolint/hadolint < Dockerfile
# OR
podman run --rm
Enter fullscreen mode Exit fullscreen mode

biomejs/biome

GitHub logo biomejs / biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.

Shows the banner of Biome, with its logo and the phrase 'Biome - Toolchain of the web'.

Discord chat CI on main npm version VSCode version Open VSX version

Biome is a performant toolchain for web projects, it aims to provide developer tools to maintain the health of said projects.

Biome is a fast formatter for JavaScript, TypeScript, JSX, and JSON that scores 97% compatibility with Prettier.

Biome is a performant linter for JavaScript, TypeScript, and JSX that features more than 190 rules from ESLint, TypeScript ESLint, and other sources It outputs detailed and contextualized diagnostics that help you to improve your code and become a better programmer!

Biome is designed from the start to be used interactively within an editor It can format and lint malformed code as you are writing it.

Installation

npm install --save-dev --save-exact @biomejs/biome
Enter fullscreen mode Exit fullscreen mode

Usage

# format files
npx @biomejs/biome format --write ./src
# lint files
npx @biomejs/biome lint ./src

# run format, lint, etc. and apply
Enter fullscreen mode Exit fullscreen mode

Top comments (4)

Collapse
 
millsoft profile image
Michael M

I can also highly recommend lazygit and lazydocker. Using these tools every day.

Collapse
 
patinthehat profile image
Patrick Organ

Could you provide links to their repos?

Collapse
 
matib profile image
Mati B

Nice! I will definitely try out some of them.

Collapse
 
patinthehat profile image
Patrick Organ

Thanks! Pro tip: use eget to automate the installation/updating of the binaries in a shell script.