claude-finops 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/run.py +30 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-finops",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Local FinOps dashboard for Claude Code: what you used, what it cost, why it cost that much, and what to change. Reads your own transcripts, no API key, no data leaves the machine.",
5
5
  "bin": {
6
6
  "claude-finops": "bin/claude-finops.js"
package/run.py CHANGED
@@ -93,6 +93,7 @@ HELP = """Claude FinOps Command Center
93
93
  claude-finops --set-key store a provider API key (prompts, never echoes)
94
94
  claude-finops --keys list which provider keys are configured
95
95
  claude-finops --share write ../claude-finops.zip (code only, never your data)
96
+ claude-finops --version print the installed version, and whether a newer one is out
96
97
  claude-finops --help this message
97
98
 
98
99
  Environment:
@@ -104,6 +105,33 @@ Environment:
104
105
  """
105
106
 
106
107
 
108
+ def version():
109
+ """Which copy is this, and is it current?
110
+
111
+ The second half matters more than the first: people run a global install and
112
+ a repo checkout side by side, and the usual confusion is not "what version
113
+ am I on" but "why does the one I am looking at not have the feature".
114
+ """
115
+ from finops.update import check, disabled, _key
116
+ # Asking outright is worth a fresh request: a day-old cached answer is the
117
+ # one thing this command must not give you.
118
+ u = check(force=True)
119
+ print(f" claude-finops {u['current'] or 'unknown'}")
120
+ print(f" installed at {ROOT}")
121
+ if u.get("update_available"):
122
+ print(f" update {u['latest']} is out - {u['command']}")
123
+ elif disabled():
124
+ print(" update check is off (NO_UPDATE_NOTIFIER)")
125
+ elif u.get("latest") and _key(u["current"]) > _key(u["latest"]):
126
+ # A checkout mid-release is ahead of what is published. Saying "up to
127
+ # date" there would hide exactly the gap you are looking for.
128
+ print(f" update ahead of npm (published latest is {u['latest']})")
129
+ elif u.get("latest"):
130
+ print(f" update up to date (npm latest is {u['latest']})")
131
+ else:
132
+ print(" update could not reach the npm registry")
133
+
134
+
107
135
  def where():
108
136
  from finops.paths import (HOME_DIR, DB_PATH, LOCAL_SETTINGS_PATH, SECRETS_PATH,
109
137
  LOGFILE, CONFIG_DIR)
@@ -180,6 +208,8 @@ def main():
180
208
  migrate()
181
209
  if "--help" in args or "-h" in args:
182
210
  return print(HELP)
211
+ if "--version" in args or "-v" in args or "-V" in args:
212
+ return version()
183
213
  if "--where" in args:
184
214
  return where()
185
215
  if "--keys" in args: