Lingo is a CLI tool for counting lines of code in a workspace.

  • By Nathaniel Fernandes
  • Last update: Aug 9, 2022
  • Comments: 1


A fast CLI tool for counting lines of code in a workspace.

Built with speed in mind, lingo can count lines of very large code repositories in under a second. examples

Lingo supports almost every programming language, if it's missing one feel free to make an issue



By default, lingo will count the lines of code in the current directory ..
However, a directory can be passed in.

Additionally lingo does not count .gitignored files, but this can be disabled by passing the -n flag.

    lingo [FLAGS] <directory>

    -h, --help          Print help information
    -n, --nogitignore   Ignores any .gitignore files


import ""

func main() {
    // walks through the directory and returns a map of language names
    // to language objects
    /*  type Language struct {
	        Name  string
	        Files []string
	        Count uint32
	        Color string
    langs := lingo.GetLanguages(".", true)

    // Counts the lines of all the languages found, updating
    // the language objects

    // The lines are counted on goroutines. This wait, waits
    // for all the goroutines to complete

    // if you just need the line count right away you can use
    // This counts the lines and waits for the goroutines to
    // complete


all screenshots taken were of iterm

I used bubbletea to create the clean ui.

In this screenshot lingo was called in a folder with around 50+ projects amounting to 162,761 files and 3,847,173 lines of code. All counted and displayed in approx. 5 seconds


Nathaniel Fernandes [email protected]

This project was inspired by tokei



  • 1

    Missing file extensions

    As per official glsl spec of compiler:

    .mesh for a mesh shader .task for a task shader .rgen for a ray generation shader .rint for a ray intersection shader .rahit for a ray any hit shader .rchit for a ray closest hit shader .rmiss for a ray miss shader .rcall for a general ray callable shader

    Is all missing

    Hlsl misses (for some of the big ones)

    .hs for hull shader

    .ds for domain shader

    .vs for vertex shader

    .ps for pixel shader

    .cs for compute shader

    .gs for geometry shader

    A few others from the shader side of naming behind official spec is missing