Codebase Intelligence Pack avatar

Codebase Intelligence Pack

Under maintenance

Pricing

from $20.00 / 1,000 results

Go to Apify Store
Codebase Intelligence Pack

Codebase Intelligence Pack

Under maintenance

Turn GitHub repositories or ZIP archives into AI-ready architecture, routes, dependencies, auth and database reports. Optional file fingerprints, unified JSON and report ZIP. Static analysis needs no AI key.

Pricing

from $20.00 / 1,000 results

Rating

0.0

(0)

Developer

Varun Chopra

Varun Chopra

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

13 days ago

Last modified

Features

Limited permissions

Share

What does Codebase Intelligence Pack do?

Turn a GitHub repository or ZIP archive into an AI-ready codebase overview. This Actor performs static analysis and writes architecture, entry-point, dependency, route, authentication, database, environment and unused-file reports, plus two Markdown navigation reports. It does not execute repository code, install its dependencies, audit vulnerabilities, or prove that unused-file candidates are safe to delete.

No AI API key is required. Optional OpenAI, Google Gemini or Anthropic enrichment adds short top-level folder descriptions. All original report names and source modes remain supported.

Key features and use cases

  • Onboard humans and coding assistants: give an AI assistant a compact map instead of asking it to rediscover every directory.
  • Review architecture and migration scope: inventory routes, frameworks, auth patterns, models and referenced environment-variable names.
  • Integrate via one file: opt in to analysis.json, which collects all nine analysis sections in a versioned document.
  • Download a complete report pack: opt in to intelligence-pack.zip; it contains generated reports, not the uploaded repository.
  • Compare file inventories externally: sorted file metadata with optional SHA-256 fingerprints. This release does not implement caching or incremental analysis.
  • Reduce scan noise: include/exclude globs and optional root .gitignore support.
  • Reuse private/local uploads: read a ZIP record from an existing accessible Apify KV store with uploadedZipStoreId.
  • Automate on Apify: use the platform’s API, saved tasks, schedules, webhooks and integrations. This Actor does not create schedules or send notifications itself.

How to analyze a repository

  1. Open the Actor’s Input tab in Apify Console.
  2. Choose github, zipUrl or uploadedZip and supply that source’s fields.
  3. Start with static analysis, modest maxFiles, and the default all output format.
  4. Optionally enable consolidated JSON, file inventory, hashing, report ZIP and root .gitignore filtering.
  5. Check the Pricing tab, then choose Save & Start.
  6. Open Output for report links and the dataset’s Repository overview / Reports and downloads views. Optional links only resolve when enabled; JSON/Markdown links depend on outputFormat.

GitHub example

{
"sourceType": "github",
"githubUrl": "https://github.com/expressjs/express",
"branch": "master",
"maxFiles": 2000,
"respectGitignore": true,
"includeConsolidatedOutput": true,
"createOutputArchive": true
}

Omit branch to use the repository’s default branch. For private repositories, enter a read-scoped token in the secret githubToken field; it must have access to that repository and any required organization SSO authorization. Prefer the repository-root URL plus an explicit branch, particularly for branches containing /. URLs pointing to a specific file/subdirectory are not a subdirectory-scan option.

ZIP URL example

{
"sourceType": "zipUrl",
"zipUrl": "https://example.com/project.zip",
"includeFileInventory": true,
"includeFileHashes": true
}

Use a direct public HTTP(S) ZIP URL, not a web page. Embedded username/password is rejected. Query parameters can be used for signed downloads, but are stripped from generated source metadata. Do not supply internal network or cloud metadata endpoints. Non-ZIP archives, encrypted archives and symlink entries are not supported.

Uploaded ZIP: repeatable cloud workflow

  1. Create or select a KV store you own in Console Storage.
  2. Upload the repository ZIP as a binary record such as SOURCE_ZIP, with content type application/zip.
  3. Set uploadedZipStoreId to that store’s ID and uploadedZipKey to the record key. The run must have permission to read the store.
  4. Results are written to the run’s default KV store, not back to the source store. The source record is not modified.
{
"sourceType": "uploadedZip",
"uploadedZipStoreId": "YOUR_SOURCE_STORE_ID",
"uploadedZipKey": "SOURCE_ZIP",
"includeConsolidatedOutput": true,
"includeFileInventory": true,
"createOutputArchive": true
}

