agent-messenger 2.0.0 → 2.1.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 (119) hide show
  1. package/.claude-plugin/marketplace.json +14 -1
  2. package/.claude-plugin/plugin.json +4 -2
  3. package/README.md +33 -29
  4. package/dist/package.json +10 -2
  5. package/dist/src/cli.d.ts.map +1 -1
  6. package/dist/src/cli.js +3 -0
  7. package/dist/src/cli.js.map +1 -1
  8. package/dist/src/platforms/webex/app-config.d.ts +7 -0
  9. package/dist/src/platforms/webex/app-config.d.ts.map +1 -0
  10. package/dist/src/platforms/webex/app-config.js +20 -0
  11. package/dist/src/platforms/webex/app-config.js.map +1 -0
  12. package/dist/src/platforms/webex/cli.d.ts +5 -0
  13. package/dist/src/platforms/webex/cli.d.ts.map +1 -0
  14. package/dist/src/platforms/webex/cli.js +32 -0
  15. package/dist/src/platforms/webex/cli.js.map +1 -0
  16. package/dist/src/platforms/webex/client.d.ts +45 -0
  17. package/dist/src/platforms/webex/client.d.ts.map +1 -0
  18. package/dist/src/platforms/webex/client.js +175 -0
  19. package/dist/src/platforms/webex/client.js.map +1 -0
  20. package/dist/src/platforms/webex/commands/auth.d.ts +15 -0
  21. package/dist/src/platforms/webex/commands/auth.d.ts.map +1 -0
  22. package/dist/src/platforms/webex/commands/auth.js +124 -0
  23. package/dist/src/platforms/webex/commands/auth.js.map +1 -0
  24. package/dist/src/platforms/webex/commands/index.d.ts +6 -0
  25. package/dist/src/platforms/webex/commands/index.d.ts.map +1 -0
  26. package/dist/src/platforms/webex/commands/index.js +6 -0
  27. package/dist/src/platforms/webex/commands/index.js.map +1 -0
  28. package/dist/src/platforms/webex/commands/member.d.ts +7 -0
  29. package/dist/src/platforms/webex/commands/member.d.ts.map +1 -0
  30. package/dist/src/platforms/webex/commands/member.js +34 -0
  31. package/dist/src/platforms/webex/commands/member.js.map +1 -0
  32. package/dist/src/platforms/webex/commands/message.d.ts +26 -0
  33. package/dist/src/platforms/webex/commands/message.d.ts.map +1 -0
  34. package/dist/src/platforms/webex/commands/message.js +153 -0
  35. package/dist/src/platforms/webex/commands/message.js.map +1 -0
  36. package/dist/src/platforms/webex/commands/snapshot.d.ts +9 -0
  37. package/dist/src/platforms/webex/commands/snapshot.d.ts.map +1 -0
  38. package/dist/src/platforms/webex/commands/snapshot.js +72 -0
  39. package/dist/src/platforms/webex/commands/snapshot.js.map +1 -0
  40. package/dist/src/platforms/webex/commands/space.d.ts +11 -0
  41. package/dist/src/platforms/webex/commands/space.d.ts.map +1 -0
  42. package/dist/src/platforms/webex/commands/space.js +59 -0
  43. package/dist/src/platforms/webex/commands/space.js.map +1 -0
  44. package/dist/src/platforms/webex/credential-manager.d.ts +23 -0
  45. package/dist/src/platforms/webex/credential-manager.d.ts.map +1 -0
  46. package/dist/src/platforms/webex/credential-manager.js +148 -0
  47. package/dist/src/platforms/webex/credential-manager.js.map +1 -0
  48. package/dist/src/platforms/webex/ensure-auth.d.ts +2 -0
  49. package/dist/src/platforms/webex/ensure-auth.d.ts.map +1 -0
  50. package/dist/src/platforms/webex/ensure-auth.js +20 -0
  51. package/dist/src/platforms/webex/ensure-auth.js.map +1 -0
  52. package/dist/src/platforms/webex/index.d.ts +6 -0
  53. package/dist/src/platforms/webex/index.d.ts.map +1 -0
  54. package/dist/src/platforms/webex/index.js +5 -0
  55. package/dist/src/platforms/webex/index.js.map +1 -0
  56. package/dist/src/platforms/webex/types.d.ts +124 -0
  57. package/dist/src/platforms/webex/types.d.ts.map +1 -0
  58. package/dist/src/platforms/webex/types.js +63 -0
  59. package/dist/src/platforms/webex/types.js.map +1 -0
  60. package/dist/src/tui/adapters/webex-adapter.d.ts +14 -0
  61. package/dist/src/tui/adapters/webex-adapter.d.ts.map +1 -0
  62. package/dist/src/tui/adapters/webex-adapter.js +79 -0
  63. package/dist/src/tui/adapters/webex-adapter.js.map +1 -0
  64. package/dist/src/tui/app.d.ts.map +1 -1
  65. package/dist/src/tui/app.js +2 -0
  66. package/dist/src/tui/app.js.map +1 -1
  67. package/docs/content/docs/cli/meta.json +1 -0
  68. package/docs/content/docs/cli/webex.mdx +291 -0
  69. package/docs/content/docs/sdk/meta.json +1 -1
  70. package/docs/content/docs/sdk/webex.mdx +260 -0
  71. package/docs/content/docs/tui.mdx +4 -3
  72. package/docs/src/app/page.tsx +2 -2
  73. package/package.json +10 -2
  74. package/skills/agent-channeltalk/SKILL.md +1 -1
  75. package/skills/agent-channeltalkbot/SKILL.md +1 -1
  76. package/skills/agent-discord/SKILL.md +1 -1
  77. package/skills/agent-discordbot/SKILL.md +1 -1
  78. package/skills/agent-instagram/SKILL.md +1 -1
  79. package/skills/agent-kakaotalk/SKILL.md +1 -1
  80. package/skills/agent-line/SKILL.md +1 -1
  81. package/skills/agent-slack/SKILL.md +1 -1
  82. package/skills/agent-slackbot/SKILL.md +1 -1
  83. package/skills/agent-teams/SKILL.md +1 -1
  84. package/skills/agent-telegram/SKILL.md +1 -1
  85. package/skills/agent-webex/SKILL.md +386 -0
  86. package/skills/agent-webex/references/authentication.md +318 -0
  87. package/skills/agent-webex/references/common-patterns.md +723 -0
  88. package/skills/agent-webex/templates/monitor-space.sh +165 -0
  89. package/skills/agent-webex/templates/post-message.sh +170 -0
  90. package/skills/agent-whatsapp/SKILL.md +1 -1
  91. package/skills/agent-whatsappbot/SKILL.md +1 -1
  92. package/src/cli.ts +4 -0
  93. package/src/platforms/webex/app-config.test.ts +98 -0
  94. package/src/platforms/webex/app-config.ts +31 -0
  95. package/src/platforms/webex/cli.test.ts +58 -0
  96. package/src/platforms/webex/cli.ts +39 -0
  97. package/src/platforms/webex/client.test.ts +429 -0
  98. package/src/platforms/webex/client.ts +247 -0
  99. package/src/platforms/webex/commands/auth.test.ts +222 -0
  100. package/src/platforms/webex/commands/auth.ts +180 -0
  101. package/src/platforms/webex/commands/index.ts +5 -0
  102. package/src/platforms/webex/commands/member.test.ts +103 -0
  103. package/src/platforms/webex/commands/member.ts +45 -0
  104. package/src/platforms/webex/commands/message.test.ts +231 -0
  105. package/src/platforms/webex/commands/message.ts +204 -0
  106. package/src/platforms/webex/commands/snapshot.test.ts +96 -0
  107. package/src/platforms/webex/commands/snapshot.ts +91 -0
  108. package/src/platforms/webex/commands/space.test.ts +206 -0
  109. package/src/platforms/webex/commands/space.ts +74 -0
  110. package/src/platforms/webex/credential-manager.test.ts +314 -0
  111. package/src/platforms/webex/credential-manager.ts +197 -0
  112. package/src/platforms/webex/ensure-auth.test.ts +85 -0
  113. package/src/platforms/webex/ensure-auth.ts +19 -0
  114. package/src/platforms/webex/index.test.ts +25 -0
  115. package/src/platforms/webex/index.ts +17 -0
  116. package/src/platforms/webex/types.test.ts +307 -0
  117. package/src/platforms/webex/types.ts +127 -0
  118. package/src/tui/adapters/webex-adapter.ts +103 -0
  119. package/src/tui/app.ts +2 -0
