Docs · Get started
Quickstart: from sign-in to a landed PR
This takes a repo from nothing to its first PR landed by ModernCI. It works the same on the hosted service and on an Enterprise self-install; only the URL differs.
Status today, so nothing here surprises you:
| Piece | Status |
|---|---|
| Sign in with a passkey | works on the hosted service today |
| Sign in with GitHub, Google, or email and password | built, but not turned on for the hosted service yet (passkey only today) |
| Plain git remotes (any git host over SSH, including Gitea and Forgejo) | built and wired |
| GitHub, GitLab and Gitea/Forgejo PR mirroring (status, comments) | built and wired per repo; push webhooks are not received yet, so ModernCI polls |
| Self-service sign-up and tenant creation | coming (an operator creates your tenant today) |
mci run (run a check on demand) and mci runner up (register your machine) | built; the download is coming (Built, release coming) |
mci mcp (stdio bridge for agents) | built; the download is coming (Built, release coming). Agents use the HTTP endpoint today (agents) |
1. Sign in
Open the console (https://app.modernci.dev for the hosted service) and choose a method: passkey, GitHub, Google, or email and password. The operator decides which are on, and a method is offered only if it is configured. On the hosted service today that is the passkey only. Then pick your project; the console talks to the region that holds it.
Signing in does not give you API access by itself. Your tenant admin creates an API token for the CLI and for agents:
mci tokens create --tenant "$TENANT" --project "$PROJECT" --role agent \
--kind agent --name builder
The token is printed once. Put it in the environment, together with your region's URL:
export MCI_URL=https://<your-region>.modernci.dev
export MCI_TOKEN=...
mci me
Approving guarded changes always needs a passkey, whichever way you signed in.
2. Create the project and connect a repo
A tenant admin (ModernCI creates the tenant and its first admin for you) runs:
mci projects create --tenant "$TENANT" --name web
mci repos add "$PROJECT" --name app --url "$REPO_URL" --targets '["main"]'
--url is the git remote ModernCI fetches from and lands to. --targets lists the branches that receive landings (default main). Writing secrets (mci secrets put) is in the API but answers "not implemented" today; configuration never holds secrets either way.
What the git host must allow
ModernCI lands by pushing a fast-forward with its own landing key. Give that key push access to the target branches, and make it the only key that can push to them (a protected branch whose push allow-list is the landing key). ModernCI checks this by pushing to a sentinel branch mci/probe/<target>, which must carry the same protection. Everyone else pushes branches and opens PRs. A separate read-only key lets the engine fetch.
| Host | Notes |
|---|---|
| Plain git / Gitea / Forgejo | Works today. PRs are branches pushed under mci/. The engine polls every 30 seconds (MCI_REFRESH_SECS); receiving push webhooks to skip the wait is coming. |
| GitHub | Built and wired (GitHub App or token, PR mirroring, commit status ci). |
| GitLab | Built and wired (project or group token, merge request mirroring). |
3. Add checks
Checks live in your repo, one file per target branch. Commit this as .ci/main.yaml on main:
checks:
build:
run: make build
test:
run: make test
needs: [build]
Everything about this file is in config. Settings such as budgets and approvers are not in the repo; they are set in ModernCI.
A new install starts paused so nothing runs before you are ready. The operator resumes it (mci resume; on the hosted service this is already done). You also need a compute connection before jobs can start:
mci computes connect --tenant "$TENANT" --plugin local \
--provided_by modernci --config '{"slots": 4}'
4. Push a PR and watch it land
git switch -c mci/add-feature
git commit -am "Add feature"
git push origin mci/add-feature
A branch under mci/ becomes a PR. If you pushed with a key ModernCI does not know it is unclaimed; submit it as yours:
mci prs done --repo app --branch mci/add-feature --head "$(git rev-parse HEAD)"
Watch it:
mci prs list "$REPO" # status and wait reason for each PR
mci prs show "$PR" # diff, checks, logs, approvals, cost
mci log "$RUN" # a run's log
mci watch # your events: reds, landings, approvals needed
or open the PR page in the console. When every required check is green the merge queue batches it with other PRs, re-checks it on the current tip, and the landing process fast-forwards main. A red shows the failing check, a log excerpt and how to reproduce it. If you change .ci/ in a way that changes what blocks landing, the PR waits for a person's passkey approval (gate changes).
5. Run a check yourself, and add your own machine (coming)
mci run <check> (run a check on demand, locally or remotely) and mci runner up (enrol this machine as a runner) are planned and are not in this branch's mci. Until then, reproduce a red from the command in its run: line.