···11+# create-tangled-repo
22+33+A small Bun + Playwright helper that creates Tangled repositories through Tangled's real appview flow.
44+55+It logs in through the Bluesky OAuth page when needed, saves a reusable Tangled web session locally, and then creates repositories by posting to the same `/repo/new` route the web UI uses.
66+77+## Why this exists
88+99+Tangled exposes lower-level repo creation plumbing, but creating a repo directly through the knot XRPC path can leave you with a repo that the appview does not ingest. This tool uses the appview-backed path so the created repo shows up properly in Tangled.
1010+1111+## Requirements
1212+1313+- [Bun](https://bun.sh/)
1414+- A Tangled / Bluesky account
1515+- Your normal account password for the Bluesky auth flow
1616+- A Tangled knot where you can create repos
1717+1818+The script downloads Playwright Chromium automatically on first run.
1919+2020+## Usage
2121+2222+```bash
2323+bun install
2424+./create-tangled-repo.js --identifier alice.mosphere.at --password 'your-normal-password' my-repo
2525+```
2626+2727+You can create more than one repo at once:
2828+2929+```bash
3030+./create-tangled-repo.js repo-one repo-two
3131+```
3232+3333+The script remembers the last knot you used. If no knot is configured yet, it defaults to `knot1.tangled.sh`.
3434+3535+## Options
3636+3737+```text
3838+--identifier <handle> Bluesky/Tangled handle for login, if a new session is needed
3939+--password <password> Account password for OAuth login, not an app password
4040+--knot <domain> Knot domain to host the repo on
4141+--branch <name> Default branch. Default: main
4242+--description <text> Optional repo description
4343+--host <url> Tangled appview base URL. Default: https://tangled.org
4444+--session-file <path> Stored session state file
4545+--config-file <path> Stored config file
4646+--login-only Refresh/login and save session, create nothing
4747+--show-browser Show the browser window during login
4848+```
4949+5050+## Cache files
5151+5252+By default the script stores:
5353+5454+- session state in `/workspace/.cache/tangled/session.json`
5555+- config in `/workspace/.cache/tangled/config.json`
5656+- Playwright browsers in `/workspace/.cache/ms-playwright`
5757+5858+You can override those with environment variables.
5959+6060+## Notes
6161+6262+- The password is your normal account password, not an app password.
6363+- App passwords are fine for the lower-level protocol path, but that path can create ghost repos.
6464+- This script intentionally takes the dirty path because it is the one that works today.