If uploadedZipStoreId is omitted, the Actor reads from the run’s default KV store (legacy behavior). For local runs, prepare a binary KV record with the Apify SDK before apify run; SDK 4 stores the raw record under its exact key plus a content-type metadata file. The included scripts/local_smoke.py demonstrates the layout. Do not use --purge after preparing the source record. To make a clean ZIP from a local Git repository, use git archive --format=zip HEAD -o project.zip; this excludes uncommitted files.

Full input reference

See the Input tab for grouped fields and editors. All optional feature switches default to false; unknown extra JSON fields are ignored for forward compatibility. Invalid types, enum values, bounds and cross-field combinations fail before downloading or constructing an AI client.

FieldTypeDefaultDescription
sourceTypestring"github"Choose a GitHub repository, public HTTP(S) ZIP archive or ZIP pre-uploaded to the default KV store.
githubUrlstring"https://github.com/expressjs/express"Full GitHub repository URL. Use branch for branch names containing slashes. Blank uses the Express example repository.
githubTokenstring""Token with read access to the selected repository. Needed for private repositories; never added to output. Organization SSO authorization may be required.
branchstring""Explicit branch, tag or commit SHA; overrides a ref in githubUrl. Blank uses the repository default branch.
zipUrlstring""Required for zipUrl source. HTTP(S) URL returning a ZIP, not an HTML download page. Embedded username/password is not allowed. Signed query parameters are removed from output metadata.
uploadedZipKeystring""Required for uploadedZip source. Pre-upload a binary application/zip record to the default KV store used by the run; see README.
uploadedZipStoreIdstring""Existing KV store containing uploadedZipKey. Blank reads from the run’s default store (legacy behavior). Use this field to reuse an uploaded archive across cloud runs; the run must have access to that store.
maxFileSizeKbinteger500Skip individual files larger than this many KiB (1024 bytes). Range: 1–10240; lower values reduce scanning time.
maxFilesinteger10000Stop indexing after this many eligible files. Range: 1–100000. Higher values increase memory, time and output sizes.
includePatternsarray[]Optional list of Python fnmatch-style globs against repository-relative POSIX paths; e.g. src/* or *.py. Not .gitignore syntax. Up to 100 patterns, 1024 characters each.
excludePatternsarray[]Skip matching repository-relative paths; explicit exclusions take precedence. Dependency, VCS, build and binary files are always skipped. Up to 100 patterns, 1024 characters each.
respectGitignorebooleanfalseOpt in to Git ignore/negation semantics from the root .gitignore only. Ignored parents stay pruned; nested .gitignore files are not evaluated. Always-ignored files and explicit exclusions still win.
outputFormatstring"all"Generate all original reports, only nine JSON analyses, or only two Markdown reports. Explicitly requested bundle/inventory artifacts are independent of this setting.
includeConsolidatedOutputbooleanfalseAlso write analysis.json: versioned source metadata, counts and all nine analysis sections. Off by default; useful for API integrations and AI workflows.
createOutputArchivebooleanfalseAlso write intelligence-pack.zip containing exactly this run’s generated reports, including optional JSON artifacts. Never includes uploaded code, INPUT or stale KV records.
includeFileInventorybooleanfalseAlso write file-inventory.json: sorted path, language, bytes, approximate non-comment line count and readability for each indexed file. No file contents.
includeFileHashesbooleanfalseAdd SHA-256 hashes to file-inventory.json for comparing snapshots externally. Requires includeFileInventory=true. No incremental cache or change detection is performed.
llmProviderstring""Opt-in provider for folder-summary.md only. Blank, a missing API key, json-only output, or maxLlmDirectories=0 uses static analysis. AI is not needed for any core report.
llmApiKeystring""Your API key for the selected provider. Sent only to that provider; never added to generated reports or the report archive. The secret input itself remains in Apify input storage under your access controls.
llmModelstring""Optional model ID supported by your provider account. Defaults: openai=gpt-4o-mini, google=gemini-3.5-flash-lite, anthropic=claude-haiku-4-5-20251001. Model availability and provider prices may change.
llmTimeoutSecsinteger30Total deadline for each optional directory description, including SDK retries. Range: 5–120. A timeout falls back to static descriptions.
maxLlmDirectoriesinteger20Enrich up to this many top-level directories in alphabetical order (0 disables AI, max 100). Default 20 bounds provider usage; each request may retry up to twice.
requestTimeoutSecsinteger120Per-attempt total source download/API deadline, including streaming. Range: 5–600. Transient failures retry up to twice with bounded backoff.
maxDownloadSizeMbinteger100Compressed source archive limit for URL and uploaded ZIPs. Range: 1–1024 MiB. Expanded archive hard limit is 2 GiB and 100000 entries.

includeFileHashes requires includeFileInventory=true. Selecting an AI provider without a key preserves static-only behavior. sourceType is required by the Console schema; the runtime uses github if omitted. Explicit exclusions and always-ignored dependency/build/VCS/binary files take precedence over inclusions and .gitignore negation.

Filtering details

includePatterns and excludePatterns use Python fnmatch matching on relative POSIX paths; * may match /. They are not Git pathspecs or a full globstar implementation. respectGitignore separately enables Git-style rules from only the root .gitignore, including negation and ignored-parent pruning. Nested .gitignore files are not processed. A root containing both README.md and a single src/ directory is preserved; only an archive with one top-level directory and no sibling files is unwrapped.

Output files and examples

The default all mode writes 11 reports to the run’s default KV store:

FileContents
architecture.jsonLayers, inferred architectural patterns and summary
entrypoints.jsonEntry files, startup scripts, Docker and CI hints
dependencies.jsonManifest dependencies, internal imports, simple two-node circular dependencies
api-routes.jsonDetected method/path/file/line/framework for supported route patterns
database.jsonDatabase/ORM hints, schemas, models and connection-variable names
authentication.jsonAuthentication strategy and implementation hints
unused-files.jsonReachability-based unused candidates with confidence notes
tech-stack.jsonLanguages, frontend/backend frameworks and toolchain hints
environment.jsonReferenced variable names and documentation status, not .env assignment values
folder-summary.mdRoot files, top-level folders and optional AI folder descriptions
code-map.mdStatic annotated file tree and key-file navigation

Opt-in outputs:

FileEnable withContents
analysis.jsonincludeConsolidatedOutputschemaVersion: 1, sanitized source metadata, counts and all nine JSON analysis sections
file-inventory.jsonincludeFileInventorySorted relative paths, bytes, language, approximate non-comment lines, readability and optional SHA-256
intelligence-pack.zipcreateOutputArchiveExactly this run’s generated original reports and requested optional JSON artifacts

outputFormat controls only the original 11 reports. Explicit optional bundle/inventory outputs are independent, including in markdown-only mode. The archive never includes INPUT, uploaded source files, provider keys, or old KV records. Reports can still contain sensitive names, comments or metadata from the repository; they are not a secret-sanitization guarantee.

Dataset summary example

One summary item is emitted per successful analysis. You can download the dataset in various formats such as JSON, HTML, CSV, or Excel. The original ten fields are preserved; five additive fields provide source/size information and optional artifact links.

{
"repoUrl": "https://github.com/example/project",
"techStack": "Python · FastAPI",
"totalFiles": 42,
"totalRoutes": 5,
"authStrategy": "JWT",
"dbType": "PostgreSQL (SQLAlchemy)",
"unusedFileCount": 3,
"kvStoreUrl": "https://api.apify.com/v2/key-value-stores/EXAMPLE_STORE/records",
"analysisTimeMs": 1200,
"runAt": "2026-11-10T09:30:00+05:30",
"sourceType": "github",
"totalBytes": 123456,
"analysisUrl": "https://api.apify.com/v2/key-value-stores/EXAMPLE_STORE/records/analysis.json",
"inventoryUrl": "",
"archiveUrl": ""
}

runAt is emitted in ISO 8601 UTC by the Actor (the example shows the equivalent IST representation). Disabled optional artifact URL fields are empty strings. KV report URLs are access-controlled according to your Apify storage settings; a link is not a grant of public access.

Consolidated JSON structure (abridged)

{
"schemaVersion": 1,
"source": {"sourceType": "github", "repoUrl": "https://github.com/example/project"},
"summary": {"totalFiles": 42, "totalRoutes": 5},
"analysis": {
"architecture": {},
"entrypoints": {},
"dependencies": {},
"api_routes": {},
"database": {},
"authentication": {},
"unused_files": {},
"tech_stack": {},
"environment": {}
}
}

The empty objects above stand for the full individual report objects. Section names are stable snake_case in this new bundle; existing individual JSON contents are retained.

File inventory item example

{
"path": "src/main.py",
"language": "Python",
"sizeBytes": 1350,
"lineCount": 34,
"readable": true,
"sha256": "51d6804789cf329de54ff32bac2574c0ee64f42406c8d0527d31ea7a488b2b45d"
}

Hashes are omitted unless requested, and are null if the file cannot be read. This is a fingerprinting aid, not a built-in cache or diff engine.

Optional AI provider setup

  1. Obtain a provider API key from OpenAI, Google AI Studio, or Anthropic Console.
  2. Select the matching llmProvider and paste the key into the secret llmApiKey input, not a URL or source file.
  3. Optionally specify an available llmModel. The Actor does not translate model names or guarantee access to every provider model.
  4. Keep maxLlmDirectories low and inspect provider billing separately.
ProviderDefault modelSDK
openaigpt-4o-miniOpenAI async client
googlegemini-3.5-flash-liteNew google-genai native async client
anthropicclaude-haiku-4-5-20251001Anthropic async Messages client

Only folder names and up to 15 filenames per top-level folder, plus a short instruction, are sent for enrichment; full file contents are not sent. code-map.md remains static. Safety defaults are not disabled. SDK requests use bounded retries/timeouts; errors, blocked/empty responses and unsupported models fall back to static folder descriptions, and clients are closed. AI-generated text can be inaccurate. Provider deprecations may require changing llmModel later.

Pricing and cost notes

The Actor’s current configured pay-per-event pricing is $0.02 for one dataset result, with one summary result per successful run, plus an actor-start event of $0.00005 per GB of configured run memory (minimum one event). At the existing 4 GB default, the illustrative base is $0.0202 per successful single-repository run, before optional provider charges or any plan-specific adjustments. Failed runs may still incur the start event. Check the live Pricing tab before running; prices and platform terms may change. This release does not change pricing or the configured run memory.

AI enrichment is charged separately by your selected provider. Default maxLlmDirectories=20 means at most 20 logical enrichment requests; each may retry up to twice, so provider attempts and charges can be higher. Requests use an output-token cap of 200, but reasoning or provider-specific billing may differ. Static-only mode makes no AI calls. ZIP/inventory/hash creation adds CPU, disk I/O and storage; higher scan limits increase runtime. No exact speed or dollar savings are promised.

API and local development

Use the Actor’s API tab for account-specific run examples. A Python integration can use an environment-provided token without embedding it in code:

import os
from apify_client import ApifyClient
client = ApifyClient(token=os.environ["APIFY_TOKEN"])
run = client.actor("wheat_tourist/codebase-intelligence-pack").call(run_input={
"sourceType": "github",
"githubUrl": "https://github.com/expressjs/express",
"includeConsolidatedOutput": True,
})
items = client.dataset(run["defaultDatasetId"]).list_items().items

The token belongs to the caller’s Apify account, not an AI provider. Never add it to a report URL or share it with report consumers.

For local development:

python -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
apify validate-schema
python -m pytest -q
ruff check src tests scripts
python -m compileall -q src tests scripts
apify run --input-file input.json

Use apify run, not python -m src, for the Actor integration run so local storage/environment is configured. Local storage is not automatically uploaded to Apify Console. Deploy using apify push. The production Docker image uses Python 3.12. scripts/update_schemas.py regenerates schemas from the validated input model and cross-checks the dataset producer.

Limits, reliability and safety

  • One repository/archive per run; no repository code is executed, no submodules are fetched, and no package install/build/test is run against the analyzed source.
  • Default limits: 10,000 eligible files, 500 KiB per file, 100 MiB compressed ZIP, 120 seconds per network attempt. Configurable maxima: 100,000 files, 10 MiB per file, 1 GiB compressed ZIP and 600 seconds per attempt. Archive hard limits: 2 GiB expanded and 100,000 entries.
  • Source HTTP timeouts and transient 408/429/5xx failures retry up to twice. Permanent source errors fail with a useful message; optional AI failures do not fail static analysis. Malformed, traversal and symlink ZIP entries are rejected before extraction. Temporary extracted sources are cleaned up.
  • Text reads are bounded by the configured per-file limit. Cached text is capped at 16 million characters; hashes stream bytes. Non-UTF-8 encoding detection is heuristic and can misidentify ambiguous text.
  • Static analysis is pattern-based, not a compiler or full language server. Alias imports, dynamic imports, generated code, unusual route syntax and monorepo layouts may be incomplete. Internal-import graph scanning is capped at 500 source files; unused candidates at 100, orphaned assets at 50 and circular results at 10. Circular detection finds simple mutual two-node imports, not arbitrary cycles.
  • Binary/media/lock files are deliberately excluded; orphaned-asset output therefore cannot inventory all skipped assets. Approximate line counts exclude blank/comment-looking lines; they are not language-aware LOC.
  • No vulnerability verdict, secret audit, license compliance check or guarantee of correctness is provided. Review unused candidates manually before deleting anything.
  • Filesystem paths, filenames, comments and dependency metadata can contain confidential or personal data. Only analyze repositories you are authorized to access, respect licenses, and control access to inputs, source stores and outputs. Secret input storage is separate from generated reports. Enabling third-party AI sends the limited folder metadata described above to that provider.

FAQ and troubleshooting

Do I need an AI key?

No. Leave llmProvider empty for all core static reports, inventory, bundle and ZIP outputs. A missing key, json-only, or maxLlmDirectories=0 also skips AI.

Enable its opt-in switch and check outputFormat. New optional JSON artifacts are independent of format selection; original JSON or Markdown reports are not. On local runs, inspect local storage/, not Console. Access-controlled cloud links may require authentication.

Why did GitHub return 403 or 404?

Check the repository URL, explicit branch and token scope/organization authorization. A private repository can return 404 when the token lacks access. Rate limits may also apply; do not assume the source was deleted.

Why can’t the Actor find my uploaded ZIP?

Set both uploadedZipStoreId and uploadedZipKey for a source stored before a cloud run. The record must be binary application/zip and accessible to the running account. The default output store is usually new for each cloud run; uploading to a different prior run’s store without setting its ID will not work.

Are the old inputs and filenames compatible?

Yes: all three original source modes, input names, original report filenames and ten dataset fields remain. New fields are additive and all five features are opt-in. Hardening now rejects invalid types and unsafe/oversized archives, and retired default AI models have been replaced. Existing custom model IDs still pass through unchanged. Optional AI now has a default 20-directory cap.

Does it modify repositories, or send source code to an AI?

It does not modify repositories or execute their code. Optional AI receives directory/file names only, not file contents. Generated reports can contain source-derived metadata and comments; treat them as confidential when appropriate.

How do I report a problem?

Use the Actor’s Issues tab with a run ID, non-sensitive reproduction input and the expected output. Never include tokens, private source archives or signed URLs in a public issue. Inspect the run log for field-specific validation or source failure messages.

Changelog

2026-11-10 — SDK migration, five optional features and Store-quality release

  • Migrated deprecated Google SDK; upgraded OpenAI, Anthropic, pathspec and chardet.
  • Added consolidated JSON, report ZIP, metadata/hash inventory, root .gitignore and reusable uploaded-source store selection.
  • Hardened validation, archive handling, retries, timeouts, logging, resources and client cleanup; fixed root/import/type-annotation defects.
  • Added dataset views, full storage/output schemas, a complete input reference and regression tests. See CHANGELOG.md for details.