@@ -4,11 +4,11 @@ description: A unified terminal interface for all your messaging platforms in on
4
4
  icon: Monitor
5
5
  ---
6
6
 
7
- > **Experimental** — The TUI is a showcase of what's possible with Agent Messenger's SDK. It's not intended for production use, but demonstrates the power of having a unified adapter layer across 9 messaging platforms.
7
+ > **Experimental** — The TUI is a showcase of what's possible with Agent Messenger's SDK. It's not intended for production use, but demonstrates the power of having a unified adapter layer across 10 messaging platforms.
8
8
 
9
9
  ## What Is It?
10
10
 
11
- The TUI (Terminal User Interface) is a `blessed`-based interactive terminal app that unifies all your messaging platforms into a single screen. Navigate between Slack, Discord, Teams, Telegram, WhatsApp, LINE, Instagram, KakaoTalk, and Channel Talk — all from your terminal.
11
+ The TUI (Terminal User Interface) is a `blessed`-based interactive terminal app that unifies all your messaging platforms into a single screen. Navigate between Slack, Discord, Teams, Webex, Telegram, WhatsApp, LINE, Instagram, KakaoTalk, and Channel Talk — all from your terminal.
12
12
 
13
13
  ![Agent Messenger TUI](/tui.png)
14
14
 
