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.


Features

  • Easy to use and install.
  • No dependencies or external files are needed — just the binary you can…

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.

Run with Docker

Example: Extracting the version from a package.json file
docker run --rm -i ghcr.io/jqlang/jq:latest < package.json '.version'
Enter fullscreen mode Exit fullscreen mode
Example: Extracting the version from a package.json file with a mounted volume
docker run --rm -i -v "$PWD:$PWD" -w "$PWD" ghcr.io/jqlang/jq:latest '.version' package.json
Enter fullscreen mode Exit fullscreen mode

Building from source

Dependencies

  • libtool
  • make
  • automake
  • autoconf

Instructions

git submodule update --init    # if building from git to get
Enter fullscreen mode Exit fullscreen mode

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:

Warp
Warp, the intelligent terminal
Available on MacOS, Linux, Windows

Graphite
Graphite is the AI developer productivity platform helping
teams on GitHub ship higher quality software, faster

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/--show-all option to show and highlight non-printable characters:

Non-printable character example

Automatic paging

By default, bat pipes its own output to a pager (e.g. less) if the output is too large for one screen If you would rather …

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

Large Language Models (LLM) based AI is useful to ingest command output and format results in Markdown, JSON, and other text based formats. Mods is a tool to add a sprinkle of AI in your command line and make your pipelines artificially intelligent.

It works great with LLMs running locally through LocalAI. You can also use OpenAI, Cohere, Groq, or Azure OpenAI.

Installation

Use a package manager:

# macOS or Linux
brew install charmbracelet/tap/mods

# Windows (with Winget)
winget install charmbracelet.mods

# Arch Linux (btw)
yay -S mods

# Nix
nix-shell -p mods
Enter fullscreen mode Exit fullscreen mode
Debian/Ubuntu
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list
sudo apt update && sudo apt install mods
Enter fullscreen mode Exit fullscreen mode
Fedora/RHEL
echo '[charm]
name=Charm
baseurl=https://repo.charm.sh/yum/
enabled=1
gpgcheck=1
gpgkey=https://repo.charm.sh/yum/gpg.key
Enter fullscreen mode Exit fullscreen mode

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, GitHub Enterprise Cloud, 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

For additional macOS packages and installers, see community-supported docs

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 illustration

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, estimate code complexity similar to cyclomatic complexity calculators and produce unique lines of code or DRYness metrics. 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 Scc count downloads Mentioned in Awesome Go

Licensed under MIT licence.

Table of Contents

scc for Teams & Enterprise

While scc will always be a free and…

dandavison/delta

GitHub logo dandavison / delta

A syntax-highlighting pager for git, diff, grep, and blame 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
    dark = true      # or light = true, or omit for auto-detection

[merge]
    conflictStyle = zdiff3
Enter fullscreen mode Exit fullscreen mode

Or run:

git config --global core.pager delta
git config --global interactive.diffFilter 'delta --color-only'
git config --global delta.navigate true
git config --global merge.conflictStyle zdiff3
Enter fullscreen mode Exit fullscreen mode

Delta has many features and is very customizable; please see delta -h (short help) or delta --help (full manual), or the online 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

nektos/act

GitHub logo nektos / act

Run your GitHub Actions locally 🚀

act-logo

Overview push 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!

Tip

Now Manage and Run Act Directly From VS Code!
Check out the GitHub Local Actions Visual Studio Code extension which allows you to leverage the power of act to run and test workflows locally without leaving your editor.

How Does It Work?

When you…




caarlos0/svu

GitHub logo caarlos0 / svu

semantic version utility

svu Logo

semantic version utility


Release Software License Build status Go Doc GoReportCard Conventional Commits

semantic version utility (svu) is a small helper for release scripts and workflows.

It provides utility commands and functions to increase specific portions of the version It can also figure the next version out automatically by looking through the git history.

Tip

Read the spec for more information.

usage

Check svu --help for the list of sub-commands and flags.

next, n

This is probably the command you'll use the most.

It checks your git log, and automatically increases and returns the new version based on this table:

Commit message Tag increase
chore: foo Nothing
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

Tip

You can create an alias to create tags automatically:

alias gtn='git tag $(svu next)
Enter fullscreen mode Exit fullscreen mode

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.21 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 configuration, integrates with all major IDEs, and includes over a hundred linters.

Install golangci-lint

Documentation

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

Social Networks

Join Slack Follow on Mastodon Follow on Bluesky Follow on Twitter

Support Us

golangci-lint is a free and open-source project built by volunteers.

If you value it, consider supporting us, we appreciate it! ❤️

Golangci-lint Linter Authors

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.

Sponsors

 

The complete IDE crafted for professional Go developers.

Stargazers over time

Stargazers over time






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 Status 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

Table of Contents

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…

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.


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, JSON, CSS and GraphQL that scores 97% compatibility with Prettier.

Biome is a performant linter for JavaScript, TypeScript, JSX, JSON, CSS, and GraphQL that features more than 340 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
Enter fullscreen mode Exit fullscreen mode

Top comments (4)

Collapse
 
matib profile image
Mati B

Nice! I will definitely try out some of them.

Collapse
 
patinthehat profile image
Patrick Organ Permafrost Software

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

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 Permafrost Software

Could you provide links to their repos?