# With code

URL: /start/with-code · Id: `page:start/with-code`

> Scaffold a Startup with npm create startups, run it locally, change a price, and call the Verbs your agent calls.

`npm create startups` writes a [Startup](/business/nouns/startup) as files in a repository. They compile into the same business an agent builds on [startups.new](/start/startups-new), and every ask is one call.

```bash
npm create startups
```

## The first ten minutes
1. **0:00.** Create the Startup from a [Startup Template](/business/nouns/startup-template):

   ```bash
   npm create startups leaseline.app -- --template solo-saas --yes
   ```

2. **1:00.** Open `startup.ts`. It holds the name, the [Domain](/business/nouns/domain) and the [Template](/business/nouns/template) it extends; everything else is inherited:

   ```ts
   import { Startup } from 'startup-builder'

   export default Startup({
     name: 'Leaseline',
     domain: 'leaseline.app',
     extends: 'solo-saas',
   })
   ```

3. **2:00.** Open the folder in your coding agent. `AGENTS.md` teaches it the conventions, and `.mcp.json` connects it to the MCP server.

4. **3:00.** Start the dev server. It watches the project and previews each edit as a [Change](/business/nouns/change):

   ```bash
   npx startup-builder dev
   ```

5. **4:00.** Change the price in `offers/pro.mdx` from 29 to 39. The checkout, the pricing page and the types of `$` recompile.

6. **6:00.** Rehearse publishing the [Offer](/business/nouns/offer). `--try` checks it and stores nothing:

   ```bash
   npx startup-builder do Offer.publish --json '{"offer":"offer_1"}' --try
   ```

7. **7:00.** Stream the subscription [Events](/business/nouns/event) to a local URL, then fire one in test:

   ```bash
   npx startup-builder listen Offer.subscribed --forward-to http://localhost:3000/hooks
   npx startup-builder trigger Offer.subscribed
   ```

8. **9:00.** Print what you have: the [Site](/business/nouns/site), Offers, [Roles](/business/nouns/role) and [Processes](/business/nouns/process), own and inherited:

   ```bash
   npx startup-builder show /
   ```

## One call, every Interface
Every [Verb](/business/nouns/verb) your agent calls is the same call in each [Interface](/business/nouns/interface). Pick a tab once; every code window on the site keeps it.

**Ask**

```text
Publish the Pro plan.
Put the $39 plan on the pricing page.
Start selling Pro.
```

**API**

```bash
curl -X POST https://api.sb/leaseline.app/offers/offer_1/publish \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

**SDK**

```ts
import { $ } from 'startup-builder'

const offer = await $.Offer.publish({ offer: 'offer_1' })
```

**CLI**

```bash
npx startup-builder do Offer.publish --json '{"offer":"offer_1"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Offer.publish({ offer: 'offer_1' })"
  }
}
```

## Founders and code share one business
A founder who asks on startups.new and a developer who edits `offers/pro.mdx` write to the same Startup. Each edit is a Change with a diff, reviewed and merged the same way.

## Next
| To | Read |
| --- | --- |
| Learn every folder and file | [Folders and files](/code/project-structure) |
| Write the root file | [`startup.ts`](/code/project-structure/startup-root) |
| Call the platform | [API](/code/api), [SDK](/code/sdk), [CLI](/code/cli), [MCP](/code/mcp) |
| Ship a whole task | [Guides](/start/guides) |