Skip to main content

Pin a repository to a project

Normally the project of a session comes from the central configuration: the project that lists the session's origin remote wins. To override that for one checkout, for example a fork whose remote is not listed anywhere, pin the project key:

cd ~/code/my-fork
costpilot-agent init --project --project-key PLAT --endpoint https://costpilot.example.com --token <secret>

init --project takes endpoint and token only from an earlier project-level init in the same checkout, so pass them the first time; otherwise the hook is written for http://localhost:8787.

The key is baked into the hook command (--project-key PLAT) and kept on re-runs. The hook then reports project_key: "PLAT" with every mapping and uses that project's issue key pattern if it has one. An unknown key is still reported as project_key, with the default issue pattern; the dashboard shows such usage under "No project" until the key exists in Admin → Projects.