feat(plugins): add Command Code plugin#476
Closed
ec812 wants to merge 1 commit into
Closed
Conversation
Adds support for Command Code AI usage tracking with monthly credit progress bar, total spend, token usage, and per-model breakdown. Reads API key from ~/.commandcode/auth.json or COMMAND_CODE_API_KEY env var.
Contributor
There was a problem hiding this comment.
1 issue found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="plugins/command-code/plugin.js">
<violation number="1" location="plugins/command-code/plugin.js:22">
P2: `COMMAND_CODE_API_KEY` env auth path silently fails at runtime because the host API allowlist (`WHITELISTED_ENV_VARS` in `src-tauri/src/plugin_engine/host_api.rs`) does not include this key, causing the plugin to fall back to file auth without warning and breaking the documented env-based authentication.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
|
|
||
| function loadApiKeyFromEnv(ctx) { | ||
| try { | ||
| var value = ctx.host.env.get("COMMAND_CODE_API_KEY") |
Contributor
There was a problem hiding this comment.
P2: COMMAND_CODE_API_KEY env auth path silently fails at runtime because the host API allowlist (WHITELISTED_ENV_VARS in src-tauri/src/plugin_engine/host_api.rs) does not include this key, causing the plugin to fall back to file auth without warning and breaking the documented env-based authentication.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At plugins/command-code/plugin.js, line 22:
<comment>`COMMAND_CODE_API_KEY` env auth path silently fails at runtime because the host API allowlist (`WHITELISTED_ENV_VARS` in `src-tauri/src/plugin_engine/host_api.rs`) does not include this key, causing the plugin to fall back to file auth without warning and breaking the documented env-based authentication.</comment>
<file context>
@@ -0,0 +1,227 @@
+
+ function loadApiKeyFromEnv(ctx) {
+ try {
+ var value = ctx.host.env.get("COMMAND_CODE_API_KEY")
+ if (typeof value !== "string") return null
+ var trimmed = value.trim()
</file context>
Owner
|
Hi, I've decided to decline new plugins for the time being. They've become unmaintanable, as I don't own most of these subscriptions and that results in slop (can't test them myself). Maybe this will change in the future. Thank you |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a plugin for Command Code (
cmd) that uses the Command Code API to display usage metrics in the menu bar.Endpoints: /alpha/whoami, /alpha/billing/credits, /alpha/billing/subscriptions, /alpha/usage/summary
Auth: ~/.commandcode/auth.json or COMMAND_CODE_API_KEY env var
Tests: 13 unit tests passing
Summary by cubic
Adds the Command Code (
cmd) plugin to show usage in the menu bar: monthly credit progress, total spend, tokens, and per‑model usage. Pulls data from the Command Code API and handles auth and error states cleanly.~/.commandcode/auth.jsonorCOMMAND_CODE_API_KEY./alpha/whoami,/alpha/billing/credits,/alpha/billing/subscriptions,/alpha/usage/summary.#000000).Written for commit 8920146. Summary will update on new commits. Review in cubic