taskair-cli 1.0.9 → 1.0.10

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 +1 -4
  2. package/dist/index.js +11 -44
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -28,10 +28,7 @@ Run the configuration command and follow the prompt to open the browser for auth
28
28
  taskair config
29
29
  ```
30
30
 
31
- You will be prompted to enter:
32
- * **API URL**: The URL of your running TaskAir server (e.g., `http://localhost:3001` or your production domain).
33
-
34
- After pressing Enter, a web browser window will open automatically. Complete your sign-in or enter your Master Password on the website to link your CLI terminal.
31
+ After running the command, a web browser window will open automatically. Complete your sign-in or enter your Master Password on the website to link your CLI terminal. The API URL is automatically preconfigured to point to our production endpoint (`https://api-taskair.vercel.app`).
35
32
 
36
33
  ### 2. Verify Session
37
34
 
package/dist/index.js CHANGED
@@ -69,7 +69,7 @@ function readCredentials() {
69
69
  const raw = parseIni(content);
70
70
  const rawExpires = raw.expires_at ? parseInt(raw.expires_at, 10) : void 0;
71
71
  return {
72
- api_url: raw.api_url || "http://localhost:3001",
72
+ api_url: raw.api_url || "https://api-taskair.vercel.app",
73
73
  email: raw.email || "",
74
74
  access_token: raw.access_token || void 0,
75
75
  refresh_token: raw.refresh_token || void 0,
@@ -383,35 +383,16 @@ function openBrowser(url) {
383
383
  const cmd = process.platform === "win32" ? `start "" "${url}"` : `${start} "${url}"`;
384
384
  exec(cmd);
385
385
  }
386
- function ConfigUI({ initialApiUrl }) {
386
+ function ConfigUI() {
387
387
  const { exit } = useApp();
388
- const [stage, setStage] = useState4("input_api_url");
389
- const [apiUrl, setApiUrl] = useState4(initialApiUrl);
390
- const [currentInput, setCurrentInput] = useState4(initialApiUrl);
388
+ const [stage, setStage] = useState4("waiting_for_browser");
389
+ const apiUrl = "https://api-taskair.vercel.app";
391
390
  const [port, setPort] = useState4(0);
392
391
  const [errorMsg, setErrorMsg] = useState4("");
393
392
  const [authDetails, setAuthDetails] = useState4(null);
394
393
  useInput((input, key) => {
395
- if (stage === "input_api_url") {
396
- if (key.return) {
397
- if (!currentInput.trim()) {
398
- setErrorMsg("API URL cannot be empty");
399
- return;
400
- }
401
- setErrorMsg("");
402
- setApiUrl(currentInput.trim());
403
- setStage("waiting_for_browser");
404
- } else if (key.backspace || key.delete) {
405
- setCurrentInput((v) => v.slice(0, -1));
406
- } else if (key.escape) {
407
- exit();
408
- } else {
409
- setCurrentInput((v) => v + input);
410
- }
411
- } else {
412
- if (key.escape) {
413
- exit();
414
- }
394
+ if (key.escape) {
395
+ exit();
415
396
  }
416
397
  });
417
398
  useEffect4(() => {
@@ -656,18 +637,7 @@ function ConfigUI({ initialApiUrl }) {
656
637
  }, [stage, authDetails, apiUrl]);
657
638
  return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", padding: 1, children: [
658
639
  /* @__PURE__ */ jsx4(AsciiHeader, {}),
659
- /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", marginBottom: 1, children: [
660
- /* @__PURE__ */ jsx4(Text4, { color: "cyan", bold: true, children: "\u2726 Configure TaskAir" }),
661
- stage === "input_api_url" && /* @__PURE__ */ jsx4(Text4, { color: "gray", children: "Enter the API URL of your TaskAir instance. Press Enter to confirm." })
662
- ] }),
663
- stage === "input_api_url" && /* @__PURE__ */ jsxs4(Box4, { children: [
664
- /* @__PURE__ */ jsx4(Text4, { color: "cyan", bold: true, children: "\u2192 " }),
665
- /* @__PURE__ */ jsx4(Text4, { color: "white", children: "API URL: " }),
666
- /* @__PURE__ */ jsxs4(Text4, { color: "cyan", children: [
667
- currentInput,
668
- /* @__PURE__ */ jsx4(Text4, { color: "white", children: "\u258C" })
669
- ] })
670
- ] }),
640
+ /* @__PURE__ */ jsx4(Box4, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsx4(Text4, { color: "cyan", bold: true, children: "\u2726 Configure TaskAir" }) }),
671
641
  stage === "waiting_for_browser" && /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", gap: 0.5, children: [
672
642
  /* @__PURE__ */ jsxs4(Text4, { color: "cyan", children: [
673
643
  "\u2713 API URL set to: ",
@@ -689,17 +659,14 @@ function ConfigUI({ initialApiUrl }) {
689
659
  ] }),
690
660
  stage === "success" && /* @__PURE__ */ jsx4(Box4, { marginTop: 1, children: /* @__PURE__ */ jsx4(StatusBadge, { type: "success", message: "Configuration saved successfully! E2E Encryption Active." }) }),
691
661
  stage === "error" && /* @__PURE__ */ jsx4(Box4, { marginTop: 1, children: /* @__PURE__ */ jsx4(StatusBadge, { type: "error", message: errorMsg }) }),
692
- (stage === "input_api_url" || stage === "waiting_for_browser") && /* @__PURE__ */ jsx4(Box4, { marginTop: 1, children: /* @__PURE__ */ jsx4(Text4, { color: "gray", dimColor: true, children: "Press Esc to cancel" }) })
662
+ stage === "waiting_for_browser" && /* @__PURE__ */ jsx4(Box4, { marginTop: 1, children: /* @__PURE__ */ jsx4(Text4, { color: "gray", dimColor: true, children: "Press Esc to cancel" }) })
693
663
  ] });
694
664
  }
695
665
  function registerConfig(program2) {
696
666
  program2.command("config").alias("configure").description("Authenticate and configure CLI via browser").action(async () => {
697
- const existing = readCredentials();
698
667
  const { render } = await import("ink");
699
668
  render(
700
- React4.createElement(ConfigUI, {
701
- initialApiUrl: existing?.api_url ?? "http://localhost:3001"
702
- })
669
+ React4.createElement(ConfigUI)
703
670
  );
704
671
  });
705
672
  }
@@ -719,7 +686,7 @@ function LoginUI() {
719
686
  const [errorMsg, setErrorMsg] = useState5("");
720
687
  useEffect5(() => {
721
688
  if (stage === "loading") {
722
- const apiUrl = creds?.api_url ?? "http://localhost:3001";
689
+ const apiUrl = creds?.api_url ?? "https://api-taskair.vercel.app";
723
690
  apiLogin(apiUrl, email, password).then(async (res) => {
724
691
  if (res.success && res.data) {
725
692
  const accessToken = res.data.access_token;
@@ -2169,7 +2136,7 @@ import { Box as Box16, Text as Text16, useApp as useApp11 } from "ink";
2169
2136
  import { exec as exec2 } from "child_process";
2170
2137
 
2171
2138
  // src/lib/version.ts
2172
- var CLI_VERSION = "1.0.7";
2139
+ var CLI_VERSION = "1.0.10";
2173
2140
 
2174
2141
  // src/commands/upgrade.tsx
2175
2142
  import { jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskair-cli",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Space-themed, privacy-first task management CLI with E2E encryption",
5
5
  "type": "module",
6
6
  "bin": {