Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Changesets

Tokenometer uses [Changesets](https://github.com/changesets/changesets) to manage versions and changelogs.

## How to add one

When opening a PR that warrants a release entry, run:

```bash
npx changeset
```

You'll be prompted to:
1. Pick which packages changed (`tokenometer` and `@tokenometer/core` are version-fixed — bumping one bumps both).
2. Pick the bump type:
- `patch` — bug fix, internal refactor, doc fix
- `minor` — new flag, new provider, new format, new output type
- `major` — breaking CLI flag rename, breaking API change, dropped provider
3. Write a one-line summary (this becomes the CHANGELOG entry).

The command writes a `<random>.md` file in this directory. Commit it in the same PR.

## What happens on merge to main

The `release` GitHub Actions workflow runs automatically:

1. If any changeset files are present in `.changeset/`, the workflow opens (or updates) a **Version Packages** PR.
- That PR bumps `package.json` versions for `tokenometer` and `@tokenometer/core` (fixed group).
- It auto-generates `CHANGELOG.md` entries from the changeset summaries.
- It deletes the consumed `.changeset/<random>.md` files.
2. When the Version Packages PR is merged, the workflow publishes the bumped versions to npm with provenance.
3. A GitHub Release is created on the new tag — this is what the GitHub Marketplace listens to for the Action.

## Ignored packages

`@tokenometer/web` and `@tokenometer/action` are listed under `ignore` in `config.json`. They aren't published to npm directly:

- `@tokenometer/web` is the playground — deployed to Vercel, not versioned on npm.
- `@tokenometer/action` ships as a JavaScript Action via the repo tag. Its release is driven by the GitHub Release event, not npm.

If you change either, you don't need a changeset. If your change *also* touches `@tokenometer/core` or the CLI, do add a changeset for those.

## Why fixed-group?

`tokenometer` (the CLI) depends on `@tokenometer/core` directly. Letting them drift confused users who'd `npm install tokenometer@latest @tokenometer/core@latest` and end up on incompatible majors. Fixing the group means one version number tracks both.
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "faraa2m/tokenometer" }],
"commit": false,
"fixed": [["tokenometer", "@tokenometer/core"]],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["@tokenometer/web", "@tokenometer/action"]
}
13 changes: 13 additions & 0 deletions .changeset/legit-docs-and-seo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"tokenometer": minor
"@tokenometer/core": minor
---

Project legitimacy and SEO rollout (Wave 1 of v1.0.0):

- Added `CODE_OF_CONDUCT.md` (Contributor Covenant 2.1), `CONTRIBUTING.md`, `SECURITY.md` (GitHub Private Vulnerability Reporting only — no email exposure), `CHANGELOG.md`.
- Added `.github/copilot-instructions.md` for `gh copilot review`, plus `PULL_REQUEST_TEMPLATE.md`, issue forms (`bug_report.yml`, `feature_request.yml`, `config.yml`), and `FUNDING.yml`.
- Rewrote root `README.md` with badges row, "Why Tokenometer vs alternatives" comparison table (vs `tokencost`, `tiktoken`, `gpt-tokenizer`, `promptfoo`, `gpt-token-counter-live`), ASCII demo of CLI table output, and project-health checklist.
- Extended npm `keywords` and `description` across `tokenometer` (CLI), `@tokenometer/core`, and `@tokenometer/action` for SEO. Root description now reads: "Tokenometer — LLM cost calculator, token counter, and CI cost-guardrail Action for Claude, GPT-4o, Gemini."
- Added Marketplace publish prep (`.github/release-notes-v1.0.0.md`) and awesome-list PR templates (`.github/awesome-list-prs/`).
- Initialized Changesets for auto-bump + auto-CHANGELOG-generation on release. Replaced the manual `release.yml` workflow with the Changesets-driven version-PR + publish flow.
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
github: [faraa2m]
# patreon:
# open_collective:
# ko_fi:
# tidelift:
# community_bridge:
# liberapay:
# issuehunt:
# lfx_crowdfunding:
# polar:
# buy_me_a_coffee:
# thanks_dev:
# custom:
79 changes: 79 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: "Bug report"
description: Report a measurement, pricing, or tooling bug in Tokenometer.
title: "bug: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for filing a bug. Please include enough detail for someone to reproduce the issue without follow-up questions.

- type: input
id: tokenometer-version
attributes:
label: Tokenometer version
description: Output of `tokenometer --version`.
placeholder: "e.g. 1.0.3"
validations:
required: true

- type: input
id: node-version
attributes:
label: Node version
description: Output of `node --version`.
placeholder: "e.g. v20.11.1"
validations:
required: true

- type: input
id: os
attributes:
label: Operating system
placeholder: "e.g. macOS 14.5, Ubuntu 22.04, Windows 11"
validations:
required: true

- type: input
id: model-flags
attributes:
label: Model and format flags
description: The exact `--model`, `--format`, and other flags you invoked.
placeholder: "e.g. --model claude-sonnet-4 --format json"
validations:
required: true

