Skip to main content

agent-cost

Estimate the cost of the current coding task with the agent-cost CLI. Use when a user asks what an agent run may cost, which configured model is the balanced choice, or invokes /agent-cost before starting coding work.

Quellinformationen

Repository
devinat1/agent-cost
Letzte Quellaktivität
11. Juli 2026 um 16:11
Erkannte Sprache von SKILL.md
Englisch
Sterne
0
Forks
0

Installationsoptionen

Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.

Quelldateien prüfen

Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.

Datei-Explorer
2 Dateien

SKILL.md wird angezeigt

SKILL.md
Quellanweisungen · Schreibgeschützte Vorschau
name
agent-cost
description
Estimate the cost of the current coding task with the agent-cost CLI. Use when a user asks what an agent run may cost, which configured model is the balanced choice, or invokes /agent-cost before starting coding work.
# Agent Cost Infer the concrete coding task from the current conversation and estimate it in the current Git repository. Ask for task text only when the conversation does not contain a concrete task. ## Run the estimate 1. Confirm the workspace is a Git repository and `git ls-files` returns at least one file. Stop clearly if either check fails. Never add untracked content to the estimate. 2. Check `node --version` is at least 22.12 and `npm --version` succeeds. If not, stop and direct the user to install a current Node.js LTS release from nodejs.org; do not install Node or npm. 3. If the `agent-cost` executable is unavailable, run: ```sh npm install --global @devinat1/agent-cost ``` 4. Use the current workspace as `--repo`. Pass the inferred task as one argument without interpolating it into shell syntax. Prefer an argv-capable execution tool; otherwise write it to a secure temporary file with platform APIs, pass `--task @<path>`, and delete the file afterward. 5. Use a user-provided budget override when present; otherwise use `0.50`. Run: ```sh agent-cost preflight --repo <workspace> --task <task-or-@file> --probe-budget <budget> --yes --json ``` 6. If the command reports that no profile exists, run `agent-cost profile` in an interactive terminal. This securely prompts for a missing OpenRouter key, saves it in the user config directory, and launches model/access setup. Then rerun the preflight once. Invoking this skill authorizes the bounded paid preflight and transmission of the CLI's displayed Git-tracked context through OpenRouter. Do not ask for another confirmation. Never print, echo, read back, or place the API key in a repository. ## Return the result Read the final JSON result. Find `recommendations.balanced`, then the matching entry in `models`. Return only: - model ID and its configured access path or paths; - predicted `costUsd.low`–`costUsd.high` range; - confidence. If no balanced model exists or the command fails, return one short cause and the next action. Do not run `record` or `history`.
Auf GitHub ansehen