Clear Doc-Smith's site authorization and deployment configuration.
Trigger Scenarios
- User requests to clear authorization token
- User requests to clear deployment configuration
- User says "clear configuration", "reset", "clear authorization"
Storage Description
Authorization information (authTokens):
- Stored in the system keyring (such as macOS Keychain)
- Service name:
aigne-doc-smith-publish - Organized by site hostname, supports multi-site authorization
- If the system does not support keyring, fall back to
~/.aigne/doc-smith-connected.yaml
Deployment configuration (deploymentConfig):
appUrlThe field is stored in the workspace's.aigne/doc-smith/config.yamlin
Clearable Content
| Target | Description |
|---|---|
| authTokens | Site authorization information (stored in the system keyring) |
| deploymentConfig | Deployment configuration (appUrl field in config.yaml) |
Workflow
1. Confirm Clear Content
Determine the content to clear based on user input:
Case 1: The user explicitly specifies the clear target
For example, the user says:
- "Clear authorization" → clear authTokens
- "Clear deployment configuration" → clear deploymentConfig
- "Clear all configuration" → clear all
Execute the clear operation directly.
Case 2: The user does not explicitly specify
Use the AskUserQuestion tool to ask the user:
请选择要清除的内容:
选项:
1. 站点授权 (authTokens) - 清除后需要重新授权才能发布
2. 部署配置 (deploymentConfig) - 清除后需要重新指定发布目标
3. 全部清除
2. Clear Site Authorization
If the user chooses to clear authorization:
Step 1: Get the list of authorized sites
node skills/doc-smith-clear/scripts/list-auth.mjs
Output format:
{"sites": ["site1.arcblock.io", "site2.arcblock.io"]}
If there is no authorization information, return {"sites": []}。
Step 2: Confirm the sites to clear
If there are multiple sites, use AskUserQuestion to ask the user which ones to clear:
发现以下已授权的站点:
- site1.arcblock.io
- site2.arcblock.io
请选择要清除授权的站点:
选项:
1. site1.arcblock.io
2. site2.arcblock.io
3. 清除全部站点授权
If there is only one site, directly ask whether to clear the authorization for that site.
Step 3: Execute Clear
# 清除指定站点
node skills/doc-smith-clear/scripts/clear-auth.mjs --site=site1.arcblock.io
# 清除全部站点
node skills/doc-smith-clear/scripts/clear-auth.mjs --all
3. Clear Deployment Configuration
If the user chooses to clear deployment configuration:
Step 1: Check whether the configuration file exists
ls .aigne/doc-smith/config.yaml
If it does not exist, prompt the user: "The current directory has no Doc-Smith deployment configuration, no need to clear."
Step 2: Execute Clear
node skills/doc-smith-clear/scripts/clear-deployment-config.mjs
4. Return Results
Display the clear results:
- List of cleared site authorizations (if authorization was cleared)
- Whether the deployment configuration was cleared
- Follow-up prompts (such as "re-authorization is required to publish")
Script Description
list-auth.mjs
List all authorized site hostnames.
Output: JSON format, containing a sites array
clear-auth.mjs
Clear site authorization information.
Parameters:
--site=<hostname>: Clear the authorization for the specified site--all: Clear the authorization for all sites
Output: JSON format, containing the clear results
clear-deployment-config.mjs
Clear the appUrl field in config.yaml.
Output: JSON format, containing the clear results
Error Handling
- Configuration file does not exist: Return a prompt message, not considered an error
- No authorization information to clear: Return a prompt message, not considered an error
- Invalid site name: Prompt the user for the correct site name
Notes
- The clear operation is irreversible; ensure the user has confirmed before executing
- After clearing the site authorization, reauthorization is required to publish to that site
- After clearing the deployment configuration, the target URL must be specified again for the next publish
- Site authorization is global (stored in the user directory) and does not depend on the current workspace