https://github.com/nathanielfernandes/lingo
Lingo is a CLI tool for counting lines of code in a workspace.
https://github.com/nathanielfernandes/lingo
charm cli golang tokei
Last synced: 5 months ago
JSON representation
Lingo is a CLI tool for counting lines of code in a workspace.
- Host: GitHub
- URL: https://github.com/nathanielfernandes/lingo
- Owner: nathanielfernandes
- License: mit
- Created: 2022-02-23T01:04:53.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-04-15T21:55:10.000Z (about 4 years ago)
- Last Synced: 2024-06-20T11:59:39.597Z (almost 2 years ago)
- Topics: charm, cli, golang, tokei
- Language: Go
- Homepage:
- Size: 626 KB
- Stars: 44
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# _Lingo_
## 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](#screenshots)
Lingo supports almost every programming language, if it's missing one feel free to make an `issue`
## Usage
### CLI
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.
```
USAGE:
lingo [FLAGS]
FLAGS:
-h, --help Print help information
-n, --nogitignore Ignores any .gitignore files
```
### API
```go
import "github.com/nathanielfernandes/lingo/lingo"
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
langs.CountLines()
// The lines are counted on goroutines. This wait, waits
// for all the goroutines to complete
langs.Wait()
// if you just need the line count right away you can use
langs.CountLinesNow()
// This counts the lines and waits for the goroutines to
// complete
}
```
## Screenshots
> all screenshots taken were of [iterm](https://iterm2.com/)

I used [bubbletea](https://github.com/charmbracelet/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`
## Author
Nathaniel Fernandes nathaniel.s.fernandes@gmail.com
This project was inspired by [tokei](https://github.com/XAMPPRocky/tokei)