# inrok for AI agents

Working with Claude Code, Cursor, Copilot, or another AI assistant? Paste the
block below into your project's `CLAUDE.md` / `AGENTS.md` (or your assistant's
custom instructions) and it will know how to drive inrok correctly.

Machine-readable docs live at [inrok.in/llms.txt](https://inrok.in/llms.txt)
(index) and [inrok.in/llms-full.txt](https://inrok.in/llms-full.txt) (full
docs, one file) — point your assistant at either.

## Paste-ready block

```markdown
## Public URLs via inrok

inrok exposes local ports at public HTTPS URLs (`https://<name>.share.inrok.in`).

- Check auth: `inrok status` exits non-zero with "not logged in" if no key is
  saved. Log in non-interactively: `inrok login --key <inrok_… key>` (keys are
  created by a human at https://app.inrok.in/settings → CLI access — never
  invent one).
- Expose an HTTP port: `inrok http <port> --name <name>`. This runs in the
  FOREGROUND until interrupted — run it in the background and poll
  `inrok status` until STATE shows the tunnel is up, then read the URL column.
- The public URL is printed on the "Forwarding" line and is stable: the same
  --name always re-binds the same URL, across restarts.
- Stopping the process (SIGTERM/Ctrl-C) keeps the name reserved; it only stops
  serving. To free the name and the tunnel slot, run `inrok stop <name>`.
- HTTP is the only backend mode today. TCP and UDP are coming soon; there are
  no static-site, Caddyfile, or file-drive modes.
- Free plan limits: 3 tunnels, 100 GiB/month. Tunnel creation failing with a
  limit error → run `inrok stop` on an unused tunnel first.
- Errors are single-line, human-readable, on stderr; exit code is non-zero.
  Full catalogue: https://inrok.in/docs/cli/troubleshooting.md
```

## Tips for agent authors

- **Foreground semantics are the #1 gotcha.** `inrok http` blocks. Agents
  should start it as a background process, wait for the `Forwarding` line (or
  poll `inrok status`), and capture the URL from there.
- **Names are idempotent.** `inrok http 8080 --name demo` after a crash or
  restart re-binds the exact same URL — safe to retry, safe to supervise.
- **Never scrape or guess API keys.** Key creation is a human step in the
  dashboard. If `inrok status` says "not logged in", surface that to the user
  instead of retrying.
- **Cleanup matters.** A polite agent runs `inrok stop <name>` when the tunnel
  was created for a temporary task — the free plan has 3 slots.
- The full command reference (generated from the CLI itself, always current)
  starts at https://inrok.in/docs/cli/reference/inrok.md
