CommandsService
city chat
Chat service actions (status/test/reconnect/open/close/configure/send/react/context/history)
city chat
Send messages, react to messages, inspect context, and read chat history.
Hierarchy note:
city chatis a service action command, not a top-level command. Top-level entry iscity service.
Usage
city chat <subcommand> [options]Subcommands
status: show channel link statustest: run channel connectivity checksreconnect: reconnect channels (all by default, or one channel)open: enable a channel (enabled=trueinship.json, then try to start if configured)close: disable a channel (enabled=falseinship.json, and stop runtime channel)configuration: inspect channel configuration schema (field name/type/description/source)configure: update channel parameters (ship.jsonpatch, restart channel by default)send: send messagereact: react to message (primarily Telegram)context: view conversation context snapshothistory: read chat history
status/test/reconnect/open/close key options
--channel <telegram|feishu|qq>: run against one channel only (all channels if omitted)
configure key options
--channel <telegram|feishu|qq>: target channel--config-json <json>: config patch JSON object--restart: restart the channel after config update
configuration key options
--channel <telegram|feishu|qq>: inspect one channel only (all channels if omitted)
send key options
--text <text>: message body--stdin: read message body from stdin--text-file <file>: read message body from file--chat-key <chatKey>: target conversation--delay <ms>: delayed send--time <time>: scheduled send (unix sec/ms or ISO)--reply: send asreply_to_message
react key options
--emoji <emoji>: emoji, default ๐--message-id <id>: target message ID--chat-key <chatKey>: target conversation--big: Telegram large emoji (is_big)
history key options
--chat-key <chatKey>--context-id <contextId>--limit <n>--direction <all|inbound|outbound>--before-ts <ts>/--after-ts <ts>(milliseconds)
Examples
city chat send --chat-key ctx_xxxxxxxxxxxxxxxx --text "done"
city chat react --chat-key ctx_xxxxxxxxxxxxxxxx --emoji "โ
"
city chat context --chat-key ctx_xxxxxxxxxxxxxxxx
city chat history --chat-key ctx_xxxxxxxxxxxxxxxx --limit 50
city chat status
city chat test --channel telegram
city chat reconnect --channel qq
city chat open --channel qq
city chat close --channel telegram
city chat configuration --channel qq
city chat configure --channel qq --config-json '{"channelAccountId":"qq-main","enabled":true}'Notes
This command group usually requires an active agent runtime:
city agent startExample Output (Based on Current Implementation)
The examples below are aligned with current command implementations in package/src (including default output mode and field structure). Placeholder values are used for environment-specific fields.
$ city chat status
{
"success": true,
"data": {
"success": true,
"channels": {
"telegram": {"state": "connected"}
}
}
}$ city chat send --chat-key <chatKey> --text "done"
{
"success": true,
"data": {
"success": true
}
}