@@ -30,7 +30,7 @@ The TUI has three navigation levels and three input modes.
30
30
 
31
31
  | Level | What it shows | How to enter |
32
32
  | --- | --- | --- |
33
- | **Platform** | All 9 platforms with online/offline status | Launch or press `Esc` from workspace level |
33
+ | **Platform** | All 10 platforms with online/offline status | Launch or press `Esc` from workspace level |
34
34
  | **Workspace** | Workspaces for the selected platform (skipped if only one) | Select a platform |
35
35
  | **Channel** | Channels in the current workspace | Select a workspace |
36
36
 
@@ -125,6 +125,7 @@ src/tui/
125
125
  │ ├── slack-adapter.ts
126
126
  │ ├── discord-adapter.ts
127
127
  │ ├── teams-adapter.ts
128
+ │ ├── webex-adapter.ts
128
129
  │ ├── telegram-adapter.ts
129
130
  │ ├── whatsapp-adapter.ts
130
131
  │ ├── line-adapter.ts
@@ -648,8 +648,8 @@ export default function Home() {
648
648
 
649
649
  {/* Subtitle */}
650
650
  <p className="mx-auto mt-6 max-w-2xl text-lg leading-relaxed text-zinc-600 dark:text-zinc-400">
651
- One CLI for Slack, Discord, Teams, Telegram, WhatsApp, LINE, Instagram, KakaoTalk, and Channel Talk.
652
- Credentials extracted from desktop apps or authenticated in seconds — no API keys, no OAuth, no admin approval.
651
+ One CLI for Slack, Discord, Teams, Webex, Telegram, WhatsApp, LINE, Instagram, KakaoTalk, and Channel Talk.
652
+ Credentials extracted from desktop apps or authenticated in seconds — no API keys, no admin approval.
653
653
  </p>
654
654
 
655
655
  {/* CTAs with glass treatment in dark mode */}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agent-messenger",
3
- "version": "2.0.0",
4
- "description": "Multi-platform messaging CLI for AI agents (Slack, Discord, Teams, Telegram, WhatsApp, LINE, Instagram, KakaoTalk, Channel Talk)",
3
+ "version": "2.1.0",
4
+ "description": "Multi-platform messaging CLI for AI agents (Slack, Discord, Teams, Webex, Telegram, WhatsApp, LINE, Instagram, KakaoTalk, Channel Talk)",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/devxoul/agent-messenger"
@@ -14,6 +14,7 @@
14
14
  "agent-discord": "dist/src/platforms/discord/cli.js",
15
15
  "agent-discordbot": "dist/src/platforms/discordbot/cli.js",
16
16
  "agent-teams": "dist/src/platforms/teams/cli.js",
17
+ "agent-webex": "dist/src/platforms/webex/cli.js",
17
18
  "agent-telegram": "dist/src/platforms/telegram/cli.js",
18
19
  "agent-whatsapp": "dist/src/platforms/whatsapp/cli.js",
19
20
  "agent-whatsappbot": "dist/src/platforms/whatsappbot/cli.js",
@@ -41,6 +42,10 @@
41
42
  "types": "./dist/src/platforms/teams/index.d.ts",
42
43
  "default": "./dist/src/platforms/teams/index.js"
43
44
  },
