Skip to main content

Import a project into CodeGraph

Import local or remote source, verify the job, and select explicit project scope. The page explains the purpose, usage steps, and result checks.

User Guides

Project import creates or refreshes a named project from a local checkout or Git repository. Run it from the CodeGraph source checkout with the tenant/group scope approved by your administrator.

Inspect the current parser

python -m src.cli import --help

The required source selector is exactly one of --path or --repo. The supported mode choices are shown as --mode {full,selective,incremental}.

Import a local checkout

python -m src.cli import --path <source-directory> --mode full

Use --language only when automatic detection is wrong. Use --include and --exclude to bound the source surface; verify those filters before relying on completeness claims.

Import a remote repository

python -m src.cli import --repo <repository-url> --branch <branch> --mode full

Do not embed credentials in the URL. Use the customer-approved Git credential mechanism. Pin the branch, tag, or commit through the surrounding release procedure when reproducibility matters.

Monitor and verify

python -m src.cli jobs
python -m src.cli projects list
python -m src.cli projects info <project-name>

Start a high-stakes analysis after the import job completes and project/CPG freshness is current. Import completion requires both the project row and a successful graph build.

Select explicit project scope

Set a tenant/group default only when authorized:

python -m src.cli projects set-default <project-name>

Personal selection uses the projects preference subcommand; inspect its exact help before mutation. Use projects info and projects resolve-scope to diagnose ambiguous scope.

Refresh and recovery

  • incremental is appropriate only when the current project state and source lineage are valid.
  • Use full when the graph must be rebuilt from the selected source surface.
  • If a job fails, preserve the job status and error, correct the source/access/configuration cause, and rerun with the same explicit selector.
  • Do not delete or rename a project as a troubleshooting shortcut; those are separate authorized lifecycle changes.

Project output supports professional analysis but does not establish product acceptance by itself.

Contract sources

  • src/cli/__main__.py — root command registration;
  • src/cli/core_commands/import_commands.py — import parser;
  • src/cli/core_commands/projects_commands.py — project scope operations;
  • src/cli/import_runtime_commands.py — import execution routing.

See also: CLI guide · Quick start