Summary
Replace duplicated AI CLI integration code in src/docsfy/ai_client.py with imports from the new ai-cli-runner package.
What to Replace
Replace the entire contents of src/docsfy/ai_client.py:
call_ai_cli() function
check_ai_cli_available() function
ProviderConfig dataclass
PROVIDERS / PROVIDER_CONFIG dict
_build_claude_cmd, _build_gemini_cmd, _build_cursor_cmd functions
_get_ai_cli_timeout() function and AI_CLI_TIMEOUT constant
VALID_AI_PROVIDERS constant
Migration Notes
docsfy uses a 60-minute default timeout (vs 10 minutes for other projects). After migration, either:
- Pass
ai_cli_timeout=60 at each call site, or
- Set
AI_CLI_TIMEOUT=60 in the environment
Migration
- Add
ai-cli-runner as a dependency in pyproject.toml
- Replace
ai_client.py contents with re-exports or update imports:
from ai_cli_runner import call_ai_cli, check_ai_cli_available
- Pass
ai_cli_timeout=60 at call sites to preserve the 60-minute default
- Pass appropriate
cli_flags at call sites
- Remove the old duplicated code
Blocked By
Summary
Replace duplicated AI CLI integration code in
src/docsfy/ai_client.pywith imports from the newai-cli-runnerpackage.What to Replace
Replace the entire contents of
src/docsfy/ai_client.py:call_ai_cli()functioncheck_ai_cli_available()functionProviderConfigdataclassPROVIDERS/PROVIDER_CONFIGdict_build_claude_cmd,_build_gemini_cmd,_build_cursor_cmdfunctions_get_ai_cli_timeout()function andAI_CLI_TIMEOUTconstantVALID_AI_PROVIDERSconstantMigration Notes
docsfy uses a 60-minute default timeout (vs 10 minutes for other projects). After migration, either:
ai_cli_timeout=60at each call site, orAI_CLI_TIMEOUT=60in the environmentMigration
ai-cli-runneras a dependency inpyproject.tomlai_client.pycontents with re-exports or update imports:ai_cli_timeout=60at call sites to preserve the 60-minute defaultcli_flagsat call sitesBlocked By