Skip to main content

Overview

Constants integrates with GitHub so you can:
  • Export Workers to repositories
  • Version control your generated applications
  • Continue development in your preferred IDE
  • Share code with your team

Connecting GitHub

Step 1: Open GitHub Settings

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

Step 2: Authorize Constants

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

Step 3: Confirm Connection

Once authorized, you’ll see your GitHub username displayed in the sidebar menu. You’re now ready to export Workers!

Exporting a Worker

From the Worker View

  1. Open the Worker you want to export
  2. Click the Export to GitHub button
  3. Choose export options:
    • Repository: Select existing or create new
    • Branch: Choose which branch to push to
    • Commit message: Describe your changes

Export Options

Create a fresh repository for your Worker:
  1. Select “Create new repository”
  2. Enter a repository name
  3. Choose public or private visibility
  4. Click Export
Constants will create the repo and push your code.

What Gets Exported

When you export a Worker, Constants creates a complete project structure:
your-worker/
├── README.md           # Documentation and usage instructions
├── requirements.txt    # Python dependencies
├── main.py            # Main application code
├── config.py          # Configuration (if applicable)
└── assets/            # Any images or static files
The exported code is fully self-contained. You can run it locally with Python or deploy it to any hosting platform.

Running Exported Code Locally

Prerequisites

  • Python 3.9 or higher
  • pip (Python package manager)

Steps

# Clone your repository
git clone https://github.com/your-username/your-worker.git
cd your-worker

# Create a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run the application
python main.py

Syncing Changes

Currently, export is one-way: from Constants to GitHub. If you modify the code in your repository, those changes won’t automatically sync back to Constants.
Coming soon: Two-way sync will allow you to push changes from your IDE back to Constants.

Workflow Recommendation

For ongoing development:
  1. Prototype in Constants - Use natural language to quickly build your app
  2. Export when ready - Push to GitHub once you’re happy with the base
  3. Continue in IDE - Make detailed changes in your preferred editor
  4. New features in Constants - Come back for major additions, then re-export

Disconnecting GitHub

To disconnect your GitHub account:
  1. Click your profile icon in the sidebar
  2. Find your GitHub username in the menu
  3. Click the × button next to it
  4. Confirm disconnection
Disconnecting won’t delete any repositories or exported code. It only removes the connection from Constants.

Troubleshooting

Make sure you’ve granted Constants access to the repositories you want to use. You may need to:
  1. Go to GitHub → Settings → Applications
  2. Find Constants in Authorized OAuth Apps
  3. Click to review and grant additional repository access
Common causes:
  • Repository name already exists (for new repos)
  • Insufficient permissions on the target repo
  • Network connectivity issues
Try again or check your GitHub settings.
If the branch already has content, Constants will attempt to merge. If there are conflicts:
  1. Export to a new branch instead
  2. Merge manually in GitHub or your IDE

Best Practices

Use Descriptive Names

Name your repositories clearly so you can find them later. Consider prefixes like constants- for exported Workers.

Export Often

Export after significant changes to maintain a history of your Worker’s evolution.

Add Documentation

The generated README is a starting point. Add your own notes about how to use and configure the app.

Review Before Push

Check the generated code before exporting to ensure it meets your standards.