Bitbucket setup prompt
Paste this into your coding agent (Claude Code, Codex, Copilot CLI…) from your repository’s folder. It checks your Bitbucket connection, the repository link and this laptop’s git sign-in, and asks before changing anything. In Claude Code, once This laptop is set up, /ikanban-bitbucket-setup does the same.
Help me use a Bitbucket Cloud repository with iKanban, so its agents can work in it on this laptop. Run the checks yourself, ask me before changing git settings or opening a browser sign-in, and don't change files in this repository.
Rules
- Never print a token or password. Report yes/no only.
- If `.iKanban/settings-local.json` exists, read `api_url` into `U` and `api_key` into `K` without echoing the key.
- Go step by step. After each step, tell me what's ready and what I do next.
1. My Bitbucket account is connected to iKanban
- Check: `curl -s $U/api/settings/bitbucket -H "Authorization: Bearer $K"`.
- `configured: false`: this iKanban server can't connect Bitbucket yet; I ask my iKanban administrator.
- `connected: false`: I open iKanban → Agent settings → Connections → Bitbucket → Connect, and approve access for iKanban on Bitbucket (it only reads my account and repositories).
- Then `curl -s $U/api/settings/bitbucket/check -H "Authorization: Bearer $K"` should say `status: ok`. `rejected` means I click the row and approve again.
2. The repository is linked to my project
- I open Connections → Bitbucket → Configure, click Link next to the project, and pick the repository.
- If the list is empty, I have no readable repositories in that Bitbucket account, or I'm signed in to a different one.
3. This laptop can reach the repository with git
- Check: `git ls-remote https://bitbucket.org/<workspace>/<repository>.git HEAD` prints a commit hash.
- If not, ask me which I prefer:
- API token: Bitbucket profile → Account settings → Security → Create and manage API tokens → Create API token with scopes → app Bitbucket → scopes read:repository:bitbucket and write:repository:bitbucket → Create token. I copy it (shown once). Then I run the `git ls-remote` again; the username is `x-bitbucket-api-token-auth` and the password is the token, and the keychain remembers it.
- An SSH key already on Bitbucket: `git config --global url."git@bitbucket.org:".insteadOf "https://bitbucket.org/"`.
4. Prove it
- I start a small iKanban session in that project: "reply with a one-line summary of this repository; don't change files". The session page should show it reading files, then the answer.
Note: agents can push a branch (they ask me first), but iKanban doesn't open Bitbucket pull requests yet; I open one from the branch on bitbucket.org.
Finish with one line per step: ready / needs action / couldn't check, and the fix.