C3 AI Documentation Home

Start from a Git Repository

Your team already wrote an application, and that application is held in a Git repository. Importing brings the application into C3 Code, so the agent, the configuration tools, and deployment all apply to code your team wrote elsewhere.

You point C3 Code at a repository and a branch, then specify where the application is located inside that repository. C3 Code copies the code into a new workspace.

What the import expects from that repository decides whether this route suits your code.

What the import needs

The import expects a repository that already holds a C3 AI application. C3 Code looks for a package, which is a unit of C3 AI software, and looks for a matching .c3pkg.json file inside that package folder. You specify where the package folder is located, so C3 Code can find the package.

Code written outside the C3 Agentic AI Platform works differently. A React application with its own backend services carries no C3 AI package, so the import has no package to find.

The agent converts that code instead. Create an application in C3 Code, bring your existing code into the workspace, then ask the agent to rewrite the frontend and the backend into the patterns C3 AI uses. Describe what the application does today, and what must behave the same afterward. The agent works through that conversion like any other change. Expect a conversion to take several requests, and check the behavior yourself in Preview as the conversion proceeds.

For writing a first prompt and refining what comes back, see Start from Scratch.

Before you begin

Confirm both of the following before you import:

  • Your Git account is connected. C3 Code reads the repository list from your account, so the list stays empty until you connect an account.
  • You know where your package is located, measured from the top of the repository.

For connecting your account and linking a repository, see Connect GitHub.

Import the repository

Complete the import dialog with the repository, the branch, and the location of the package:

  1. On the Applications page, start creating an application and choose the Git source. The Import from Git repository dialog opens.
  2. Select a Repository. The list is searchable, and shows each repository as owner and name.
  3. Select a Branch. Your first workspace starts on the branch you select.
  4. Enter the Application Path.
  5. Enter the Package name.
  6. Enter an Application name, or leave the field empty to use the package name.
  7. Select Create.

C3 Code creates the application, copies the repository into the first workspace on the branch you chose, and opens that workspace.

What the import changes

The repository becomes the shared copy for the application. Every workspace you create later uses that same repository, and each workspace works on a branch.

C3 Code copies the repository as the repository stands. Your folder structure, your branches, and your history all survive the import unchanged.

For saving, branching, and reviewing your code, see Review Code and Manage Branches.

When to import and when to connect

Two routes leave you with an application and a connected repository, and they differ in which exists first.

Import from a Git repository starts with code that already exists, and creates an application around that code.

Connecting a repository starts with an application you already built in C3 Code, and publishes that application into a repository.

Import when the code came first. Connect when the application came first.

Join an application another person built

You can join a colleague's application directly, with no import and no new application of your own.

An administrator of that application adds you as a collaborator. The application then appears in your Applications list, and you create a workspace of your own inside that application.

For adding people and sharing a preview link, see Share with Collaborators.

Where to go next

These pages cover working with the code once the import finishes:

Was this page helpful?