---
name: kimaki-tunnel
description: Share a local dev server with the user through a public URL. Localhost URLs are useless from Discord. Use when the user should open a localhost app in a browser, test a webhook or OAuth callback against a local server, or preview a dev server from Discord. Runs `kimaki tunnel` in a named background tuistory session. ALWAYS load before starting a dev server the user must open. Only for Kimaki Discord sessions.
title: kimaki-tunnel
canonical_url: https://skilld.dev/gh/remorses/kimaki/kimaki-tunnel
last_updated: 2026-10-30T13:11:14.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install remorses/kimaki/kimaki-tunnel`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/kimaki-tunnel`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/remorses/kimaki/kimaki-tunnel) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/kimaki-tunnel`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/kimaki-tunnel --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/kimaki-tunnel --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Dev servers with tunnel access

Localhost URLs are useless from Discord. Wrap the dev server in `kimaki tunnel` to get a public `https://<name>.<id>.opentunnel.xyz` URL, and run it in a named background `tuistory` session so you can wait for output, read logs and stop it later. Name the session descriptively (e.g. `projectname-dev`) and reuse it. Run `tuistory --help` first (or `bunx tuistory` when it is not installed). Invoke `kimaki` directly, not via `npx` or `bunx`.

- **Validate on localhost.** The agent runs on the same machine as the server, so playwriter, curl and tests must use the `Local:` URL. It is much faster. The tunnel URL is only for the user.
- Use random names by default. Pass `-t <name>` only for services that are safe to be publicly discoverable.
- `kimaki tunnel` detects the local port from the child output. Pass `--port` only when the server prints no detectable localhost URL.
- `kimaki tunnel` injects `KIMAKI_TUNNEL_URL` into the child process. Wire the app to it so OAuth callbacks, webhook URLs and absolute links use the public URL.
- The app gets `Host: localhost:<port>` and the public host in `X-Forwarded-Host`, so Vite needs no `allowedHosts` config.
- The first run on a machine creates the tunnel and waits up to a minute for its certificate.

```bash
# start in a named background session, wait for output, then read the tunnel URL
tuistory launch "kimaki tunnel -- pnpm dev" -s myapp-dev
tuistory -s myapp-dev wait "/Tunnel: https/" --timeout 90000
tuistory read -s myapp-dev

# pass the public URL to the app (better-auth, Next.js, Vite; node reads process.env.KIMAKI_TUNNEL_URL)
tuistory launch "kimaki tunnel -- sh -c 'BETTER_AUTH_URL=\$KIMAKI_TUNNEL_URL exec pnpm dev'" -s myapp-dev
tuistory launch "kimaki tunnel -- sh -c 'APP_URL=\$KIMAKI_TUNNEL_URL exec pnpm dev'" -s myapp-dev

# fixed name (only for intentionally public-safe services)
tuistory launch "kimaki tunnel -t holocron -- pnpm dev" -s holocron-dev

# restart the server on a known port and keep the URL
tuistory launch "kimaki tunnel -t holocron -p 5173 --kill -- pnpm dev --port 5173" -s holocron-dev

# list sessions; stop with Ctrl+C, then close
tuistory sessions
tuistory -s myapp-dev press ctrl c
tuistory -s myapp-dev close
```

Share the printed public URL with the user as a clickable link. Stop the session when the user is done.
