Tokei เป็นโปรแกรมที่แสดงสถิติเกี่ยวกับรหัสของคุณ Tokei จะแสดงจำนวนไฟล์ทั้งหมดบรรทัดทั้งหมดภายในไฟล์และรหัสความคิดเห็นและช่องว่างที่จัดกลุ่มตามภาษา
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Language Files Lines Code Comments Blanks
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
BASH 4 49 30 10 9
JSON 1 1332 1332 0 0
Shell 1 49 38 1 10
TOML 2 77 64 4 9
───────────────────────────────────────────────────────────────────────────────
Markdown 5 1355 0 1074 281
|- JSON 1 41 41 0 0
|- Rust 2 53 42 6 5
|- Shell 1 22 18 0 4
(Total) 1471 101 1080 290
───────────────────────────────────────────────────────────────────────────────
Rust 19 3416 2840 116 460
|- Markdown 12 351 5 295 51
(Total) 3767 2845 411 511
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Total 32 6745 4410 1506 829
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Tokei เร็วมาก และสามารถนับจำนวนหลายบรรทัดของรหัสในไม่กี่วินาที ตรวจสอบการเปิดตัว 11.0.0 เพื่อดูว่าความเร็วของ Tokei เทียบกับคนอื่น ๆ ได้อย่างไร
Tokei ถูกต้อง Tokei จัดการความคิดเห็นหลายบรรทัดอย่างถูกต้องความคิดเห็นที่ซ้อนกันและไม่นับความคิดเห็นที่อยู่ในสตริง ให้สถิติรหัสที่ถูกต้อง
Tokei มีภาษาที่หลากหลายสนับสนุนมากกว่า 150 ภาษาและส่วนขยายต่าง ๆ ของพวกเขา
Tokei สามารถส่งออกในหลายรูปแบบ ( CBOR , JSON , YAML ) ทำให้เอาต์พุตของ Tokei ถูกจัดเก็บและนำกลับมาใช้ใหม่ได้อย่างง่ายดาย สิ่งเหล่านี้ยังสามารถนำกลับมาใช้ใหม่ใน Tokei รวมสถิติการรันก่อนหน้านี้กับชุดอื่น
Tokei พร้อมใช้งานบน Mac , Linux และ Windows ดูคำแนะนำการติดตั้งสำหรับวิธีการรับ Tokei บนแพลตฟอร์มของคุณ
Tokei ยังเป็น ห้องสมุด ที่ช่วยให้คุณสามารถรวมเข้ากับโครงการอื่น ๆ ได้อย่างง่ายดาย
Tokei มาพร้อมกับและไม่มีสี ตั้งค่าตัวแปร env no_color เป็น 1 และมันจะเป็นขาวดำ
# Alpine Linux (since 3.13)
apk add tokei
# Arch Linux
pacman -S tokei
# Cargo
cargo install tokei
# Conda
conda install -c conda-forge tokei
# Fedora
sudo dnf install tokei
# FreeBSD
pkg install tokei
# NetBSD
pkgin install tokei
# Nix/NixOS
nix-env -i tokei
# OpenSUSE
sudo zypper install tokei
# Void Linux
sudo xbps-install tokei # Homebrew
brew install tokei
# MacPorts
sudo port selfupdate
sudo port install tokei # Winget
winget install XAMPPRocky.tokei
# Scoop
scoop install tokeiคุณสามารถดาวน์โหลดไบนารี prebuilt ในส่วนเผยแพร่
นอกจากนี้คุณยังสามารถสร้างและติดตั้งได้จากแหล่งที่มา (ต้องใช้คอมไพเลอร์สนิมที่มีเสถียรภาพล่าสุด)
cargo install --git https://github.com/XAMPPRocky/tokei.git tokei Tokei มีไฟล์กำหนดค่าที่อนุญาตให้คุณเปลี่ยนพฤติกรรมเริ่มต้น ไฟล์สามารถตั้งชื่อ tokei.toml หรือ .tokeirc tokeirc ปัจจุบัน Tokei มองหาไฟล์นี้ในสามสถานที่ที่แตกต่างกัน ไดเรกทอรีปัจจุบันไดเรกทอรีบ้านของคุณและไดเรกทอรีการกำหนดค่าของคุณ
นี่เป็นวิธีพื้นฐานในการใช้ Tokei ซึ่งจะรายงานเกี่ยวกับรหัสใน ./foo และโฟลเดอร์ย่อยทั้งหมด
$ tokei ./fooหากต้องการรายงาน Tokei เกี่ยวกับหลายโฟลเดอร์ในการโทรเดียวกันเพียงเพิ่มเครื่องหมายจุลภาคหรือพื้นที่ตามด้วยเส้นทางอื่น
$ tokei ./foo ./bar ./baz$ tokei ./foo, ./bar, ./baz Tokei จะเคารพไฟล์ .gitignore และ .ignore ทั้งหมดและคุณสามารถใช้ตัวเลือก --exclude เพื่อยกเว้นไฟล์เพิ่มเติมใด ๆ ค่าธง --exclude มีความหมายเช่นเดียวกับ .gitignore
$ tokei ./foo --exclude * .rs เส้นทางที่จะยกเว้นสามารถแสดงรายการในไฟล์ .tokeignore โดยใช้ไวยากรณ์เดียวกับไฟล์. gitignore
โดยค่าเริ่มต้น Tokei เรียงลำดับตามตัวอักษรตามชื่อภาษาอย่างไรก็ตามการใช้ --sort Tokei ยังสามารถเรียงลำดับตามคอลัมน์ใด ๆ
blanks, code, comments, lines
$ tokei ./foo --sort code โดยค่าเริ่มต้น Tokei จะส่งผลรวมของภาษาทั้งหมดเท่านั้นและการใช้ --files Flag Tokei ยังสามารถส่งออกสถิติไฟล์แต่ละไฟล์ได้
$ tokei ./foo --files โดยปกติแล้ว Tokei จะส่งออกเป็นรูปแบบที่อ่านได้ของมนุษย์ที่ออกแบบมาสำหรับเทอร์มินัล นอกจากนี้ยังใช้ตัวเลือก --output พุทรูปแบบอื่น ๆ ที่มีประโยชน์มากกว่าสำหรับการนำข้อมูลไปยังโปรแกรมอื่น
หมายเหตุ: Tokei รุ่นนี้ถูกรวบรวมโดยไม่มีรูปแบบการทำให้เป็นอนุกรมใด ๆ เพื่อเปิดใช้งานการทำให้เป็นอนุกรมติดตั้ง Tokei ใหม่ด้วย Feature Flag
ALL:
cargo install tokei --features all
CBOR:
cargo install tokei --features cbor
YAML:
cargo install tokei --features yamlรูปแบบที่รองรับในปัจจุบัน
--output json--output yaml--output cbor $ tokei ./foo --output jsonTokei ยังสามารถใช้ในรูปแบบที่เพิ่มเข้ามาในผลลัพธ์ก่อนหน้าในการรันปัจจุบัน Tokei สามารถใช้เส้นทางไปยังไฟล์รูปแบบที่ส่งผ่านเป็นค่าไปยังตัวเลือกหรือจาก stdin
$ tokei ./foo --input ./stats.json USAGE:
tokei [FLAGS] [OPTIONS] [--] [input]...
FLAGS:
-f, --files Will print out statistics on individual files.
-h, --help Prints help information
--hidden Count hidden files.
-l, --languages Prints out supported languages and their extensions.
--no-ignore Don't respect ignore files (.gitignore, .ignore, etc.). This implies --no-ignore-parent,
--no-ignore-dot, and --no-ignore-vcs.
--no-ignore-dot Don't respect .ignore and .tokeignore files, including those in parent directories.
--no-ignore-parent Don't respect ignore files (.gitignore, .ignore, etc.) in parent directories.
--no-ignore-vcs Don't respect VCS ignore files (.gitignore, .hgignore, etc.), including those in parent
directories.
-V, --version Prints version information
-v, --verbose Set log output level:
1: to show unknown file extensions,
2: reserved for future debugging,
3: enable file level trace. Not recommended on multiple files
OPTIONS:
-c, --columns <columns> Sets a strict column width of the output, only available for terminal output.
-e, --exclude <exclude>... Ignore all files & directories matching the pattern.
-i, --input <file_input> Gives statistics from a previous tokei run. Can be given a file path, or "stdin" to
read from stdin.
-o, --output <output> Outputs Tokei in a specific format. Compile with additional features for more format
support. [possible values: cbor, json, yaml]
-s, --sort <sort> Sort languages based on column [possible values: files, lines, blanks, code, comments]
-t, --type <types> Filters output by language type, separated by a comma. i.e. -t=Rust,Markdown
ARGS:
<input>... The path(s) to the file or directory to be counted.
Tokei สนับสนุนป้าย ตัวอย่างเช่น .
[](https://github.com/XAMPPRocky/tokei).
โครงการ URL ของ Tokei มีดังนี้
https://tokei.rs/b1/{host: values: github|gitlab}/{Repo Owner eg: XAMPPRocky}/{Repo name eg: tokei}
โดยค่าเริ่มต้นตราจะแสดง loc ของ repo ( บรรทัดของรหัส ) คุณยังสามารถระบุให้มันแสดงหมวดหมู่ที่แตกต่างกันโดยใช้หมวดหมู่ ?category= string แบบสอบถาม อาจเป็นทั้ง code , blanks , files , lines , comments , ตัวอย่างแสดงบรรทัดทั้งหมด:
[](https://github.com/XAMPPRocky/tokei).
รหัสเซิร์ฟเวอร์ที่โฮสต์บน tokei.rs อยู่ใน xampprocky/tokei_rs
Tokei มีอยู่ในภาพนักเทียบท่าที่มี alpine ขนาดเล็กซึ่งสามารถสร้างได้ผ่านทางโลก:
earthly +dockerเมื่อสร้างขึ้นแล้วหนึ่งสามารถเรียกใช้ภาพด้วย:
docker run --rm -v /path/to/analyze:/src tokei .หรือเพียงแค่วิเคราะห์โฟลเดอร์ปัจจุบัน (Linux):
docker run --rm -v $( pwd ) :/src tokei . หากมีภาษาที่คุณจะเพิ่มลงใน tokei อย่าลังเลที่จะทำการร้องขอการดึง ภาษาถูกกำหนดเป็น languages.json และคุณสามารถอ่านวิธีเพิ่มและทดสอบภาษาของคุณในการสนับสนุนของเรา
Abap
ActionScript
Ada
Agda
Alex
Alloy
APL
Asn1
Asp
AspNet
Assembly
AssemblyGAS
ATS
Autoconf
AutoHotKey
Automake
AWK
Bash
Batch
Bazel
Bean
Bicep
Bitbake
BQN
BrightScript
C
Cabal
Cassius
Ceylon
CHeader
Cil
Clojure
ClojureC
ClojureScript
CMake
Cobol
CoffeeScript
Cogent
ColdFusion
ColdFusionScript
Coq
Cpp
CppHeader
Crystal
CSharp
CShell
Css
Cuda
CUE
Cython
D
D2
DAML
Dart
DeviceTree
Dhall
Dockerfile
DotNetResource
DreamMaker
Dust
Ebuild
EdgeDB
Edn
Elisp
Elixir
Elm
Elvish
EmacsDevEnv
Emojicode
Erlang
Factor
FEN
Fish
FlatBuffers
ForgeConfig
Forth
FortranLegacy
FortranModern
FreeMarker
FSharp
Fstar
GDB
GdScript
GdShader
Gherkin
Gleam
Glsl
Go
Graphql
Groovy
Gwion
Hamlet
Handlebars
Happy
Hare
Haskell
Haxe
Hcl
Hex
HiCAD
hledger
Hlsl
HolyC
Html
Hy
Idris
Ini
IntelHex
Isabelle
Jai
Janet
Java
JavaScript
Jq
Json
Jsx
Julia
Julius
Just
KakouneScript
Kotlin
Lean
Less
Lingua Franca
LinkerScript
Liquid
Lisp
LLVM
Logtalk
Lua
Lucius
Madlang
Max
Makefile
Markdown
Mdx
Meson
Mint
Mlatu
ModuleDef
MonkeyC
MoonScript
MsBuild
Mustache
Nim
Nix
NotQuitePerl
NuGetConfig
Nushell
ObjectiveC
ObjectiveCpp
OCaml
Odin
OpenSCAD
OpenQASM
Org
Oz
Pascal
Perl
Perl6
Pest
Phix
Php
Po
Poke
Polly
Pony
PostCss
PowerShell
Processing
Prolog
Protobuf
PRQL
PSL
PureScript
Pyret
Python
Qcl
Qml
R
Racket
Rakefile
Razor
Renpy
ReStructuredText
RON
RPMSpecfile
Ruby
RubyHtml
Rust
Sass
Scala
Scheme
Scons
Sh
ShaderLab
Slang
Sml
Solidity
SpecmanE
Spice
Sql
SRecode
Stata
Stratego
Svelte
Svg
Swift
Swig
SystemVerilog
Slint
Tact
Tcl
Templ
Tex
Text
Thrift
Toml
Tsx
Twig
TypeScript
UMPL
UnrealDeveloperMarkdown
UnrealPlugin
UnrealProject
UnrealScript
UnrealShader
UnrealShaderHeader
UrWeb
UrWebProject
Vala
VB6
VBScript
Velocity
Verilog
VerilogArgsFile
Vhdl
VimScript
VisualBasic
VisualStudioProject
VisualStudioSolution
Vue
WebAssembly
Wolfram
Xaml
XcodeConfig
Xml
XSL
Xtend
Yaml
ZenCode
Zig
ZoKrates
Zsh
นี่อาจเป็นเพราะ gcc สร้างไฟล์. .d จนกว่าคน D จะตัดสินใจเกี่ยวกับส่วนขยายไฟล์ที่แตกต่างกันคุณสามารถยกเว้นไฟล์ .d โดยใช้ค่าสถานะ -e --exclude เช่นนั้น
$ tokei . -e *.d
แหล่งที่มาของ repo นี้เป็นโฮสต์บน GitHub หากคุณมีบัญชี GitHub โปรดทำให้ปัญหาของคุณและดึงคำขอที่นั่น
(c) ลิขสิทธิ์ 2015 โดย Xampprocky และผู้สนับสนุน
ดูกราฟสำหรับรายชื่อผู้มีส่วนร่วมทั้งหมด
Tokei มีการแจกจ่ายภายใต้ข้อกำหนดของทั้งใบอนุญาต MIT และใบอนุญาต Apache (เวอร์ชัน 2.0)
ดู Licence-Apache, Licence-MIT สำหรับข้อมูลเพิ่มเติม