- type: textarea
id: steps
attributes:
label: Steps to reproduce
description: Minimal commands or input to reproduce the issue.
placeholder: |
1. echo "hello" | tokenometer --model gpt-4o
2. ...
validations:
required: true

- type: textarea
id: expected
attributes:
label: Expected behavior
validations:
required: true

- type: textarea
id: actual
attributes:
label: Actual behavior
validations:
required: true

- type: textarea
id: logs
attributes:
label: Logs or output
description: |
Paste relevant output. **Redact any API keys, prompts containing private data, or other secrets before submitting** — issues are public.
render: shell
validations:
required: false
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Questions and discussion
url: https://github.com/faraa2m/tokenometer/discussions
about: For usage questions, ideas, and general discussion — not bug reports.
- name: Security vulnerability
url: https://github.com/faraa2m/tokenometer/blob/main/SECURITY.md
about: Do not open a public issue for security vulnerabilities. Follow SECURITY.md for private disclosure.
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "Feature request"
description: Propose a new feature or change to Tokenometer.
title: "feat: "
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Acceptance bar: a feature must demonstrate measurable cost-decision value to users, or fix a measurement bug. "Nice to have" requests without a concrete use case will be closed.

- type: textarea
id: problem
attributes:
label: Problem you're trying to solve
description: What can't you do today, or what's painful about the current behavior?
validations:
required: true

- type: textarea
id: solution
attributes:
label: Proposed solution
description: Concrete behavior, flags, or output changes you'd like to see.
validations:
required: true

- type: textarea
id: alternatives
attributes:
label: Alternatives considered
description: Other approaches you weighed and why you ruled them out.
validations:
required: false

- type: textarea
id: impact
attributes:
label: Impact on existing flags or output
description: |
Does this change CLI flags, JSON output shape, Action inputs/outputs, or pricing math? Call out any breaking changes explicitly.
validations:
required: true
36 changes: 36 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## Summary

<!-- One line. What does this PR do? -->

## Why

<!-- Motivation. What problem does this solve, or what cost-decision value does it add? -->

## Changes

<!-- Bullet list of concrete changes. -->

-
-
-

## Testing

<!-- Commands you ran locally and what you observed. -->

```
npm run lint
npm run typecheck
npm test
```

## Checklist

- [ ] Tests added or updated for the change
- [ ] `npm run lint` passes
- [ ] `npm run typecheck` passes
- [ ] README updated if behavior is user-facing
- [ ] CHANGELOG entry added via Changesets (`npx changeset`)
- [ ] Breaking change documented in the changeset (if any)
- [ ] Action bundle rebuilt (`npm run build` in `packages/action/`) if `packages/action` was touched
- [ ] No secrets, API keys, or `.env` files committed
26 changes: 26 additions & 0 deletions .github/awesome-list-prs/awesome-actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# PR for awesome-actions

**Target repo:** https://github.com/sdras/awesome-actions
**PR title:** "Add Tokenometer — LLM cost CLI + GitHub Action"
**PR body:**

I'd like to add Tokenometer to the **Utility / Pull Requests** (or **Code Quality**) section.

## What it is

**Tokenometer** — empirical LLM token-cost CLI + GitHub Action + VS Code / Cursor extension + Claude Code skill. Multi-provider (Claude, GPT-4o, Gemini, Mistral, Cohere), offline + empirical modes (real `countTokens` API calls), CI cost-guardrail with sticky PR comments and budget gates.

- Repo: https://github.com/faraa2m/tokenometer
- npm: `npx tokenometer ./prompt.md --model claude-opus-4-7`
- Marketplace: https://github.com/marketplace/actions/tokenometer
- Live demo: https://tokenometer.vercel.app

## Why it fits this list

It is a first-class GitHub Action that posts a sticky PR comment diffing prompt-token cost across models on every push, and can fail the build when a USD budget is exceeded — the same shape as test-coverage or bundle-size guardrails, applied to LLM cost.

## Markdown line for the list

```
- [Tokenometer](https://github.com/faraa2m/tokenometer) — LLM token cost CLI + GitHub Action. Multi-provider, empirical, CI-native.
```
26 changes: 26 additions & 0 deletions .github/awesome-list-prs/awesome-ai-tools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# PR for awesome-ai-tools

**Target repo:** https://github.com/mahseema/awesome-ai-tools (verify — there are a few "awesome-ai-tools" repos; pick the one whose README structure matches).
**PR title:** "Add Tokenometer — LLM cost CLI + GitHub Action"
**PR body:**

I'd like to add Tokenometer to the **Developer Tools** (or **Cost / Observability**) section.

## What it is

**Tokenometer** — empirical LLM token-cost CLI + GitHub Action + VS Code / Cursor extension + Claude Code skill. Multi-provider (Claude, GPT-4o, Gemini, Mistral, Cohere), offline + empirical modes (real `countTokens` API calls), CI cost-guardrail with sticky PR comments and budget gates.

- Repo: https://github.com/faraa2m/tokenometer
- npm: `npx tokenometer ./prompt.md --model claude-opus-4-7`
- Marketplace: https://github.com/marketplace/actions/tokenometer
- Live demo: https://tokenometer.vercel.app

