Skip to content

Quickstart ​

From sign-in to a draft pull request on GitHub. Allow about 15 minutes, most of it waiting for the turn to finish.

Before you start

You need an account in an organization that uses Yi Code, and credit on that organization. If your organization isn't set up yet, request access.

1. Sign in ​

  1. Open Yi Code at https://code.theyilabs.com and click "Sign in with your organization". The page may show the earlier product name "Preworld Code".
  2. Sign in with your Yi Labs account and choose your organization.

You land on "What would you like to do with your code?". The wallet at the bottom of the sidebar shows your organization's available credit.

If the page says "This organization is unavailable. Please contact your administrator.", the organization isn't set up for Yi Code, or has been suspended. See Organization, sign-in and roles.

2. Connect GitHub ​

  1. Click "Connect GitHub". GitHub opens the Yi Code app's installation page.
  2. Choose the GitHub account or organization, pick "Only select repositories", and select the repositories the agent may work on.
  3. Click Install. GitHub then asks you to authorize the app. This proves that the installation you just made belongs to your GitHub account. Yi Code stores no personal GitHub token from this step.

You're back on "What would you like to do with your code?". To add or remove repositories later, click "Manage GitHub repositories" under the message box.

An installation can be connected to one Yi Code organization only. Details are in Pull requests and GitHub.

3. Pick a repository and a branch ​

Under the message box, open "Select repository" and choose one. "Select branch" starts on the repository's default branch. Change it if you need to.

When you send the first message, the branch is resolved to its current commit. Every turn in this session works from that commit. Commits pushed to the branch later don't reach this session.

4. Choose Ask or Code, the model and the budget ​

  • Ask answers questions and never changes the repository. Use it first if you don't know the code yet.
  • Code makes changes. When it finishes you review the diff before anything goes to GitHub.

Click the "Budget" chip to open "Turn budget (USD)" and "Model". The budget is the most this turn can cost. It is held from your credit when the turn starts and released, less the actual cost, when it ends. Each mode has a minimum budget. The note under the message box tells you when the budget is too low or your credit is short. See Budget and billing.

5. Send the message ​

Type what you want, for example "Explain this repository's structure" in Ask, or "Make parse_date return None for empty strings and add a test" in Code. Click the arrow, or press Ctrl+Enter (⌘+Enter on a Mac).

The turn shows its progress: "Fetch source", "Detect validation", "Execute", "Validation", "Collect artifacts". It may wait in the queue for an execution environment first. Ask turns stop after 15 minutes at most and Code turns after 60.

Click "Enable completion notifications" at the top if you want the browser to tell you when the turn ends.

6. Review the result ​

When the turn ends you see:

  • The agent's answer, and "Tool steps" with every command and file edit it made.
  • The verification box: "Validation passed", "Validation failed" or "Unverified", the command that ran and the reason (see Verification).
  • A receipt with "Turn cost", the budget and the commit the session is pinned to.

Open "Session details" on the right for the session's total cost, the changes (lines added and removed, files), "View diff", and "Raw logs and artifacts" with the patch and the test output.

7. Create the draft pull request ​

The first time, connect your own GitHub account: in "Session details", under "GitHub publishing identity", click "Connect personal GitHub" and authorize on GitHub. Pull requests are opened with your authorization, and your account needs write access to the repository.

If the Code turn succeeded and you're happy with the diff, click "Create draft PR" and confirm "Publish the reviewed changes as a GitHub draft PR?".

Yi Code pushes the changes to a new branch, preworld/ followed by the session's ID, and opens a draft pull request against the branch you picked. "View draft PR" links to it. Nothing is merged. That stays with you on GitHub.

The button stays off when the latest turn is an Ask turn, when it didn't succeed, when the session has no changes, and until your GitHub account is connected.

8. Follow up ​

Type the next request in "Ask a follow-up or describe the next change…". The new turn starts from all changes made so far in the session, with its own budget. When it finishes, review it and click "Update draft PR". The same pull request gets a new commit on top. Nothing is force-pushed.

Next ​