Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/upstash/redis-js/aggregatinggit clone --depth 1 https://github.com/upstash/redis-jsWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01524 |
| Opus 5 | $0.00000 | $0.00762 |
| Sonnet 5 | $0.00000 | $0.00305 |
| Haiku 4.5 | $0.00000 | $0.00152 |
Grade A, and why
aggregating scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
Copies of this mod
2 near-identical copies found in the catalogue:
- aggregating — 100% identical, 0 lines differ
- aggregating — 100% identical, 0 lines differ
How it starts
The opening of the file, as written. The whole thing — 235 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Aggregations
Overview
Run analytics over indexed data using metric and bucket aggregations. Compute statistics, group documents, build histograms, and perform faceted navigation. Aggregations can be nested for multi-level analysis.
Good For
- Computing averages, sums, min/max across documents
- Grouping documents by field values (category breakdown)
- Building price range facets for e-commerce
- Histogram distributions (price ranges, date ranges)
- Multi-level analytics (average price per category)
Examples
Metric Aggregations
import { Redis, s } from "@upstash/redis";
const redis = Redis.fromEnv();
const index = await redis.search.createIndex({
name: "orders",
prefix: "order:",
dataType: "json",
schema: s.object({
product: s.string(),
category: s.facet(),
price: s.number("F64"),
quantity: s.number("U64"),
date: s.date(),
}),
});
// Insert sample data
await redis.json.set("order:1", "$", {
product: "Laptop",
category: "electronics",
price: 999.99,
quantity: 1,
date: "2024-06-15",
});
await redis.json.set("order:2", "$", {
product: "Mouse",
category: "electronics",
price: 29.99,
quantity: 3,
date: "2024-06-16",
});
await redis.json.set("order:3", "$", {
product: "Desk",
category: "furniture",
price: 249.99,
quantity: 1,
date: "2024-07-01",
});
await index.waitIndexing();
// Average price
const result = await index.aggregate({
aggregations: {
avg_price: { $avg: { field: "price" } },
},
});
// result.avg_price -> number
// Multiple metrics at once
const stats = await index.aggregate({
aggregations: {
avg_price: { $avg: { field: "price" } },
total_revenue: { $sum: { field: "price" } },
cheapest: { $min: { field: "price" } },
most_expensive: { $max: { field: "price" } },
order_count: { $count: { field: "price" } },
},
});
// Combined statistics
const priceStats = await index.aggregate({
aggregations: {
price_stats: { $stats: { field: "price" } },
// Returns: { count, min, max, sum, avg }
},
});
// Extended statistics (includes variance and standard deviation)
const extended = await index.aggregate({
aggregations: {
price_extended: { $extendedStats: { field: "price" } },
// Returns: { count, min, max, sum, avg, sumOfSquares, variance, stdDeviation }
},
});
// Percentiles
const percentiles = await index.aggregate({
aggregations: {
price_percentiles: { $percentiles: { field: "price", percents: [25, 50, 75, 95] } },
},
});
// Count distinct values
const uniqueCategories = await index.aggregate({
aggregations: {
unique_cats: { $cardinality: { field: "category" } },
},
});
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 235 lines · 0 tokens per session scan A 372b2c0acdea
aggregating is a command published in the GitHub repository upstash/redis-js (967 stars, last pushed 6d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,524 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
blog-post
Write a blog post for a new feature based on the current branch changes.
commit
Smart commit that stages only conversation-relevant changes.
worktree
Create a git worktree and start development environment.
commit-all
Group all changes semantically and commit each group separately.
package
Build Android/macOS/Windows release packages into release/ /.
testflight
Build iOS release IPA and upload a new TestFlight build (auto-bumps CFBundleVersion).