Operate TickTick task/project workflows with strict contracts, runtime token management, typed API access, and OpenClaw-ready action wrappers.
SituationActionFirst-time OAuth authorization neededRun npm run ticktick:cli -- auth-url, then auth-exchange with callback URLToken expired but refresh token existsUse runtime/CLI auto-refresh path ( getAccessTokenWithAutoReauth)Token missing or refresh failedReauthorize from emitted URL and rerun commandNeed task creation/update/completeUse runtime.useCases.createTask/updateTask/completeTask or skill actionsNeed task/project listingUse runtime.useCases.listTasks/listProjects or CLI commandsNeed OpenClaw action integrationUse skill-entry/ticktick-skill.mjs and expose 5 MVP actionsNeed error categorization for UX/retryHandle TickTickDomainError categories from src/shared/error-categories.ts
create_tasklist_tasksupdate_taskcomplete_tasklist_projectsskill-entry/token-manager.mjsskill-entry/ticktick-skill.mjsscripts/ticktick-cli.mjsRequired environment variables:
TICKTICK_CLIENT_IDTICKTICK_CLIENT_SECRETTICKTICK_REDIRECT_URIOptional runtime defaults:
TICKTICK_OAUTH_AUTHORIZE_URL (default: https://ticktick.com/oauth/authorize)TICKTICK_OAUTH_TOKEN_URL (default: https://ticktick.com/oauth/token)TICKTICK_API_BASE_URL (default: https://api.ticktick.com/open/v1)TICKTICK_API_TIMEOUT_MS (default: 10000)TICKTICK_API_MAX_RETRIES (default: 3)TICKTICK_API_RETRY_BASE_DELAY_MS (default: 250)TICKTICK_OAUTH_SCOPETICKTICK_USER_AGENTToken and notification options:
TICKTICK_TOKEN_PATH (default: ~/.config/ticktick/token.json)TICKTICK_REAUTH_WEBHOOK_URLTICKTICK_REAUTH_NOTIFY_COOLDOWN_MSTICKTICK_REAUTH_NOTIFY_STATE_PATHOpenClaw integration is provided through createTickTickOpenClawSkill in skill-entry/ticktick-skill.mjs.
Expose the following actions:
create_tasklist_tasksupdate_taskcomplete_tasklist_projectsparseTickTickEnvFromRuntime.options.tokenPath -> TICKTICK_TOKEN_PATH -> default path).getAccessTokenWithAutoReauth).ReauthRequiredErrorbash
npm run ticktick:cli -- auth-url
bash
npm run ticktick:cli -- auth-exchange --callbackUrl "http://localhost:3000/oauth/callback?code=...&state=..."
bash
npm run ticktick:cli -- list-projects
npm run ticktick:cli -- list-tasks --projectId <projectId> --limit 20
npm run ticktick:cli -- create-task --projectId <projectId> --title "Write docs" --priority 3
npm run ticktick:cli -- update-task --taskId <taskId> --priority 5
npm run ticktick:cli -- complete-task --taskId <taskId>
parseTickTickEnvFromRuntime()createTickTickRuntime({ env, getAccessToken })runtime.useCases.*Normalize API/runtime errors to domain categories:
CategoryTypical Sourceauth_401Invalid/expired access tokenauth_403Scope/permission deniednot_found_404Missing task/project resourcerate_limit_429TickTick rate-limited requestserver_5xxTickTick server-side failurenetworkTimeout, transport, DNS, fetch failuresvalidationInput contract or payload mismatchunknownNon-classified fallback
Run after any implementation or integration change:
bash
npm run typecheck
npm test
If either gate fails, do not finalize until fixed or explicitly accepted by user.
ReauthRequiredError with message about missing token fileauth-url -> complete browser consent -> run auth-exchange.env values match TickTick app configurationTICKTICK_API_MAX_RETRIESTICKTICK_API_RETRY_BASE_DELAY_MSREADME.mddocs/openclaw-skill-guide.mdskill-entry/token-manager.mjsskill-entry/ticktick-skill.mjsscripts/ticktick-cli.mjssrc/core/ticktick-runtime.tssrc/core/ticktick-usecases.tssrc/api/ticktick-api-client.tssrc/api/ticktick-gateway.tssrc/shared/error-categories.ts