clishop 1.3.1 → 1.3.3

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 +24 -2
  2. package/dist/index.js +80 -7
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -42,7 +42,7 @@ CLISHOP is an open-source CLI that lets AI agents and humans search for products
42
42
 
43
43
  ## Install
44
44
 
45
- Requires **Node.js ≥ 18**.
45
+ Requires **Node.js ≥ 18**. Works on macOS, Windows, and Linux/WSL.
46
46
 
47
47
  ```bash
48
48
  npm install -g clishop
@@ -50,7 +50,19 @@ npm install -g clishop
50
50
 
51
51
  This gives you two commands: `clishop` (the CLI) and `clishop-mcp` (the MCP server for AI agents).
52
52
 
53
- To install from source instead:
53
+ ### Linux / WSL
54
+
55
+ CLISHOP works out of the box on Linux and WSL. On systems without a native keychain, tokens are stored in a local file (`~/.config/clishop/auth.json`) with restricted permissions.
56
+
57
+ For native keychain support (optional):
58
+
59
+ ```bash
60
+ sudo apt install libsecret-1-0
61
+ ```
62
+
63
+ Run `clishop doctor` to check your system's compatibility.
64
+
65
+ ### From source
54
66
 
55
67
  ```bash
56
68
  git clone https://github.com/DavooxBv2/CLISHOP.git
@@ -105,6 +117,16 @@ clishop buy 1
105
117
 
106
118
  > **Tip:** use result numbers from a search anywhere — `clishop info 1 2 3` or `clishop buy 2`.
107
119
 
120
+ ### Diagnostics
121
+
122
+ If something isn't working, run:
123
+
124
+ ```bash
125
+ clishop doctor
126
+ ```
127
+
128
+ This checks keychain availability, token storage, authentication status, and API connectivity.
129
+
108
130
  ---
109
131
 
110
132
  ## Architecture
