apus directory

Directory lookups for channels that support them: contacts/peers, groups, and "me" (self).

Results are meant to be pasted into other commands, especially apus message send --target ....

Common flags

Omit --channel to auto-select the only configured channel. Explicitly empty and whitespace-only values fail with --channel must not be blank while options are parsed, before command bootstrap and directory setup or lookup. Scripts that pass an unset shell variable must omit the flag to request automatic selection.

Omit --account to select the channel default. Explicitly empty and whitespace-only account values fail with --account must not be blank before account setup or lookup.

--limit requires a positive integer. Omit --limit to use the selected channel plugin's default. Explicitly empty and whitespace-only values are rejected.

Default output renders IDs and names in a table. Empty list results name the channel and account that were queried. JSON list output uses an empty array ([]). Failures exit nonzero and use the canonical { "ok": false, "error": { "type": "cli_error", "message": "..." } } envelope in JSON mode.

Notes

Using results with message send

apus directory peers list --channel slack --query "U0"
apus message send --channel slack --target user:U012ABCDEF --message "hello"

ID formats by channel

Channel Target id format
WhatsApp +15551234567 (DM), 1234567890-1234567890@g.us (group), 120363123456789@newsletter (Channel/Newsletter, outbound only)
Signal Configured aliases resolve to E.164/UUID DM targets or group:<id> group targets
Telegram @username or numeric chat id; groups use numeric ids
Slack user:U… and channel:C…
Discord user:<id> and channel:<id>
Matrix (plugin) user:@user:server, room:!roomId:server, or #alias:server
Microsoft Teams (plugin) user:<id> and conversation:<id>
Zalo (plugin) User id (Bot API)
Zalo Personal / zalouser (plugin) Thread id (DM/group), from zca (me, friend list, group list)

Self ("me")

apus directory self --channel zalouser

A channel may legitimately return no self identity. This is a successful empty result (exit code 0), not a failed lookup. Channels without a self resolver report that the channel does not expose a self identity, without suggesting account troubleshooting:

{
  "status": "unavailable",
  "channel": "telegram",
  "accountId": "default",
  "reason": "self-identity-unsupported"
}

When a channel implements self lookup but returns no identity, the text output names the channel and account and suggests checking its configuration and authentication. JSON callers can distinguish that case by its reason:

{
  "status": "unavailable",
  "channel": "msteams",
  "accountId": "default",
  "reason": "plugin-returned-no-self-identity"
}

Peers (contacts/users)

apus directory peers list --channel zalouser
apus directory peers list --channel zalouser --query "name"
apus directory peers list --channel zalouser --limit 50

Groups

apus directory groups list --channel zalouser
apus directory groups list --channel zalouser --query "work"
apus directory groups members --channel zalouser --group-id <id>

groups members requires a non-blank --group-id. Empty or whitespace-only IDs fail before plugin setup or lookup.

Related