{"id":13395474,"url":"https://github.com/XAMPPRocky/tokei","last_synced_at":"2025-03-13T21:31:40.965Z","repository":{"id":32733020,"uuid":"36323226","full_name":"XAMPPRocky/tokei","owner":"XAMPPRocky","description":"Count your code, quickly.","archived":false,"fork":false,"pushed_at":"2024-04-24T17:20:17.000Z","size":2660,"stargazers_count":10019,"open_issues_count":175,"forks_count":483,"subscribers_count":43,"default_branch":"master","last_synced_at":"2024-05-02T00:53:40.472Z","etag":null,"topics":["badge","cli","cloc","code","command-line-tool","linux","macos","rust","sloc","statistics","tokei","windows"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XAMPPRocky.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"XAMPPRocky"}},"created_at":"2015-05-26T20:55:45.000Z","updated_at":"2024-05-06T14:08:16.529Z","dependencies_parsed_at":"2023-02-17T04:45:32.647Z","dependency_job_id":"de4f4c3e-1310-4140-93e1-c1d564804159","html_url":"https://github.com/XAMPPRocky/tokei","commit_stats":{"total_commits":975,"total_committers":270,"mean_commits":3.611111111111111,"dds":0.5138461538461538,"last_synced_commit":"ba11288a2086aa48c1486072e2c3341d257935a2"},"previous_names":["aaronepower/tokei"],"tags_count":68,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XAMPPRocky%2Ftokei","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XAMPPRocky%2Ftokei/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XAMPPRocky%2Ftokei/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XAMPPRocky%2Ftokei/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XAMPPRocky","download_url":"https://codeload.github.com/XAMPPRocky/tokei/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243039681,"owners_count":20226134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["badge","cli","cloc","code","command-line-tool","linux","macos","rust","sloc","statistics","tokei","windows"],"created_at":"2024-07-30T17:02:01.008Z","updated_at":"2025-03-13T21:31:40.954Z","avatar_url":"https://github.com/XAMPPRocky.png","language":"Rust","funding_links":["https://github.com/sponsors/XAMPPRocky"],"categories":["Rust","HarmonyOS","Applications","Command Line","Development","应用程序 Applications","By Language","Command Line Apps","应用 Applications","语言资源库","Rust 程序设计","Tools","Dev-Utilities","应用","\u003ca name=\"programming\"\u003e\u003c/a\u003eProgramming","Code Counting","Tool","Code","\\*nix/\\*nux","Command line - Linux"],"sub_categories":["Windows Manager","System tools","Dependency Management","Programming","系统工具 System tools","Rust","Other","rust","网络服务_其他","系统工具","TUI Tool","Cloc","Developer","Learning resources"],"readme":"# Tokei ([時計](https://en.wiktionary.org/wiki/%E6%99%82%E8%A8%88))\n[![Mean Bean CI](https://github.com/XAMPPRocky/tokei/workflows/Mean%20Bean%20CI/badge.svg)](https://github.com/XAMPPRocky/tokei/actions?query=workflow%3A%22Mean+Bean+CI%22)\n[![Help Wanted](https://img.shields.io/github/issues/XAMPPRocky/tokei/help%20wanted?color=green)](https://github.com/XAMPPRocky/tokei/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)\n[![Lines Of Code](https://tokei.rs/b1/github/XAMPPRocky/tokei?category=code)](https://github.com/XAMPPRocky/tokei)\n[![Documentation](https://docs.rs/tokei/badge.svg)](https://docs.rs/tokei/)\n![](https://img.shields.io/crates/d/tokei?label=downloads%20%28crates.io%29)\n![](https://img.shields.io/github/downloads/xampprocky/tokei/total?label=downloads%20%28GH%29)\n![](https://img.shields.io/homebrew/installs/dy/tokei?color=brightgreen\u0026label=downloads%20%28brew%29)\n![Chocolatey Downloads](https://img.shields.io/chocolatey/dt/tokei?label=Downloads%20(Chocolately))\n[![dependency status](https://deps.rs/repo/github/XAMPPRocky/tokei/status.svg)](https://deps.rs/repo/github/XAMPPRocky/tokei)\n[![Packaging status](https://repology.org/badge/tiny-repos/tokei.svg)](https://repology.org/project/tokei/versions)\n\n\nTokei is a program that displays statistics about your code. Tokei will show the number of files, total lines within those files and code, comments, and blanks grouped by language.\n\n## Example\n```console\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n Language            Files        Lines         Code     Comments       Blanks\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n BASH                    4           49           30           10            9\n JSON                    1         1332         1332            0            0\n Shell                   1           49           38            1           10\n TOML                    2           77           64            4            9\n───────────────────────────────────────────────────────────────────────────────\n Markdown                5         1355            0         1074          281\n |- JSON                 1           41           41            0            0\n |- Rust                 2           53           42            6            5\n |- Shell                1           22           18            0            4\n (Total)                           1471          101         1080          290\n───────────────────────────────────────────────────────────────────────────────\n Rust                   19         3416         2840          116          460\n |- Markdown            12          351            5          295           51\n (Total)                           3767         2845          411          511\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n Total                  32         6745         4410         1506          829\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n```\n\n## [API Documentation](https://docs.rs/tokei)\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n    - [Package Managers](#package-managers)\n    - [Manual](#manual)\n- [Configuration](#configuration)\n- [How to use Tokei](#how-to-use-tokei)\n- [Options](#options)\n- [Badges](#badges)\n- [Supported Languages](#supported-languages)\n- [Changelog](CHANGELOG.md)\n- [Common Issues](#common-issues)\n- [Canonical Source](#canonical-source)\n- [Copyright and License](#copyright-and-license)\n\n## Features\n\n- Tokei is **very fast**, and is able to count millions of lines of code in seconds.\n  Check out the [11.0.0 release](https://github.com/XAMPPRocky/tokei/releases/v11.0.0)\n  to see how Tokei's speed compares to others.\n\n- Tokei is **accurate**, Tokei correctly handles multi line comments,\n  nested comments, and not counting comments that are in strings. Providing an\n  accurate code statistics.\n\n- Tokei has huge range of languages, supporting over **150** languages, and\n  their various extensions.\n\n- Tokei can output in multiple formats(**CBOR**, **JSON**, **YAML**)\n  allowing Tokei's output to be easily stored, and reused. These can also be\n  reused in tokei combining a previous run's statistics with another set.\n\n- Tokei is available on **Mac**, **Linux**, and **Windows**. See [installation\n  instructions](#installation) for how to get Tokei on your platform.\n\n- Tokei is also a **library** allowing you to easily integrate it with other\n  projects.\n\n- Tokei comes with and without color. Set the env variable NO_COLOR to 1, and\n  it'll be black and white.\n\n## Installation\n\n### Package Managers\n\n#### Unix\n```console\n# Alpine Linux (since 3.13)\napk add tokei\n# Arch Linux\npacman -S tokei\n# Cargo\ncargo install tokei\n# Conda\nconda install -c conda-forge tokei\n# Fedora\nsudo dnf install tokei\n# FreeBSD\npkg install tokei\n# NetBSD\npkgin install tokei\n# Nix/NixOS\nnix-env -i tokei\n# OpenSUSE\nsudo zypper install tokei\n# Void Linux\nsudo xbps-install tokei\n```\n\n#### macOS\n```console\n# Homebrew\nbrew install tokei\n# MacPorts\nsudo port selfupdate\nsudo port install tokei\n```\n\n#### Windows\n```console\n# Winget\nwinget install XAMPPRocky.tokei\n# Scoop\nscoop install tokei\n```\n\n### Manual\n\n#### Downloading\nYou can download prebuilt binaries in the\n[releases section](https://github.com/XAMPPRocky/tokei/releases).\n\n#### Building\nYou can also build and install from source (requires the latest stable [Rust] compiler.)\n```console\ncargo install --git https://github.com/XAMPPRocky/tokei.git tokei\n```\n\n[rust]: https://www.rust-lang.org\n\n\n## Configuration\n\nTokei has a [configuration] file that allows you to change default behaviour.\nThe file can be named `tokei.toml` or `.tokeirc`. Currently tokei looks for\nthis file in three different places. The current directory, your home directory,\nand your configuration directory.\n\n## How to use Tokei\n\n#### Basic usage\n\nThis is the basic way to use tokei. Which will report on the code in `./foo`\nand all subfolders.\n\n```shell\n$ tokei ./foo\n```\n\n[configuration]: ./tokei.example.toml\n\n#### Multiple folders\nTo have tokei report on multiple folders in the same call simply add a comma,\nor a space followed by another path.\n\n```shell\n$ tokei ./foo ./bar ./baz\n```\n```shell\n$ tokei ./foo, ./bar, ./baz\n```\n\n#### Excluding folders\nTokei will respect all `.gitignore` and `.ignore` files, and you can use\nthe `--exclude` option to exclude any additional files. The `--exclude` flag has\nthe same semantics as `.gitignore`.\n\n```shell\n$ tokei ./foo --exclude *.rs\n```\n\nPaths to exclude can also be listed in a `.tokeignore` file, using the same\n[syntax](https://git-scm.com/docs/gitignore) as .gitignore files.\n\n#### Sorting output\nBy default tokei sorts alphabetically by language name, however using `--sort`\ntokei can also sort by any of the columns.\n\n`blanks, code, comments, lines`\n\n```shell\n$ tokei ./foo --sort code\n```\n\n#### Outputting file statistics\nBy default tokei only outputs the total of the languages, and using `--files`\nflag tokei can also output individual file statistics.\n\n```shell\n$ tokei ./foo --files\n```\n\n#### Outputting into different formats\nTokei normally outputs into a nice human readable format designed for terminals.\nThere is also using the `--output` option various other formats that are more\nuseful for bringing the data into another program.\n\n**Note:** This version of tokei was compiled without any serialization formats, to enable serialization, reinstall\ntokei with the features flag.\n\n```shell\n  ALL:\n  cargo install tokei --features all\n\n  CBOR:\n  cargo install tokei --features cbor\n\n  YAML:\n  cargo install tokei --features yaml\n```\n\n**Currently supported formats**\n- JSON `--output json`\n- YAML `--output yaml`\n- CBOR `--output cbor`\n\n```shell\n$ tokei ./foo --output json\n```\n\n#### Reading in stored formats\nTokei can also take in the outputted formats added in the previous results to its\ncurrent run. Tokei can take either a path to a file, the format passed in as a\nvalue to the option, or from stdin.\n\n```shell\n$ tokei ./foo --input ./stats.json\n```\n\n## Options\n\n```\nUSAGE:\n    tokei [FLAGS] [OPTIONS] [--] [input]...\n\nFLAGS:\n    -f, --files               Will print out statistics on individual files.\n    -h, --help                Prints help information\n        --hidden              Count hidden files.\n    -l, --languages           Prints out supported languages and their extensions.\n        --no-ignore           Don't respect ignore files (.gitignore, .ignore, etc.). This implies --no-ignore-parent,\n                              --no-ignore-dot, and --no-ignore-vcs.\n        --no-ignore-dot       Don't respect .ignore and .tokeignore files, including those in parent directories.\n        --no-ignore-parent    Don't respect ignore files (.gitignore, .ignore, etc.) in parent directories.\n        --no-ignore-vcs       Don't respect VCS ignore files (.gitignore, .hgignore, etc.), including those in parent\n                              directories.\n    -V, --version             Prints version information\n    -v, --verbose             Set log output level:\n                                          1: to show unknown file extensions,\n                                          2: reserved for future debugging,\n                                          3: enable file level trace. Not recommended on multiple files\n\nOPTIONS:\n    -c, --columns \u003ccolumns\u003e       Sets a strict column width of the output, only available for terminal output.\n    -e, --exclude \u003cexclude\u003e...    Ignore all files \u0026 directories matching the pattern.\n    -i, --input \u003cfile_input\u003e      Gives statistics from a previous tokei run. Can be given a file path, or \"stdin\" to\n                                  read from stdin.\n    -o, --output \u003coutput\u003e         Outputs Tokei in a specific format. Compile with additional features for more format\n                                  support. [possible values: cbor, json, yaml]\n    -s, --sort \u003csort\u003e             Sort languages based on column [possible values: files, lines, blanks, code, comments]\n    -t, --type \u003ctypes\u003e            Filters output by language type, separated by a comma. i.e. -t=Rust,Markdown\n\nARGS:\n    \u003cinput\u003e...    The path(s) to the file or directory to be counted.\n```\n\n## Badges\nTokei has support for badges. For example\n[![](https://tokei.rs/b1/github/XAMPPRocky/tokei)](https://github.com/XAMPPRocky/tokei).\n\n```\n[![](https://tokei.rs/b1/github/XAMPPRocky/tokei)](https://github.com/XAMPPRocky/tokei).\n```\n\nTokei's URL scheme is as follows.\n\n```\nhttps://tokei.rs/b1/{host: values: github|gitlab}/{Repo Owner eg: XAMPPRocky}/{Repo name eg: tokei}\n```\n\nBy default the badge will show the repo's LoC(_Lines of Code_), you can also\nspecify for it to show a different category, by using the `?category=` query\nstring. It can be either `code`, `blanks`, `files`, `lines`, `comments`,\nExample show total lines:\n\n```\n[![](https://tokei.rs/b1/github/XAMPPRocky/tokei?category=lines)](https://github.com/XAMPPRocky/tokei).\n```\n\nThe server code hosted on tokei.rs is in [XAMPPRocky/tokei_rs](https://github.com/XAMPPRocky/tokei_rs)\n\n## Dockerized version\nTokei is available in a small `alpine`-based docker image, buildable through [earthly](https://github.com/earthly/earthly):\n```bash\nearthly +docker\n```\n\nOnce built, one can run the image with:\n```bash\ndocker run --rm -v /path/to/analyze:/src tokei .\n```\n\nOr, to simply analyze the current folder (linux):\n```bash\ndocker run --rm -v $(pwd):/src tokei .\n```\n\n## Supported Languages\n\nIf there is a language that you would to add to tokei feel free to make a pull\nrequest. Languages are defined in [`languages.json`](./languages.json), and you can\nread how to add and test your language in our [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n```\nAbap\nActionScript\nAda\nAgda\nAlex\nAlloy\nAPL\nAsn1\nAsp\nAspNet\nAssembly\nAssemblyGAS\nATS\nAutoconf\nAutoHotKey\nAutomake\nAWK\nBash\nBatch\nBazel\nBean\nBicep\nBitbake\nBQN\nBrightScript\nC\nCabal\nCassius\nCeylon\nCHeader\nCil\nClojure\nClojureC\nClojureScript\nCMake\nCobol\nCoffeeScript\nCogent\nColdFusion\nColdFusionScript\nCoq\nCpp\nCppHeader\nCrystal\nCSharp\nCShell\nCss\nCuda\nCUE\nCython\nD\nD2\nDAML\nDart\nDeviceTree\nDhall\nDockerfile\nDotNetResource\nDreamMaker\nDust\nEbuild\nEdgeDB\nEdn\nElisp\nElixir\nElm\nElvish\nEmacsDevEnv\nEmojicode\nErlang\nFactor\nFEN\nFish\nFlatBuffers\nForgeConfig\nForth\nFortranLegacy\nFortranModern\nFreeMarker\nFSharp\nFstar\nGDB\nGdScript\nGdShader\nGherkin\nGleam\nGlsl\nGo\nGraphql\nGroovy\nGwion\nHamlet\nHandlebars\nHappy\nHare\nHaskell\nHaxe\nHcl\nHex\nHiCAD\nhledger\nHlsl\nHolyC\nHtml\nHy\nIdris\nIni\nIntelHex\nIsabelle\nJai\nJanet\nJava\nJavaScript\nJq\nJson\nJsx\nJulia\nJulius\nJust\nKakouneScript\nKotlin\nLean\nLess\nLingua Franca\nLinkerScript\nLiquid\nLisp\nLLVM\nLogtalk\nLua\nLucius\nMadlang\nMax\nMakefile\nMarkdown\nMdx\nMeson\nMint\nMlatu\nModuleDef\nMonkeyC\nMoonScript\nMsBuild\nMustache\nNim\nNix\nNotQuitePerl\nNuGetConfig\nNushell\nObjectiveC\nObjectiveCpp\nOCaml\nOdin\nOpenSCAD\nOpenQASM\nOrg\nOz\nPascal\nPerl\nPerl6\nPest\nPhix\nPhp\nPo\nPoke\nPolly\nPony\nPostCss\nPowerShell\nProcessing\nProlog\nProtobuf\nPRQL\nPSL\nPureScript\nPyret\nPython\nQcl\nQml\nR\nRacket\nRakefile\nRazor\nRenpy\nReStructuredText\nRON\nRPMSpecfile\nRuby\nRubyHtml\nRust\nSass\nScala\nScheme\nScons\nSh\nShaderLab\nSlang\nSml\nSolidity\nSpecmanE\nSpice\nSql\nSRecode\nStata\nStratego\nSvelte\nSvg\nSwift\nSwig\nSystemVerilog\nSlint\nTact\nTcl\nTempl\nTex\nText\nThrift\nToml\nTsx\nTwig\nTypeScript\nUMPL\nUnrealDeveloperMarkdown\nUnrealPlugin\nUnrealProject\nUnrealScript\nUnrealShader\nUnrealShaderHeader\nUrWeb\nUrWebProject\nVala\nVB6\nVBScript\nVelocity\nVerilog\nVerilogArgsFile\nVhdl\nVimScript\nVisualBasic\nVisualStudioProject\nVisualStudioSolution\nVue\nWebAssembly\nWolfram\nXaml\nXcodeConfig\nXml\nXSL\nXtend\nYaml\nZenCode\nZig\nZoKrates\nZsh\n```\n\n## Common issues\n\n### Tokei says I have a lot of D code, but I know there is no D code!\nThis is likely due to `gcc` generating `.d` files. Until the D people decide on\na different file extension, you can always exclude `.d` files using the\n`-e --exclude` flag like so\n\n```\n$ tokei . -e *.d\n```\n\n## Canonical Source\nThe canonical source of this repo is hosted on\n[GitHub](https://github.com/XAMPPRocky/tokei). If you have a GitHub account,\nplease make your issues, and pull requests there.\n\n## Related Tools\n\n- [tokei-pie](https://github.com/laixintao/tokei-pie): Render tokei's output to\n  interactive sunburst chart.\n\n## Copyright and License\n(C) Copyright 2015 by XAMPPRocky and contributors\n\nSee [the graph](https://github.com/XAMPPRocky/tokei/graphs/contributors) for a full list of contributors.\n\nTokei is distributed under the terms of both the MIT license and the Apache License (Version 2.0).\n\nSee [LICENCE-APACHE](./LICENCE-APACHE), [LICENCE-MIT](./LICENCE-MIT) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FXAMPPRocky%2Ftokei","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FXAMPPRocky%2Ftokei","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FXAMPPRocky%2Ftokei/lists"}