@agent-wechat/cli 0.2.0 → 0.2.1

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 +2 -1
  2. package/dist/cli.js +10 -7
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -13,7 +13,8 @@ This installs the `wx` command globally.
13
13
  ## Prerequisites
14
14
 
15
15
  - [Docker](https://docs.docker.com/get-docker/) installed and running
16
- - An agent-wechat Docker image — pull from ghcr.io or build locally (see [Docker Image](#docker-image))
16
+
17
+ `wx up` automatically pulls the Docker image from ghcr.io if it isn't found locally.
17
18
 
18
19
  > **Note:** agent-wechat requires `SYS_PTRACE` and `seccomp=unconfined` to interact with the WeChat desktop process. It cannot run in serverless or restricted container environments (AWS Fargate, Cloud Run, etc.). Use a VM or bare-metal Docker host.
19
20
 
package/dist/cli.js CHANGED
@@ -7906,6 +7906,7 @@ import path from "path";
7906
7906
  import { fileURLToPath } from "url";
7907
7907
  var VERSION = "0.1.0";
7908
7908
  var CONTAINER_NAME = "agent-wechat";
7909
+ var GHCR_IMAGE = "ghcr.io/thisnick/agent-wechat";
7909
7910
  var DEFAULT_PORT = 6174;
7910
7911
  var VNC_PORT = 5900;
7911
7912
  var __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -7939,9 +7940,7 @@ function getConfig() {
7939
7940
  };
7940
7941
  }
7941
7942
  function getImageTag() {
7942
- const arch = os.arch();
7943
- if (arch === "arm64") return "agent-wechat:arm64";
7944
- return "agent-wechat:amd64";
7943
+ return `${GHCR_IMAGE}:latest`;
7945
7944
  }
7946
7945
  var program2 = new Command();
7947
7946
  program2.name("wx").description("WeChat automation CLI").version(VERSION).option("-s, --session <name>", "Use specified session", "default");
@@ -8438,9 +8437,13 @@ async function cmdUp() {
8438
8437
  try {
8439
8438
  execSync(`docker image inspect ${image}`, { stdio: "ignore" });
8440
8439
  } catch {
8441
- console.error(`Image ${image} not found.`);
8442
- console.error(`Run 'pnpm build:image' first to build the image.`);
8443
- process.exit(1);
8440
+ console.log(`Image ${image} not found locally. Pulling...`);
8441
+ try {
8442
+ execSync(`docker pull ${image}`, { stdio: "inherit" });
8443
+ } catch {
8444
+ console.error(`Failed to pull ${image}. Check your internet connection and Docker setup.`);
8445
+ process.exit(1);
8446
+ }
8444
8447
  }
8445
8448
  const token = ensureToken();
8446
8449
  console.log(`Starting container ${CONTAINER_NAME} from ${image}...`);
@@ -8484,7 +8487,7 @@ Waiting for server to be ready...`);
8484
8487
  await new Promise((r) => setTimeout(r, 1e3));
8485
8488
  process.stdout.write(".");
8486
8489
  }
8487
- console.log("\nServer did not become ready in time. Check logs with: pnpm cli logs");
8490
+ console.log("\nServer did not become ready in time. Check logs with: wx logs");
8488
8491
  } catch (error) {
8489
8492
  console.error("Failed to start container:", error);
8490
8493
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-wechat/cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "wx": "./dist/cli.js"