Deploy the app
From local directory
Use our CLI from the root directory of your project:Notes
- The
entrypoint_file_nameis the file name where you defined your app. - Include a
.gitignorefile to exclude dependency folders likenode_modulesand.venv.
From GitHub
You can deploy a Kernel app directly from a public or private GitHub repository using the Kernel CLI. No need to clone or manually push code.Notes
--pathvs--entrypoint: Use--pathto specify a subdirectory within the repo (useful for monorepos), and--entrypointfor the path to your app’s entry file relative to that directory (or repo root if no--pathis specified).- The CLI automatically downloads and extracts the GitHub source code and uploads your app for deployment.
- For private repositories, provide a
--github-tokenor set theGITHUB_TOKENenvironment variable.
Use a scoped API key
When you runkernel deploy with a scoped API key, the app gets project-wide invocations:write to report results. It also gets project-wide browsers:create, browsers:use, and browsers:delete for each of those your key holds, so an app that opens browsers works on its first run. If your key holds none of them, deployment still succeeds but browser calls from the app return 403.
The CLI has no runtime policy flag. To give the app more or less access, deploy through the API with an explicit app runtime policy. A deployment keeps the access it was created with, so redeploy to change it.
Environment variables
You can set environment variables for your app using the--env flag. For example:
Reserved environment variables
Kernel injects a few environment variables into every deployment and its invocations. These names are reserved — if you set them via--env or --env-file, Kernel overrides your value, so setting them has no effect:
KERNEL_API_KEY— the SDK uses this key automatically. For apps with a runtime policy, the key grants only the app runtime permissions.ENTRYPOINT_RELPATH— set by the platform to locate your entrypoint.
Using a different key for your app’s calls
You can’t changeKERNEL_API_KEY itself, but you can have your app authenticate with a different key — say a long-lived org- or project-scoped key that outlives any single deployment. Put it in a non-reserved variable and pass it to the client explicitly:
Secrets
Pass API keys and other secrets as environment variables when you deploy, with--env or --env-file. Then read them in your app:
Per-invocation secrets
For use cases where different API keys are needed per invocation (such as platforms using end-user keys), pass the secrets at runtime using the payload parameter. Use encryption standards in your app to protect sensitive data.Deployment notes
- The dependency manifest (
package.jsonfor JS/TS,pyproject.tomlfor Python) must be present in the root directory of your project. - For JS/TS apps, set
"type": "module"in yourpackage.json. - View deployment logs using:
kernel deploy logs <deployment_id> --follow - If you encounter a 500 error during deployment, verify that your entrypoint file name and extension are correct (e.g.,
app.pynotapporapp.js). - Kernel assumes the root directory contains at least this file structure: