usage

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package usage logs ttal command invocations to SQLite for auto-compact summaries.

Plane: shared

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log(subcommand, target string)

Log records a ttal command invocation with "command attempted" semantics — it fires immediately after flag validation, before the underlying operation completes. Convenience wrapper for LogWith("ttal", ...). Skips silently if TTAL_AGENT_NAME is not set. Never fails the caller.

func LogWith added in v1.2.0

func LogWith(command, subcommand, target string)

LogWith records a tool invocation. command is the tool name (e.g. "ttal", "flicknote"). Skips silently if TTAL_AGENT_NAME is not set. Never fails the caller.

Types

type Count

type Count struct {
	Subcommand string `json:"subcommand"`
	Target     string `json:"target"`
	Count      int    `json:"count"`
}

Count represents a grouped usage count for a subcommand+target pair.

func Summary

func Summary(agent string, since time.Time) ([]Count, error)

Summary returns usage counts for an agent since a given time, grouped by subcommand and target. Returns (nil, err) if the database is unavailable (e.g., daemon has not yet run); callers should treat this as non-fatal and fall back gracefully.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL