pi-cliproxyapi-autoconnect 1.2.3 → 1.2.4

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 (3) hide show
  1. package/README.md +7 -0
  2. package/index.ts +12 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -144,6 +144,8 @@ An Anthropic-compatible endpoint does not always expose a model list. If `/v1/mo
144
144
  /cliproxy clear Delete the saved config and its backup
145
145
  ```
146
146
 
147
+ The extension registers one top-level command, `/cliproxy`; `refresh` and `clear` are arguments. In the TUI, type `/cliproxy ` (with a trailing space) to see argument completions.
148
+
147
149
  The model catalog is cached for **5 minutes** by default: opening `/model` does not hit the upstream every time. `/cliproxy refresh` forces a refresh.
148
150
 
149
151
  Running `/logout` only removes the credential from pi's `auth.json`; the saved `cliproxy.json` is intentionally kept so a later `/login` can reuse it. While signed out, `/cliproxy` reports that CLIProxy is not signed in instead of showing the old endpoint as active. Use `/cliproxy clear` if you want to remove the saved domain, endpoint and model cache as well.
@@ -293,6 +295,11 @@ Run `/reload`, or restart pi after editing the plugin. The model list refreshes
293
295
 
294
296
  ## Changelog
295
297
 
298
+ ### 1.2.4
299
+
300
+ - Added argument completions for `/cliproxy`: typing `/cliproxy ` now suggests `refresh` and `clear` in the TUI.
301
+ - The extension still registers a single top-level command; subcommands remain arguments rather than separate slash commands.
302
+
296
303
  ### 1.2.3
297
304
 
298
305
  - `/cliproxy` now checks whether CLIProxy is actually signed in. After `/logout` it reports “not signed in” instead of displaying the previous endpoint and model count as if they were active.
package/index.ts CHANGED
@@ -638,7 +638,7 @@ async function fetchOpenAIModels(baseUrl: string, apiKey: string, signal: AbortS
638
638
  headers: {
639
639
  Accept: "application/json",
640
640
  Authorization: `Bearer ${apiKey}`,
641
- "User-Agent": "pi-cliproxyapi-autoconnect/1.2.3",
641
+ "User-Agent": "pi-cliproxyapi-autoconnect/1.2.4",
642
642
  },
643
643
  signal: requestSignal,
644
644
  });
@@ -662,7 +662,7 @@ async function fetchGeminiModels(baseUrl: string, apiKey: string, signal: AbortS
662
662
  const { signal: requestSignal, cleanup } = abortSignalWithTimeout(signal, REQUEST_TIMEOUT_MS);
663
663
  try {
664
664
  const response = await fetch(url, {
665
- headers: { Accept: "application/json", "User-Agent": "pi-cliproxyapi-autoconnect/1.2.3" },
665
+ headers: { Accept: "application/json", "User-Agent": "pi-cliproxyapi-autoconnect/1.2.4" },
666
666
  signal: requestSignal,
667
667
  });
668
668
  if (!response.ok) {
@@ -703,7 +703,7 @@ async function fetchAnthropicModels(baseUrl: string, apiKey: string, signal: Abo
703
703
  // Anthropic's x-api-key header; sending both is harmless upstream.
704
704
  Authorization: `Bearer ${apiKey}`,
705
705
  "anthropic-version": "2023-06-01",
706
- "User-Agent": "pi-cliproxyapi-autoconnect/1.2.3",
706
+ "User-Agent": "pi-cliproxyapi-autoconnect/1.2.4",
707
707
  },
708
708
  signal: requestSignal,
709
709
  });
@@ -1255,6 +1255,15 @@ export default function (pi: ExtensionAPI): void {
1255
1255
 
1256
1256
  pi.registerCommand("cliproxy", {
1257
1257
  description: "Show CLIProxy config, refresh models, or clear the saved config",
1258
+ getArgumentCompletions: (argumentPrefix) => {
1259
+ const prefix = argumentPrefix.trim().toLowerCase();
1260
+ const items = [
1261
+ { value: "refresh", label: "refresh", description: "Refresh the CLIProxy model list" },
1262
+ { value: "clear", label: "clear", description: "Delete the saved CLIProxy config and backup" },
1263
+ ];
1264
+ const matches = items.filter((item) => item.value.startsWith(prefix));
1265
+ return matches.length > 0 ? matches : null;
1266
+ },
1258
1267
  handler: async (args, ctx) => {
1259
1268
  const subcommand = args.trim().toLowerCase();
1260
1269
  const config = readConfig();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-cliproxyapi-autoconnect",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "CLIProxyAPI auto-connect provider for pi: sign in with a bound domain and API key, automatically discover OpenAI/Gemini/Anthropic-compatible endpoints, and register models in /model.",
5
5
  "type": "module",
6
6
  "license": "MIT",