Docs menu · For coding agents
Guides
- Overview
- Connect your assistant
- Asking for automations
- Connections and secrets
- Trigger links
- Looking after automations
- State between runs
- Troubleshooting
- FAQ
- For coding agents
Reference
For coding agents
How a coding agent with a terminal uses ClickRuntime: the loop from sign-in to a tested automation, what to tell the person, and what never to do.
This page is for coding agents, such as Claude Code, Codex, Cursor or Gemini CLI, that use ClickRuntime through the CLI or the API instead of the MCP server. Use the MCP server when it's connected; use the CLI when you have a shell and it isn't.
The loop#
- Check.
npx clickruntime status --json. Exit code 3 means not signed in. - Sign in.
npx clickruntime login --device --no-wait --jsonprintsnext.saywith a link and a code. Tell the person, then runnpx clickruntime login --continue --json. With a browser on the same machine,npx clickruntime loginopens it instead. - Write. Read the script reference first:
npx clickruntime docs runtime. Thennpx clickruntime init "<name>" --pattern schedule, editautomation.pyandclickruntime.json, and runnpx clickruntime save --json. - Set up.
npx clickruntime setup <id> --json. Exit code 4 means the person has steps to do. Give them every step in one message, eachurlexactly as printed, then check again when they say they're done. Usenpx clickruntime connect <app> --automation <id> --jsonfor an account the setup lists. - Go live.
npx clickruntime deploy <id> --jsonprints a confirm link (exit code 4). Give it to the person, then runnpx clickruntime wait <confirmation_ref> --json. - Test.
npx clickruntime run <id> --jsonasks the person to confirm a run; for a trigger link,npx clickruntime test-event <id> --file sample.json --json. Read the run withnpx clickruntime run-log <run_id> --wait --json. If it failed, fix the script,save,deployand test again.
What to tell the person#
- When
nextis present, repeatnext.sayand givenext.urlexactly as printed. Never write, shorten or change a ClickRuntime link. - Ask for every setup step at once, not one at a time.
- Say an automation is live, changed or ran only after a command's result says so.
What never to do#
- Never ask for, accept, repeat or pass an API key, token or password, in a command or anywhere else. Keys are saved only in the ClickRuntime dashboard. If the person pastes one, tell them to revoke it and save a new one there.
- Never create an account or sign in for the person. The person signs in on the page the CLI opens.
- Never confirm for the person. Confirm links are for them.
- Never print or log the contents of
credentials.jsonorCLICKRUNTIME_TOKEN.
Exit codes#
0 done · 1 error · 2 usage · 3 not signed in · 4 waiting on the person · 5 rate limited · 6 cancelled or expired