---
title: "Add start scripts to a codebase"
description: "Run a command such as a database seed every time a canvas starts your app."
url: https://help.modeinspect.com/en/articles/13-add-start-scripts-to-a-codebase
collection: "Set up your codebase"
updated: 2026-10-28
language: en
---

# Add start scripts to a codebase

Run a command such as a database seed every time a canvas starts your app.

Start scripts are commands that run every time a canvas starts your app, once the dev server is up. Use them when the app needs something done before it is useful, like a database seeded with demo data.

They run again on every canvas open, in the order you list them, so each one must be safe to run twice. A seed command that skips rows it already created is a good start script. A one-off migration is not: the second run fails or applies the change again.

**Before you start**

-   A connected codebase that finished setup. See [What happens during setup](https://help.modeinspect.com/en/articles/17-what-happens-during-setup.md).
    

## Steps

1.  Open the codebase from **CODEBASES** in the sidebar and click the **…** button next to its name.
    
    ![The codebase page with the menu next to the codebase name open: Rename codebase, Edit secrets, Edit start scripts, Edit Design Guidelines, Edit memories and Delete Codebase](https://staticfiles.gleap.io/p6a1872808f187689a3937fa3/geN0ahpXH6mkE5dADelgbGqfj0NDmTqQBxxAPNWZ0OG1ywZhkd2xbzla9538LI6m5o1WyzFBjDe.png)
2.  Click **Edit start scripts**. A new codebase shows **No start scripts yet.**
    
3.  Click **Add script** and type the shell command, the same way you would run it in a terminal at the root of your codebase.
    
    ![The Edit start scripts dialog with one script, npm run seed --if-present, and the Save button](https://staticfiles.gleap.io/p6a1872808f187689a3937fa3/x7UBiZ7kqBnFM3yYJRYLEBeMlI4dmzVmOJyt0isXbaxlCgbSEMMfdInRmMElVNxU4K4pnIfco26.png)
4.  Click **Save**. The toast **Start scripts saved** confirms it.
    

The scripts run the next time a canvas of this codebase starts its app. A canvas that is already open does not run them until then. To remove a script, click the cross on its row and save again.

## If it does not work

-   **Save stays disabled with "Every script needs a command."**: one of the rows is empty. Type a command or remove the row.
    
-   **"This codebase has no setup yet. Finish setup before adding start scripts."**: start scripts attach to the setup config. Let setup finish first, then come back.
    

Secrets have their own dialog, **Edit secrets**, in the same menu. The menu also has **Rename codebase** and **Delete Codebase**.

## Related

-   [Edit a codebase's secrets](https://help.modeinspect.com/en/articles/12-edit-secrets.md)
    
-   [Write design guidelines for the agent](https://help.modeinspect.com/en/articles/18-write-design-guidelines.md)
    
-   [What happens during setup](https://help.modeinspect.com/en/articles/17-what-happens-during-setup.md)

## Related

- [Connect a GitHub repository](https://help.modeinspect.com/en/articles/11-connect-a-github-repository.md)
- [Upload a codebase as a zip](https://help.modeinspect.com/en/articles/16-upload-a-codebase-as-a-zip.md)
- [Start from a blank codebase](https://help.modeinspect.com/en/articles/15-start-from-a-blank-codebase.md)
- [What happens during setup](https://help.modeinspect.com/en/articles/17-what-happens-during-setup.md)
- [Answer Auto-setup's questions](https://help.modeinspect.com/en/articles/10-answer-auto-setup-s-questions.md)
