Skip to main content

Crate vibe_coding_tracker

Crate vibe_coding_tracker 

Source
Expand description

Library crate behind the vibe_coding_tracker / vct CLI.

The crate scans on-disk JSONL session logs written by four AI coding assistants — Claude Code, OpenAI Codex, GitHub Copilot CLI, and Gemini CLI — and rolls them up into two views:

  • usage — per-model token counts and LiteLLM-priced cost
  • analysis — per-model file-operation and tool-call metrics

§Pipeline

Raw bytes flow through a two-stage pipeline. session owns the “JSONL → typed CodeAnalysis” boundary (provider detection plus a parser per provider); analysis and usage then aggregate those typed records, and display renders the result as an interactive TUI, a static table, plain text, or JSON. Both downstream views consume the same parsed shape, so file parsing lives only in session.

Supporting modules: pricing (LiteLLM price lookup with a daily on-disk cache), cache (LRU file cache keyed by mtime), update (self-replace from the matching GitHub release asset), utils (path resolution and the glibc allocator tuning), and constants (capacity and buffer sizing).

Re-exports§

pub use cli::TimeRange;
pub use session::parser::parse_session_file;
pub use session::parser::parse_session_file_typed;
pub use usage::calculator::UsageData;
pub use usage::calculator::get_usage_from_directories;
pub use models::*;

Modules§

analysis
Aggregation of already-parsed session files into per-model metrics.
cache
Process-wide LRU cache of parsed session analyses.
cli
clap command-line surface and the time-range filter it resolves to.
constants
Compile-time sizing knobs: pre-allocation capacities and I/O buffer sizes.
display
Output renderers for the analysis and usage views.
models
Serde data models mirroring the on-disk JSONL shapes of the four supported AI coding assistants plus the analyzer’s own aggregated result types.
pricing
Model pricing: fetch, cache, match, and cost calculation.
quota
Quota orchestration for the usage panels.
session
Shared session-file parsing layer.
update
Self-update: replace the running binary from the matching GitHub release.
usage
Token-usage aggregation across provider session directories.
utils
Leaf helpers shared across the crate: directory walking, JSON/JSONL file IO, number/date formatting, git remote lookup, glibc heap tuning, path resolution, ISO timestamp parsing, and token-count extraction.

Structs§

VersionInfo
Build metadata reported by the vct version subcommand.

Constants§

CARGO_VERSION
cargo version string captured at build time by build.rs.
PKG_DESCRIPTION
Crate description from Cargo.toml.
PKG_NAME
Crate name from Cargo.toml (vibe_coding_tracker).
RUST_VERSION
rustc version string captured at build time by build.rs.
VERSION
Full build version: latest git tag plus commits-since and short SHA (with a -dirty suffix when the worktree is modified), generated by build.rs. Falls back to the Cargo.toml version outside a git tree.

Functions§

get_version_info
Snapshots the build version, Rust toolchain, and Cargo version into a VersionInfo.