package/dist/index.js CHANGED
@@ -936,7 +936,7 @@ async function runSetupWizard() {
936
936
  console.log();
937
937
  console.log(chalk4.bold.cyan(" W E L C O M E T O C L I S H O P"));
938
938
  console.log(chalk4.dim(" Order anything from your terminal."));
939
- console.log(chalk4.dim(` Build: ${"2026-03-22T16:20:26.194Z"}`));
939
+ console.log(chalk4.dim(` Build: ${"2026-03-22T18:05:29.439Z"}`));
940
940
  console.log();
941
941
  divider(chalk4.cyan);
942
942
  console.log();
@@ -988,18 +988,91 @@ async function runSetupWizard() {
988
988
  console.log();
989
989
  console.log(" " + chalk4.cyan.underline(webSetupUrl));
990
990
  console.log();
991
- console.log(
992
- chalk4.dim(" Complete the setup there, then return here and run:")
993
- );
994
- console.log(chalk4.dim(" ") + chalk4.white("clishop login"));
995
- console.log();
996
991
  const opened = await openBrowser(webSetupUrl);
997
992
  if (!opened) {
998
993
  console.log(
999
994
  chalk4.yellow(" Could not open browser automatically. Please visit the link above.")
1000
995
  );
1001
996
  }
997
+ console.log(
998
+ chalk4.dim(" Create your account and configure everything on the website.")
999
+ );
1000
+ console.log(
1001
+ chalk4.dim(" When you're done, come back here to link your account to the CLI.")
1002
+ );
1003
+ console.log();
1004
+ await inquirer4.prompt([
1005
+ {
1006
+ type: "input",
1007
+ name: "done",
1008
+ message: "Press Enter after completing setup on the website..."
1009
+ }
1010
+ ]);
1011
+ console.log();
1012
+ console.log(chalk4.bold(" Now let's link your account to the CLI."));
1013
+ console.log();
1014
+ const creds = await inquirer4.prompt([
1015
+ { type: "input", name: "email", message: "Email (same as on the website):" },
1016
+ { type: "password", name: "password", message: "Password:", mask: "*" }
1017
+ ]);
1018
+ const spinner = ora3("Logging in...").start();
1019
+ try {
1020
+ const user = await login(creds.email, creds.password);
1021
+ spinner.succeed(chalk4.green(`Logged in as ${chalk4.bold(user.name)}.`));
1022
+ } catch (error) {
1023
+ spinner.fail(
1024
+ chalk4.red(
1025
+ `Login failed: ${error?.response?.data?.message || error.message}`
1026
+ )
1027
+ );
1028
+ console.log();
1029
+ console.log(
1030
+ chalk4.dim(" You can try again with: ") + chalk4.white("clishop login")
1031
+ );
1032
+ console.log();
1033
+ config.set("setupCompleted", true);
1034
+ return;
1035
+ }
1036
+ const syncSpinner = ora3("Syncing your settings from the website...").start();
1037
+ try {
1038
+ const api = getApiClient();
1039
+ const agent = getActiveAgent();
1040
+ await ensureAgentOnBackend(agent.name);
1041
+ const [addrRes, pmRes] = await Promise.all([
1042
+ api.get("/addresses", { params: { agent: agent.name } }),
1043
+ api.get("/payment-methods", { params: { agent: agent.name } })
1044
+ ]);
1045
+ const addresses = addrRes.data.addresses || [];
1046
+ const methods = pmRes.data.paymentMethods || [];
1047
+ const synced = [];
1048
+ if (addresses.length > 0) {
1049
+ updateAgent(agent.name, { defaultAddressId: addresses[0].id });
1050
+ synced.push(`address "${addresses[0].label || "Home"}"`);
1051
+ }
1052
+ if (methods.length > 0) {
1053
+ updateAgent(agent.name, { defaultPaymentMethodId: methods[0].id });
1054
+ synced.push(`payment "${methods[0].label}"`);
1055
+ }
1056
+ if (synced.length > 0) {
1057
+ syncSpinner.succeed(chalk4.green(`Synced: ${synced.join(", ")}`));
1058
+ } else {
1059
+ syncSpinner.info(
1060
+ chalk4.dim("No addresses or payment methods found yet. You can add them with:") + "\n " + chalk4.white("clishop address add") + "\n " + chalk4.white("clishop payment add")
1061
+ );
1062
+ }
1063
+ } catch {
1064
+ syncSpinner.warn(chalk4.yellow("Could not sync settings \u2014 you can add them manually later."));
1065
+ }
1002
1066
  config.set("setupCompleted", true);
1067
+ console.log();
1068
+ divider(chalk4.green);
1069
+ console.log();
1070
+ console.log(chalk4.bold.green(" \u2713 You're all set!"));
1071
+ console.log();
1072
+ console.log(chalk4.dim(" Try: ") + chalk4.white('clishop search "headphones"'));
1073
+ console.log();
1074
+ divider(chalk4.green);
1075
+ console.log();
1003
1076
  return;
1004
1077
  }
1005
1078
  stepHeader(1, 5, "Account");
@@ -4644,7 +4717,7 @@ function registerDoctorCommand(program2) {
4644
4717
 
4645
4718
  // src/index.ts
4646
4719
  var program = new Command();
4647
- program.name("clishop").version("1.3.0").description(
4720
+ program.name("clishop").version("1.3.1").description(
4648
4721
  chalk16.bold("CLISHOP") + ' \u2014 Order anything from your terminal.\n\n Use agents to set safety limits, addresses, and payment methods.\n The "default" agent is used when no agent is specified.'
4649
4722
  ).option("--agent <name>", "Use a specific agent for this command").hook("preAction", (thisCommand) => {
4650
4723
  const agentOpt = thisCommand.opts().agent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clishop",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "mcpName": "io.github.StefDCL/clishop",
5
5
  "description": "CLISHOP — Order anything from your terminal",
6
6
  "main": "dist/index.js",