## Why it fits this list

The directory already includes generation, agent, and eval tooling but very little on the cost side. Tokenometer fills that gap with a single-command, multi-provider USD estimate that works locally and in CI, so teams can keep model spend in view without rolling their own dashboard.

## Markdown line for the list

```
- [Tokenometer](https://github.com/faraa2m/tokenometer) — LLM token cost CLI + GitHub Action. Multi-provider, empirical, CI-native.
```
26 changes: 26 additions & 0 deletions .github/awesome-list-prs/awesome-llm-apps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# PR for awesome-llm-apps

**Target repo:** https://github.com/Shubhamsaboo/awesome-llm-apps (verify before opening — there are several lists with this name; pick the one whose `README.md` matches the section you intend to land in).
**PR title:** "Add Tokenometer — LLM cost CLI + GitHub Action"
**PR body:**

I'd like to add Tokenometer to the **Tools / Developer Tools** section (or whichever section the maintainers prefer for cost-tracking utilities).

## What it is

**Tokenometer** — empirical LLM token-cost CLI + GitHub Action + VS Code / Cursor extension + Claude Code skill. Multi-provider (Claude, GPT-4o, Gemini, Mistral, Cohere), offline + empirical modes (real `countTokens` API calls), CI cost-guardrail with sticky PR comments and budget gates.

- Repo: https://github.com/faraa2m/tokenometer
- npm: `npx tokenometer ./prompt.md --model claude-opus-4-7`
- Marketplace: https://github.com/marketplace/actions/tokenometer
- Live demo: https://tokenometer.vercel.app

## Why it fits this list

Awesome-llm-apps already curates apps and tooling that help builders ship with LLMs. Tokenometer is the missing "what does this prompt actually cost" piece — it lets app developers measure, diff, and budget token spend across providers from a single CLI as they iterate.

## Markdown line for the list

```
- [Tokenometer](https://github.com/faraa2m/tokenometer) — LLM token cost CLI + GitHub Action. Multi-provider, empirical, CI-native.
```
26 changes: 26 additions & 0 deletions .github/awesome-list-prs/awesome-llmops.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# PR for awesome-llmops

**Target repo:** https://github.com/tensorchord/Awesome-LLMOps
**PR title:** "Add Tokenometer — LLM cost CLI + GitHub Action"
**PR body:**

I'd like to add Tokenometer to the **Observability / Cost** (or **Developer Tools**) section.

## What it is

**Tokenometer** — empirical LLM token-cost CLI + GitHub Action + VS Code / Cursor extension + Claude Code skill. Multi-provider (Claude, GPT-4o, Gemini, Mistral, Cohere), offline + empirical modes (real `countTokens` API calls), CI cost-guardrail with sticky PR comments and budget gates.

- Repo: https://github.com/faraa2m/tokenometer
- npm: `npx tokenometer ./prompt.md --model claude-opus-4-7`
- Marketplace: https://github.com/marketplace/actions/tokenometer
- Live demo: https://tokenometer.vercel.app

## Why it fits this list

Cost is a first-class LLMOps concern but most platforms treat it as a post-hoc dashboard. Tokenometer pulls it left into the developer workflow — a CLI for local prompt iteration plus a GitHub Action that gates PRs on a USD budget — so prompt-cost regressions get caught in code review the same way performance regressions do.

## Markdown line for the list

```
- [Tokenometer](https://github.com/faraa2m/tokenometer) — LLM token cost CLI + GitHub Action. Multi-provider, empirical, CI-native.
```
26 changes: 26 additions & 0 deletions .github/awesome-list-prs/awesome-prompt-engineering.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# PR for awesome-prompt-engineering

**Target repo:** https://github.com/promptslab/Awesome-Prompt-Engineering
**PR title:** "Add Tokenometer — LLM cost CLI + GitHub Action"
**PR body:**

I'd like to add Tokenometer to the **Tools & Code** section.

## What it is

**Tokenometer** — empirical LLM token-cost CLI + GitHub Action + VS Code / Cursor extension + Claude Code skill. Multi-provider (Claude, GPT-4o, Gemini, Mistral, Cohere), offline + empirical modes (real `countTokens` API calls), CI cost-guardrail with sticky PR comments and budget gates.

- Repo: https://github.com/faraa2m/tokenometer
- npm: `npx tokenometer ./prompt.md --model claude-opus-4-7`
- Marketplace: https://github.com/marketplace/actions/tokenometer
- Live demo: https://tokenometer.vercel.app

## Why it fits this list

Prompt engineers iterate on wording, structure, and few-shot examples — all of which move token count and cost. Tokenometer makes that feedback loop quantitative: you get a real `countTokens` measurement and a per-model USD figure for each prompt revision, so cost-aware prompt iteration stops being guesswork.

## Markdown line for the list

```
- [Tokenometer](https://github.com/faraa2m/tokenometer) — LLM token cost CLI + GitHub Action. Multi-provider, empirical, CI-native.
```
Loading
Loading