{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "ronglecat-grok-app--script-agent-sessions-via-local-api",
 "repo": "RongleCat/grok-app",
 "repo_url": "https://github.com/RongleCat/grok-app",
 "repo_slug": "ronglecat-grok-app",
 "title": "Script agent sessions through the loopback REST API",
 "page_title": "How to script agent sessions through the loopback REST API with Grok App",
 "summary": "Call the local session endpoints from scripts or CI to list sessions and send turns.",
 "who": "A developer building a script or CI step that needs to start or continue agent work on a local machine.",
 "problem": "Starting agent work by hand in the GUI does not fit repeatable scripts or pipelines.",
 "outcome": "A script that lists existing sessions and posts a new turn to a chosen session.",
 "steps": [
  "Launch Grok App and keep it running on the machine that hosts the sessions.",
  "List the existing sessions with a GET request to the loopback endpoint `GET /v1/sessions`.",
  "Pick a session identifier from the response.",
  "Send a new prompt with a POST request to `POST /v1/sessions/{id}/turns`, replacing {id} with the chosen identifier.",
  "Check the session in the desktop timeline to confirm the turn arrived."
 ],
 "agent_prompt": "Using the Grok App repo (https://github.com/RongleCat/grok-app), call the loopback session API to list sessions and post one turn to session <session-id> with the prompt <prompt-text>. Expected output: a successful response and a new turn in that session's timeline. Verify the session identifier against the GET /v1/sessions response before posting.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "1 hour",
 "basis": "readme",
 "caveat": "The README names the two endpoints but does not document request or response bodies, port numbers, or authentication, so check the app for those details before relying on them.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "typescript",
 "requirements": [
  "Grok Build CLI (grok) version 0.2.112 or newer, installed and signed in, or an API key or custom relay configured in the app",
  "A project folder you are willing to let the agent work in",
  "Git installed if you plan to use Git worktrees or Git diff review"
 ],
 "risk": "sensitive",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.7,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/ronglecat-grok-app/script-agent-sessions-via-local-api/",
 "md": "https://dedupedai.com/use-cases/ronglecat-grok-app/script-agent-sessions-via-local-api/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/ronglecat-grok-app--script-agent-sessions-via-local-api.json",
 "api_version": "v1"
}
