Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.constants.io/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Constants integrates with GitHub to turn your existing scripts into tools:
  • Import scripts directly from any repository
  • Scan entire repos with AI to discover tool candidates
  • Bulk-create tools from scan results
  • Track provenance — know exactly what code is running

Connecting GitHub

Step 1: Open GitHub Settings

  1. Click your profile icon in the sidebar
  2. Look for the GitHub section
  3. Click Connect GitHub

Step 2: Authorize Constants

You’ll be redirected to GitHub to authorize the Constants app. We request:
  • Read access to your repositories (for importing scripts)
  • Read access to your profile information
You can revoke access at any time from your GitHub Settings → Applications → Authorized OAuth Apps.

Step 3: Confirm Connection

Once authorized, your GitHub username appears in the sidebar. You’re ready to import and scan.

Importing a Script

From the Composer

  1. Click Create new Tool
  2. Click the GitHub button or paste a URL directly
  3. Enter the repository URL:
https://github.com/your-org/your-repo/blob/main/scripts/process_data.py
Constants parses the URL, fetches the repository, analyzes the script, and generates the tool.

URL Formats Supported

Point to a specific script:
https://github.com/owner/repo/blob/main/script.py

Repository Scanning

What Is It?

Instead of importing scripts one by one, you can let AI scan your entire repository to discover scripts and utilities worth turning into tools.

How Scanning Works

1

Connect & Select Repository

Connect your GitHub account and select a repository to scan. Both public and private repos are supported.
2

AI Explores Your Codebase

Constants explores the repo with read-only access — identifying entry points, analyzing dependencies, and understanding project structure.
3

Review Candidates

The scan produces a list of tool candidates, each with:
  • Name and description
  • Category (data processing, API integration, etc.)
  • Confidence score
  • Source file path
Review candidates in the UI and dismiss the ones you don’t need.
4

Bulk Create Tools

Select the candidates you want and create tools in batch. Each one goes through the full generation pipeline.

Scan Progress

While a scan is running, a progress banner shows:
  • Current status and phase
  • Number of candidates discovered so far
  • Any errors or warnings
Progress streams in real time.

Private Repositories

Private repos are fully supported. The scan uses your GitHub OAuth token to access the repository — your credentials are never stored in the scanning environment.

Branch Selection

After entering a repository URL:
  1. Constants fetches available branches
  2. Select your target branch from the dropdown
  3. The tool uses code from that branch
For production tools, use a stable branch or tag rather than a moving branch like main.

What Gets Imported

When you import a script, Constants:

Analyzes the Code

  • Detects language and dependencies
  • Identifies the main entrypoint
  • Parses function signatures, CLI arguments, and docstrings
  • Maps required credentials

Generates the Tool

  • Interface — Input/output definitions with types and validation
  • Frontend — Form-based UI with file upload and result display
  • Backend — Execution code with access to built-in utilities
  • Runtime config — Compute tier, dependencies, resource limits

Troubleshooting

Make sure you’ve:
  1. Connected your GitHub account
  2. Granted access to the repository (for private repos)
  3. Have at least read permission on the repository
If Constants can’t find the entrypoint:
  • Ensure the file has a recognized extension (.py, .js, etc.)
  • Add a clear if __name__ == "__main__" block for Python
  • Use a descriptive filename (e.g., main.py, run.py)
If the scan returns few or no candidates:
  • Ensure the repo contains executable scripts (not just libraries)
  • Repos with clear entry points and CLI tools yield better results
  • Very large monorepos may need path-scoped imports instead of full scans
Ensure your repo includes:
  • requirements.txt for Python
  • package.json for JavaScript/TypeScript
  • Or specify dependencies manually in the tool settings
If a branch doesn’t appear:
  • Check that it exists on the remote
  • Ensure you have access to view the branch
  • Try refreshing the branch list

Best Practices

Scan Before Importing

For repos with many scripts, use the scan feature first to discover the best candidates.

Use Clear Entrypoints

Scripts with obvious entry points (main.py, index.js) produce better tools.

Include Dependencies

Always include a requirements.txt or package.json so Constants can set up the environment correctly.

Add Documentation

Docstrings and comments help the AI generate better input/output descriptions.
For teams using Constants with GitHub:
  1. Develop scripts in your repository as usual
  2. Scan the repo to discover tool candidates
  3. Review candidates and create tools from the best ones
  4. Share with teammates who can run without any setup
  5. Iterate via conversation to refine tool behavior
  6. Re-import when you want to update with source changes
This keeps your source of truth in Git while making execution accessible to everyone.