Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/WecomTeam/wecom-cli
/ functions
Functions
147 in github.com/WecomTeam/wecom-cli
⨍
Functions
147
◇
Types & classes
33
↓ 28 callers
Function
generate_random_key
Generate a fresh random 256-bit key.
src/crypto/keystore.rs:47
↓ 26 callers
Method
get
(&self, category: &str, name: &str)
src/helpers/registry.rs:38
↓ 13 callers
Function
atomic_write
Atomically write `data` (bytes) to `path`, overwriting if the file already exists. Uses `tempfile::NamedTempFile` to create a temporary file in the s
src/fs_util/atomic_write.rs:11
↓ 8 callers
Function
encrypt
Encrypt `plaintext` with AES-256-GCM. Returns `nonce || ciphertext`.
src/crypto/cipher.rs:11
↓ 7 callers
Function
encrypt_data
Encrypt serializable data: serialize → AES-256-GCM encrypt.
src/crypto/keystore.rs:98
↓ 7 callers
Function
tmp
()
src/fs_util/atomic_write.rs:45
↓ 6 callers
Function
sign
Compute the request signature. Algorithm: `sha256_hex(secret + bot_id + time + nonce)` where `sha256_hex` uses the standard zero-padded lowercase hex
src/mcp/config.rs:99
↓ 5 callers
Function
call_tool
( category: &str, method: &str, args: serde_json::Value, )
src/json_rpc.rs:91
↓ 5 callers
Function
decrypt_data
Decrypt data: AES-256-GCM decrypt → deserialize.
src/crypto/keystore.rs:105
↓ 5 callers
Function
save_mcp_config_to_path
Encrypt and write the config list to a specific path with a given key (test helper).
src/mcp/config.rs:158
↓ 4 callers
Method
build
Build a signed request from stored bot credentials
src/mcp/config.rs:39
↓ 4 callers
Function
decode_key
Decode a Base64 string into a 32-byte key, returning an error on invalid input.
src/crypto/keystore.rs:34
↓ 4 callers
Function
get_category_tools
获取指定品类的工具列表(文件缓存 → 远程请求)
src/registry.rs:21
↓ 4 callers
Function
get_str
获取 JSON 对象中指定字段的字符串值
src/helpers/doc/auto_file_upload.rs:72
↓ 4 callers
Function
wecom_home_dir
()
src/paths.rs:5
↓ 3 callers
Function
bot_info_path
Return the file path for the encrypted bot credentials.
src/auth/bot.rs:76
↓ 3 callers
Function
decrypt
Decrypt `data` (expected format: `nonce || ciphertext || tag`) with AES-256-GCM.
src/crypto/cipher.rs:24
↓ 3 callers
Function
get_modified_schema
获取远程工具 schema,并新增 `image_path` / `file_path` 字段。
src/helpers/doc/auto_file_upload.rs:254
↓ 3 callers
Function
get_user_agent
()
src/constants.rs:31
↓ 3 callers
Function
load_key_from_file
Load the key from the file fallback. Returns `None` if unavailable.
src/crypto/keystore.rs:59
↓ 3 callers
Function
load_mcp_config_from_path
Read and decrypt the config list from a specific path with a given key (test helper).
src/mcp/config.rs:169
↓ 3 callers
Function
mcp_config_path
Return the file path for the encrypted MCP config cache.
src/mcp/config.rs:119
↓ 3 callers
Function
sample_items
()
src/mcp/config.rs:234
↓ 2 callers
Function
cache_dir
()
src/paths.rs:15
↓ 2 callers
Function
call_json_tool
( category: &str, method: &str, args: serde_json::Value, )
src/json_rpc.rs:51
↓ 2 callers
Method
category
(&self)
src/helpers/doc/smartpage_create.rs:85
↓ 2 callers
Function
collect_cache_files
收集缓存目录下所有常规文件的路径。
src/cmd/cache.rs:115
↓ 2 callers
Method
command
(&self)
src/helpers/doc/smartpage_create.rs:89
↓ 2 callers
Function
encode_key
Encode a 32-byte key as a Base64 string.
src/crypto/keystore.rs:29
↓ 2 callers
Function
encryption_key_path
Return the file path for the local encryption key fallback.
src/crypto/keystore.rs:20
↓ 2 callers
Function
extract_doc_identifier
从参数中提取文档标识(`docid` 或 `url`)。
src/helpers/doc/auto_file_upload.rs:17
↓ 2 callers
Function
gen_req_id
Generate a request ID in the format: `{prefix}_{timestamp_ms}_{random_hex}`.
src/mcp/mod.rs:38
↓ 2 callers
Function
get_bot_info
Read encrypted bot info from disk, decrypt and return it. Returns `None` if the file does not exist or decryption fails.
src/auth/bot.rs:37
↓ 2 callers
Function
get_categories
Return all supported business categories and their tool definitions.
src/service/categories.rs:9
↓ 2 callers
Function
init_logging
Initialize the tracing subscriber with optional stderr and file logging layers.
src/logging.rs:6
↓ 2 callers
Function
init_qrcode
扫码接入流程
src/cmd/init.rs:57
↓ 2 callers
Function
load_existing_key
Try to load an existing key. Priority: process cache → file → keyring (last resort, may prompt). The result is cached for the lifetime of the process
src/crypto/keystore.rs:68
↓ 2 callers
Function
make_file_name
Build a file name in the format `stem[.index].ext`.
src/media/utils.rs:83
↓ 2 callers
Function
process_records
扫描 records 并自动上传本地文件/图片,将路径替换为上传结果。
src/helpers/doc/auto_file_upload.rs:32
↓ 2 callers
Function
read_file_as_base64
读取本地文件并编码为 base64,超过 `max_size` 时报错。
src/helpers/doc/auto_file_upload.rs:145
↓ 2 callers
Function
save_key
Persist the key. Writes to the file fallback always; writes to keyring at most once per process to avoid repeated macOS Keychain prompts. If the key
src/crypto/keystore.rs:76
↓ 2 callers
Function
send
Send a JSON-RPC 2.0 request to the MCP endpoint for the given category and method.
src/json_rpc.rs:119
↓ 2 callers
Function
sha256_hex
Compute the SHA-256 hash of `input` and return it as a lowercase hex string.
src/mcp/config.rs:105
↓ 2 callers
Function
try_decrypt_data
Try to decrypt data using the cached/keyring key first; on failure, fall back to the file key.
src/crypto/keystore.rs:111
↓ 1 callers
Function
build_auth_cmd
()
src/cmd/auth.rs:19
↓ 1 callers
Function
build_cache_cmd
()
src/cmd/cache.rs:21
↓ 1 callers
Function
build_client
()
src/auth/qrcode.rs:96
↓ 1 callers
Function
build_init_cmd
()
src/cmd/init.rs:20
↓ 1 callers
Function
build_service_cmd
( helper_registry: &HelperRegistry, category: &CategoryInfo, tools: Option<&Vec<ServiceTool>>, )
src/service/command.rs:22
↓ 1 callers
Function
clear_bot_info
Remove the stored Bot info from disk.
src/auth/bot.rs:67
↓ 1 callers
Function
clear_mcp_config
Remove the cached MCP config file from disk.
src/mcp/config.rs:148
↓ 1 callers
Function
collect_upload_paths
收集 cell 中需要上传的本地路径
src/helpers/doc/auto_file_upload.rs:77
↓ 1 callers
Function
detect_mime
Detect the MIME type by file extension first, then by magic bytes, falling back to `application/octet-stream`.
src/media/utils.rs:12
↓ 1 callers
Function
determine_file_name
Derive the (stem, extension) pair from media name, media ID, or content type.
src/media/utils.rs:93
↓ 1 callers
Method
execute
( &'a self, matches: &'a ArgMatches, )
src/helpers/doc/smartpage_create.rs:96
↓ 1 callers
Function
fetch_mcp_config
Always fetch the MCP config from the server, bypassing local cache, and persist the result.
src/mcp/config.rs:179
↓ 1 callers
Function
fetch_qrcode
获取二维码链接和轮询 scode
src/auth/qrcode.rs:103
↓ 1 callers
Function
generate_random_hex
Generate a random hex string of the specified character length.
src/mcp/mod.rs:48
↓ 1 callers
Function
getBinaryPath
* Resolves the path to the platform-specific binary.
bin/wecom.js:42
↓ 1 callers
Function
getPlatformPackage
* Returns the platform-specific package name based on current OS and CPU architecture.
bin/wecom.js:13
↓ 1 callers
Function
get_mcp_url
Look up the MCP URL for the given `category` (matched against `biz_type`).
src/mcp/mod.rs:10
↓ 1 callers
Function
handle_auth_cmd
(matches: &ArgMatches)
src/cmd/auth.rs:23
↓ 1 callers
Function
handle_auth_show
(args: &ShowArgs)
src/cmd/auth.rs:29
↓ 1 callers
Function
handle_auth_show_auth_status
(bot: Option<Bot>)
src/cmd/auth.rs:52
↓ 1 callers
Function
handle_auth_show_default
(bot: Option<Bot>)
src/cmd/auth.rs:39
↓ 1 callers
Function
handle_cache_clear
清除缓存目录下所有文件。
src/cmd/cache.rs:75
↓ 1 callers
Function
handle_cache_cmd
(matches: &ArgMatches)
src/cmd/cache.rs:29
↓ 1 callers
Function
handle_cache_status
列出当前缓存目录下所有文件及其修改时间。
src/cmd/cache.rs:40
↓ 1 callers
Function
handle_init_cmd
Handle the `init` subcommand: prompt for bot credentials, persist them, and verify via MCP config fetch.
src/cmd/init.rs:26
↓ 1 callers
Function
handle_service_cmd
Handle the `call` subcommand: dispatch a JSON-RPC tool invocation for a given category and method.
src/service/handler.rs:8
↓ 1 callers
Function
init_manual
手动输入 Bot ID 和 Secret
src/cmd/init.rs:62
↓ 1 callers
Function
intercept_media_response
Intercept a `get_msg_media` response: decode base64 payload, save to disk, and replace the response with a local file reference.
src/media/mod.rs:9
↓ 1 callers
Method
list_in_category
(&self, category: &str)
src/helpers/registry.rs:45
↓ 1 callers
Function
load_mcp_config
Read cached MCP config list from the encrypted file.
src/mcp/config.rs:124
↓ 1 callers
Function
mcp_config_endpoint
Return the MCP config endpoint URL (env override or the default WeCom API).
src/constants.rs:23
↓ 1 callers
Function
media_dir
()
src/paths.rs:19
↓ 1 callers
Function
open_url_by_browser
尝试使用系统默认浏览器打开指定 URL。 - 使用 `open` crate 跨平台打开浏览器(macOS: `open`、Windows: `ShellExecuteW`、Linux: `xdg-open`)。 - 打开失败不会中断主流程,仅记录日志。
src/browser.rs:4
↓ 1 callers
Function
poll_result
轮询扫码结果
src/auth/qrcode.rs:160
↓ 1 callers
Function
render_qrcode
在终端渲染二维码(TTY,带 ANSI 色彩)
src/auth/qrcode.rs:137
↓ 1 callers
Function
render_qrcode_unicode
在 non-TTY 环境下用纯 Unicode 半块字符渲染二维码(无 ANSI escape)
src/auth/qrcode.rs:144
↓ 1 callers
Function
replace_attachment_value_schema
替换 schema 中的 CellAttachmentValue 定义,只保留 file_path 字段。
src/helpers/doc/auto_file_upload.rs:295
↓ 1 callers
Function
replace_image_value_schema
替换 schema 中的 CellImageValue 定义,只保留 image_path 字段。
src/helpers/doc/auto_file_upload.rs:270
↓ 1 callers
Function
replace_upload_results
用上传结果替换 cell 中的本地路径
src/helpers/doc/auto_file_upload.rs:95
↓ 1 callers
Function
save_mcp_config
Encrypt and persist the MCP config list to disk.
src/mcp/config.rs:130
↓ 1 callers
Function
save_media
Atomically save media data to the media directory, deduplicating file names when collisions occur.
src/media/utils.rs:34
↓ 1 callers
Function
scan_qrcode_for_bot
扫码接入完整流程:获取二维码 → 终端展示 → 轮询结果 → 返回 Bot
src/auth/qrcode.rs:61
↓ 1 callers
Function
set_bot_info
Serialize bot info, encrypt and persist to disk. The encryption key is stored in the system keyring when possible, otherwise falls back to an encrypte
src/auth/bot.rs:44
↓ 1 callers
Function
upload_files
批量上传文件,返回 path → FileUploadResult 映射。
src/helpers/doc/auto_file_upload.rs:212
↓ 1 callers
Function
upload_images
批量上传图片,返回 path → ImageUploadResult 映射。
src/helpers/doc/auto_file_upload.rs:162
↓ 1 callers
Function
verify_and_finish
验证凭证并完成初始化
src/cmd/init.rs:75
Function
bind_source_serializes_as_number
()
src/mcp/config.rs:365
Method
category
(&self)
src/helpers/doc/smartsheet_update_records_auto_file.rs:29
Method
category
(&self)
src/helpers/doc/smartsheet_add_records_auto_file.rs:29
Method
command
(&self)
src/helpers/doc/smartsheet_update_records_auto_file.rs:33
Method
command
(&self)
src/helpers/doc/smartsheet_add_records_auto_file.rs:33
Function
decode_invalid_base64_fails
()
src/crypto/keystore.rs:143
Function
decode_trims_whitespace
()
src/crypto/keystore.rs:155
Function
decode_wrong_length_fails
()
src/crypto/keystore.rs:148
Function
decrypt_corrupted_data_fails
()
src/crypto/cipher.rs:92
Function
decrypt_data_with_corrupted_data_fails
()
src/crypto/keystore.rs:237
next →
1–100 of 147, ranked by callers