45
+ "./webex": {
46
+ "types": "./dist/src/platforms/webex/index.d.ts",
47
+ "default": "./dist/src/platforms/webex/index.js"
48
+ },
44
49
  "./whatsapp": {
45
50
  "types": "./dist/src/platforms/whatsapp/index.d.ts",
46
51
  "default": "./dist/src/platforms/whatsapp/index.js"
@@ -84,6 +89,9 @@
84
89
  "teams": [
85
90
  "./dist/src/platforms/teams/index.d.ts"
86
91
  ],
92
+ "webex": [
93
+ "./dist/src/platforms/webex/index.d.ts"
94
+ ],
87
95
  "whatsapp": [
88
96
  "./dist/src/platforms/whatsapp/index.d.ts"
89
97
  ],
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-channeltalk
3
3
  description: Interact with Channel Talk using extracted desktop app credentials - read chats, send messages, search messages, manage groups
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  allowed-tools: Bash(agent-channeltalk:*)
6
6
  metadata:
7
7
  openclaw:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-channeltalkbot
3
3
  description: Interact with Channel Talk workspaces using API credentials - send messages, read chats, manage groups and bots
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  allowed-tools: Bash(agent-channeltalkbot:*)
6
6
  metadata:
7
7
  openclaw:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-discord
3
3
  description: Interact with Discord servers - send messages, read channels, manage reactions
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  allowed-tools: Bash(agent-discord:*)
6
6
  metadata:
7
7
  openclaw:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-discordbot
3
3
  description: Interact with Discord servers using bot tokens - send messages, read channels, manage reactions
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  allowed-tools: Bash(agent-discordbot:*)
6
6
  metadata:
7
7
  openclaw:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-instagram
3
3
  description: Interact with Instagram DMs - send messages, read conversations, manage accounts
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  allowed-tools: Bash(agent-instagram:*)
6
6
  metadata:
7
7
  openclaw:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-kakaotalk
3
3
  description: Interact with KakaoTalk - send messages, read chats, manage conversations
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  allowed-tools: Bash(agent-kakaotalk:*)
6
6
  metadata:
7
7
  openclaw:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-line
3
3
  description: Interact with LINE - send messages, read chats, manage conversations
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  allowed-tools: Bash(agent-line:*)
6
6
  metadata:
7
7
  openclaw:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-slack
3
3
  description: Interact with Slack workspaces - send messages, read channels, manage reactions
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  allowed-tools: Bash(agent-slack:*)
6
6
  metadata:
7
7
  openclaw:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-slackbot
3
3
  description: Interact with Slack workspaces using bot tokens - send messages, read channels, manage reactions
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  allowed-tools: Bash(agent-slackbot:*)
6
6
  metadata:
7
7
  openclaw:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-teams
3
3
  description: Interact with Microsoft Teams - send messages, read channels, manage reactions
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  allowed-tools: Bash(agent-teams:*)
6
6
  metadata:
7
7
  openclaw:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-telegram
3
3
  description: Interact with Telegram through TDLib - authenticate, inspect chats, and send messages
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  allowed-tools: Bash(agent-telegram:*)
6
6
  ---
7
7
 
@@ -0,0 +1,386 @@
1
+ ---
2
+ name: agent-webex
3
+ description: Interact with Cisco Webex - send messages, read spaces, manage memberships
4
+ version: 2.1.0
5
+ allowed-tools: Bash(agent-webex:*)
6
+ metadata:
7
+ openclaw:
8
+ requires:
9
+ bins:
10
+ - agent-webex
11
+ install:
12
+ - kind: node
13
+ package: agent-messenger
14
+ bins: [agent-webex]
15
+ ---
16
+
17
+ # Agent Webex
18
+
19
+ A TypeScript CLI tool that enables AI agents and humans to interact with Cisco Webex through a simple command interface. Uses OAuth Device Grant flow, zero configuration required.
20
+
21
+ ## Quick Start
22
+
23
+ ```bash
24
+ # Log in (opens browser automatically)
25
+ agent-webex auth login
26
+
27
+ # Get workspace snapshot
28
+ agent-webex snapshot
29
+
30
+ # Send a message
31
+ agent-webex message send <space-id> "Hello from AI agent!"
32
+
33
+ # List spaces
34
+ agent-webex space list
35
+ ```
36
+
37
+ ## Authentication
38
+
39
+ Webex uses OAuth Device Grant flow with built-in Integration credentials. No tokens to copy, no developer portal setup needed.
40
+
41
+ `agent-webex auth login` starts the Device Grant flow: it displays a verification URL and user code, then opens the browser. You enter the code at the verification page and approve access. The CLI polls for the token automatically. Access and refresh tokens are stored locally, and the access token auto-refreshes via the refresh token.
42
+
43
+ Optionally, pass `--token <bot-token>` for bot token auth. Or pass `--client-id <id> --client-secret <secret>` to use your own Webex Integration credentials instead of the built-in ones.
44
+
45
+ Env vars `AGENT_WEBEX_CLIENT_ID` / `AGENT_WEBEX_CLIENT_SECRET` can also override the built-in credentials.
46
+
47
+ ```bash
48
+ # Log in (Device Grant flow, opens browser)
49
+ agent-webex auth login
50
+
51
+ # Log in with custom Integration credentials
52
+ agent-webex auth login --client-id <id> --client-secret <secret>
53
+
54
+ # Log in with a bot token
55
+ agent-webex auth login --token <token>
56
+
57
+ # Check auth status
58
+ agent-webex auth status
59
+
60
+ # Log out
61
+ agent-webex auth logout
62
+ ```
63
+
64
+ ### How Login Works
65
+
66
+ 1. Run `agent-webex auth login`
67
+ 2. CLI requests a device code from Webex
68
+ 3. Browser opens to Webex verification page
69
+ 4. Enter the displayed code and sign in
70
+ 5. CLI automatically detects approval and stores tokens
71
+ 6. Access token auto-refreshes via refresh token
72
+
73
+ ### Token Types
74
+
75
+ - **OAuth Device Grant (default)**: Zero-config login. Access token auto-refreshes. Built-in Integration credentials used unless overridden.
76
+ - **Bot Token**: Pass via `--token` flag. Never expires. Best for CI/CD.
77
+ - **Custom Integration**: Pass `--client-id` + `--client-secret` or set env vars for your own Webex Integration.
78
+
79
+ **IMPORTANT**: NEVER guide the user to open a web browser, use DevTools, or manually copy tokens from a browser's network inspector. Always use `agent-webex auth login` for interactive authentication.
80
+
81
+ For detailed token management, see [references/authentication.md](references/authentication.md).
82
+
83
+ ## Memory
84
+
85
+ The agent maintains a `~/.config/agent-messenger/MEMORY.md` file as persistent memory across sessions. This is agent-managed, the CLI does not read or write this file. Use the `Read` and `Write` tools to manage your memory file.
86
+
87
+ ### Reading Memory
88
+
89
+ At the **start of every task**, read `~/.config/agent-messenger/MEMORY.md` using the `Read` tool to load any previously discovered space IDs, member info, and preferences.
90
+
91
+ - If the file doesn't exist yet, that's fine. Proceed without it and create it when you first have useful information to store.
92
+ - If the file can't be read (permissions, missing directory), proceed without memory. Don't error out.
93
+
94
+ ### Writing Memory
95
+
96
+ After discovering useful information, update `~/.config/agent-messenger/MEMORY.md` using the `Write` tool. Write triggers include:
97
+
98
+ - After discovering space IDs and titles (from `space list`, `snapshot`, etc.)
99
+ - After discovering member IDs and names (from `member list`, `snapshot`, etc.)
100
+ - After the user gives you an alias or preference ("call this the standup space", "my main space is X")
101
+ - After discovering space structure (group vs direct spaces)
102
+
103
+ When writing, include the **complete file content**. The `Write` tool overwrites the entire file.
104
+
105
+ ### What to Store
106
+
107
+ - Space IDs with titles
108
+ - Member IDs with display names and space context
109
+ - User-given aliases ("standup space", "engineering space")
110
+ - Token type in use (PAT vs bot)
111
+ - Any user preference expressed during interaction
112
+
113
+ ### What NOT to Store
114
+
115
+ Never store tokens, credentials, or any sensitive data. Never store full message content (just IDs and space context).
116
+
117
+ ### Handling Stale Data
118
+
119
+ If a memorized ID returns an error (space not found, member not found), remove it from `MEMORY.md`. Don't blindly trust memorized data. Verify when something seems off. Prefer re-listing over using a memorized ID that might be stale.
120
+
121
+ ### Format / Example
122
+
123
+ ```markdown
124
+ # Agent Messenger Memory
125
+
126
+ ## Spaces
127
+
128
+ - `space-id-1` — Engineering (group)
129
+ - `space-id-2` — Alice / Bob (direct)
130
+ - `space-id-3` — Standups (group)
131
+
132
+ ## Members (Engineering)
133
+
134
+ - `person-id-1` — Alice Chen (engineering lead)
135
+ - `person-id-2` — Bob Park (backend)
136
+
137
+ ## Aliases
138
+
139
+ - "standup" -> `space-id-3` (Standups)
140
+ - "eng" -> `space-id-1` (Engineering)
141
+
142
+ ## Notes
143
+
144
+ - Using bot token (no expiry)
145
+ - Main space is "Engineering"
146
+ ```
147
+
148
+ > Memory lets you skip repeated `space list` and `member list` calls. When you already know an ID from a previous session, use it directly.
149
+
150
+ ## Commands
151
+
152
+ ### Auth Commands
153
+
154
+ ```bash
155
+ # Log in (Device Grant flow, opens browser)
156
+ agent-webex auth login
157
+
158
+ # Log in with custom Integration credentials
159
+ agent-webex auth login --client-id <id> --client-secret <secret>
160
+
161
+ # Log in with a bot token
162
+ agent-webex auth login --token <token>
163
+
164
+ # Check auth status
165
+ agent-webex auth status
166
+
167
+ # Log out
168
+ agent-webex auth logout
169
+ ```
170
+
171
+ ### Space Commands
172
+
173
+ ```bash
174
+ # List spaces
175
+ agent-webex space list
176
+ agent-webex space list --type group
177
+ agent-webex space list --type direct
178
+ agent-webex space list --limit 20
179
+
180
+ # Get space info
181
+ agent-webex space info <space-id>
182
+ ```
183
+
184
+ ### Message Commands
185
+
186
+ ```bash
187
+ # Send a message
188
+ agent-webex message send <space-id> <text>
189
+ agent-webex message send <space-id> "Hello world"
190
+
191
+ # Send a markdown message
192
+ agent-webex message send <space-id> "**Bold** and _italic_" --markdown
193
+
194
+ # List messages in a space
195
+ agent-webex message list <space-id>
196
+ agent-webex message list <space-id> --limit 50
197
+
198
+ # Get a single message by ID
199
+ agent-webex message get <message-id>
200
+
201
+ # Delete a message
202
+ agent-webex message delete <message-id>
203
+ agent-webex message delete <message-id> --force
204
+
205
+ # Edit a message
206
+ agent-webex message edit <message-id> <space-id> <text>
207
+ agent-webex message edit <message-id> <space-id> "Updated text" --markdown
208
+ ```
209
+
210
+ ### Member Commands
211
+
212
+ ```bash
213
+ # List members of a space
214
+ agent-webex member list <space-id>
215
+ agent-webex member list <space-id> --limit 100
216
+ ```
217
+
218
+ ### Snapshot Command
219
+
220
+ Get comprehensive workspace state for AI agents:
221
+
222
+ ```bash
223
+ # Full snapshot
224
+ agent-webex snapshot
225
+
226
+ # Filtered snapshots
227
+ agent-webex snapshot --spaces-only
228
+ agent-webex snapshot --members-only
229
+
230
+ # Limit messages per space
231
+ agent-webex snapshot --limit 10
232
+ ```
233
+
234
+ Returns JSON with:
235
+
236
+ - Spaces (id, title, type, created)
237
+ - Recent messages (id, text, personEmail, created)
238
+ - Members (id, personDisplayName, personEmail)
239
+
240
+ ## Output Format
241
+
242
+ ### JSON (Default)
243
+
244
+ All commands output JSON by default for AI consumption:
245
+
246
+ ```json
247
+ {
248
+ "id": "Y2lzY29zcGFyazovL...",
249
+ "text": "Hello world",
250
+ "personEmail": "alice@example.com",
251
+ "created": "2024-01-15T10:30:00.000Z"
252
+ }
253
+ ```
254
+
255
+ ### Pretty (Human-Readable)
256
+
257
+ Use `--pretty` flag for formatted output:
258
+
259
+ ```bash
260
+ agent-webex space list --pretty
261
+ ```
262
+
263
+ ## Error Handling
264
+
265
+ All commands return consistent error format:
266
+
267
+ ```json
268
+ {
269
+ "error": "Not authenticated. Run \"auth login\" first."
270
+ }
271
+ ```
272
+
273
+ Common errors:
274
+
275
+ - `Not authenticated`: No valid token. Run `auth login` first
276
+ - `Device authorization timed out`: User didn't complete verification in time. Run `auth login` again.
277
+ - `401 Unauthorized`: Token expired or invalid. Re-run `auth login`
278
+ - `429 Too Many Requests`: Rate limited. Wait and retry (Webex allows ~600 requests per minute)
279
+ - `404 Not Found`: Invalid space ID, message ID, or resource
280
+ - `Space not found`: Invalid space ID
281
+ - `Message not found`: Invalid message ID
282
+
283
+ ## Configuration
284
+
285
+ Credentials stored in `~/.config/agent-messenger/webex-credentials.json` (0600 permissions):
286
+
287
+ ```json
288
+ {
289
+ "accessToken": "...",
290
+ "refreshToken": "...",
291
+ "expiresAt": 1234567890,
292
+ "clientId": "...",
293
+ "clientSecret": "..."
294
+ }
295
+ ```
296
+
297
+ See [references/authentication.md](references/authentication.md) for format and security details.
298
+
299
+ ## SDK: Programmatic Usage
300
+
301
+ `WebexClient` is available as a TypeScript SDK for building scripts and automations.
302
+
303
+ ### Setup
304
+
305
+ ```typescript
306
+ import { WebexClient } from 'agent-messenger/webex'
307
+
308
+ const client = await new WebexClient().login()
309
+ ```
310
+
311
+ ### Example
312
+
313
+ ```typescript
314
+ // List spaces
315
+ const spaces = await client.listSpaces()
316
+
317
+ // List members in a space
318
+ const members = await client.listMembers(spaces[0].id)
319
+
320
+ // Send a message
321
+ const msg = await client.sendMessage(spaces[0].id, 'Hello from SDK!')
322
+
323
+ // Send markdown
324
+ await client.sendMessage(spaces[0].id, '**Status**: All systems go', { markdown: true })
325
+ ```
326
+
327
+ ### Full API Reference
328
+
329
+ See the [Webex SDK documentation](https://agent-messenger.dev/docs/sdk/webex) for complete method signatures, types, schemas, and examples.
330
+
331
+ ## Limitations
332
+
333
+ - No real-time events / WebSocket connection
334
+ - No file upload or download
335
+ - No reactions / emoji support
336
+ - No thread support
337
+ - No message search
338
+ - No voice/video or meeting support
339
+ - No space management (create/delete spaces, roles)
340
+
341
+ ## Troubleshooting
342
+
343
+ ### Token refresh failed
344
+
345
+ OAuth tokens auto-refresh, so expiration is handled automatically. If a refresh fails (revoked access, network issues), re-run:
346
+
347
+ ```bash
348
+ agent-webex auth login
349
+ ```
350
+
351
+ Bot tokens never expire and don't need refreshing.
352
+
353
+ ### `agent-webex: command not found`
354
+
355
+ **`agent-webex` is NOT the npm package name.** The npm package is `agent-messenger`.
356
+
357
+ If the package is installed globally, use `agent-webex` directly:
358
+
359
+ ```bash
360
+ agent-webex space list
361
+ ```
362
+
363
+ If the package is NOT installed, use `npx -y` by default. **Do NOT ask the user which package runner to use.** Just run it:
364
+
365
+ ```bash
366
+ npx -y agent-messenger webex space list
367
+ bunx agent-messenger webex space list
368
+ pnpm dlx agent-messenger webex space list
369
+ ```
370
+
371
+ > If you already know the user's preferred package runner (e.g., `bunx`, `pnpm dlx`), use that instead.
372
+
373
+ **NEVER run `npx agent-webex`, `bunx agent-webex`, or `pnpm dlx agent-webex`**. It will fail or install a wrong package since `agent-webex` is not the npm package name.
374
+
375
+ ### Rate limiting (429)
376
+
377
+ Webex allows roughly 600 API calls per minute. If you hit a 429, wait a few seconds and retry. For bulk operations, add a `sleep 1` between requests.
378
+
379
+ ### Other errors
380
+
381
+ For auth troubleshooting (token types, storage, permissions), see [references/authentication.md](references/authentication.md).
382
+
383
+ ## References
384
+
385
+ - [Authentication Guide](references/authentication.md)
386
+ - [Common Patterns](references/common-patterns.md)