From d6dc50cd59e372efecd3f4a6cf7aed59883ce2d8 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Mon, 30 Mar 2026 11:16:20 -0700 Subject: [PATCH] cc-token: init at unstable-2025-12-04 > CLI tool for counting tokens in files using Anthropic's Claude API See: https://github.com/iota-uz/cc-token --- pkgs/by-name/cc/cc-token/package.nix | 42 ++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 pkgs/by-name/cc/cc-token/package.nix diff --git a/pkgs/by-name/cc/cc-token/package.nix b/pkgs/by-name/cc/cc-token/package.nix new file mode 100644 index 000000000000..8b45cad9987c --- /dev/null +++ b/pkgs/by-name/cc/cc-token/package.nix @@ -0,0 +1,42 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, + installShellFiles, +}: + +buildGoModule { + pname = "cc-token"; + version = "unstable-2025-12-04"; + + src = fetchFromGitHub { + owner = "iota-uz"; + repo = "cc-token"; + rev = "c833f5739c4f14c7091337d3291176bf566aed73"; + hash = "sha256-BGeU6ewgoQlZl2LlNpEU2v6pT0wzQmcENnH02jQXpLQ="; + }; + + nativeBuildInputs = [ + installShellFiles + ]; + + vendorHash = "sha256-isnQwGIFPon1STxHY/X87SYRMz8VqpBOJ0aeUF9hf9o="; + + postInstall = '' + export ANTHROPIC_API_KEY=placeholder + installShellCompletion --cmd cc-token \ + --bash <($out/bin/cc-token completion bash) \ + --zsh <($out/bin/cc-token completion zsh) \ + --fish <($out/bin/cc-token completion fish) + ''; + + __structuredAttrs = true; + + meta = { + description = "CLI tool for counting tokens in files using Anthropic's Claude API"; + homepage = "https://github.com/iota-uz/cc-token"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers._9999years ]; + mainProgram = "cc-token"; + }; +}