whatsapp-web-cli 0.1.0 → 0.2.0

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 +19 -1
  2. package/dist/wwa.js +40 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -40,6 +40,18 @@ Then run the command you actually need:
40
40
  wwa chat-search "Name" --json
41
41
  ```
42
42
 
43
+ To install the bundled Codex skill for local agent use:
44
+
45
+ ```bash
46
+ wwa skill install --json
47
+ ```
48
+
49
+ By default this writes:
50
+
51
+ ```text
52
+ ~/.codex/skills/whatsapp-cli/SKILL.md
53
+ ```
54
+
43
55
  If WhatsApp is not logged in, data commands return a JSON object like:
44
56
 
45
57
  ```json
@@ -169,10 +181,16 @@ You should only need to scan a QR again if WhatsApp invalidates the linked devic
169
181
 
170
182
  ## Codex Skill
171
183
 
172
- The generic skill lives at:
184
+ The generic skill is included in the package at:
173
185
 
174
186
  ```text
175
187
  skills/whatsapp-cli/SKILL.md
176
188
  ```
177
189
 
190
+ Install or update it for Codex with:
191
+
192
+ ```bash
193
+ wwa skill install --json
194
+ ```
195
+
178
196
  It teaches agents to use the CLI directly, without MCP, and keeps transcription/classification workflows outside the low-level CLI.
package/dist/wwa.js CHANGED
@@ -326990,6 +326990,13 @@ var {
326990
326990
  Help
326991
326991
  } = import__.default;
326992
326992
 
326993
+ // src/cli.ts
326994
+ import { copyFile as copyFile2, mkdir as mkdir5 } from "node:fs/promises";
326995
+ import { existsSync } from "node:fs";
326996
+ import { homedir as homedir2 } from "node:os";
326997
+ import { dirname as dirname7, join as join2, resolve as resolve9 } from "node:path";
326998
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
326999
+
326993
327000
  // src/daemon.ts
326994
327001
  import { createServer } from "node:http";
326995
327002
  import { readFile as readFile3 } from "node:fs/promises";
@@ -342824,6 +342831,11 @@ async function main(argv) {
342824
342831
  program2.command("paths").description("Show local runtime paths.").option("--json", "Print JSON output.").action((options) => {
342825
342832
  output(options, paths, paths);
342826
342833
  });
342834
+ const skill = program2.command("skill").description("Install helper files for agent integrations.");
342835
+ skill.command("install").description("Install the bundled Codex skill into a local Codex skills directory.").option("--dir <path>", "Codex skills directory.", join2(homedir2(), ".codex", "skills")).option("--name <name>", "Installed skill directory name.", "whatsapp-cli").option("--json", "Print JSON output.").action(async (options) => {
342836
+ const result = await installCodexSkill(options);
342837
+ output(options, result, `Installed ${result.name} skill at ${result.installedPath}`);
342838
+ });
342827
342839
  try {
342828
342840
  await program2.parseAsync(argv);
342829
342841
  } catch (error51) {
@@ -342842,6 +342854,34 @@ function output(options, data, human) {
342842
342854
  function isTimeoutResult(value) {
342843
342855
  return Boolean(value && typeof value === "object" && "timedOut" in value && value.timedOut === true);
342844
342856
  }
342857
+ async function installCodexSkill(options) {
342858
+ const sourcePath = resolveBundledSkillPath();
342859
+ const skillRoot = resolve9(options.dir);
342860
+ const installedDir = join2(skillRoot, options.name);
342861
+ const installedPath = join2(installedDir, "SKILL.md");
342862
+ await mkdir5(installedDir, { recursive: true });
342863
+ await copyFile2(sourcePath, installedPath);
342864
+ return {
342865
+ ok: true,
342866
+ name: options.name,
342867
+ sourcePath,
342868
+ installedPath,
342869
+ skillsDir: skillRoot
342870
+ };
342871
+ }
342872
+ function resolveBundledSkillPath() {
342873
+ const moduleDir = dirname7(fileURLToPath2(import.meta.url));
342874
+ const candidates = [
342875
+ join2(moduleDir, "..", "skills", "whatsapp-cli", "SKILL.md"),
342876
+ join2(moduleDir, "skills", "whatsapp-cli", "SKILL.md"),
342877
+ join2(process.cwd(), "skills", "whatsapp-cli", "SKILL.md")
342878
+ ];
342879
+ const found = candidates.find((candidate) => existsSync(candidate));
342880
+ if (!found) {
342881
+ throw new Error(`Could not find bundled whatsapp-cli skill. Checked: ${candidates.join(", ")}`);
342882
+ }
342883
+ return found;
342884
+ }
342845
342885
  async function ensureReady(options, waitSeconds = 60) {
342846
342886
  let status;
342847
342887
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whatsapp-web-cli",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "A local WhatsApp Web CLI for agents and scripts.",
5
5
  "type": "module",
6
6
  "bin": {