Guides

Add Typeship to an existing API repository

The repository already has the API and its spec. Put the generated package beside it, wire a linked project, and let pull requests keep it current.

Quick reference

# 1. once per machine
typeship login                                         # approve in the browser; a key is minted for this machine

# 2. once per repository: a project linked to the spec file in this repo
typeship projects create --name "Acme API" \
  --definition '{"source":{"kind":"repository","repository":{"provider":"github","identifier":"acme/api"},"path":"openapi.yaml"}}' \
  --targets '[
    {"name":"Acme CLI","generator":"cli","deliveries":[{"kind":"repository","repository":{"provider":"github","identifier":"acme/api"},"directory":"packages/cli"}]},
    {"name":"Acme MCP","generator":"mcp","deliveries":[{"kind":"hosted_mcp"},{"kind":"repository","repository":{"provider":"github","identifier":"acme/api"},"directory":"packages/mcp"}]},
    {"name":"Acme TypeScript SDK","generator":"typescript-sdk","deliveries":[{"kind":"repository","repository":{"provider":"github","identifier":"acme/api"},"directory":"packages/sdk","package_name":"@acme/sdk"}]}
  ]'

# 3. run the first generation; it lands as a pull request
typeship projects generate <project_id>

If the Definition is served at a URL rather than stored in GitHub, use --definition '{"source":{"kind":"url","url":"https://..."}}'; typeship checks it every 30 minutes when automatic regeneration is on.

Why these commands

Install the GitHub App. Repository sources and destinations use the Typeship GitHub App. If a repository is not connected, the Console prompts you and projects create returns an installation link. Install it once per GitHub account or organization.

Choose the destination. A Delivery selects a repository and directory. Use the API repository for a shared pull-request stream, or a dedicated repository for an independent package release history. See Add a package to your repo.

Keep custom code outside the generated tree. Wrap the client or add modules beside it. Store generator changes in Project configuration and Definition patches so they survive regeneration. See Extend the client.

Review each changed Target independently. A Definition change opens one destination pull request per changed Target. Source pull requests receive Preview Generations before the Definition merges. See Regeneration.

What can go wrong

You seeDo
definition is requiredPass --definition with source.kind: url, or source.kind: repository plus a GitHub repository reference and entrypoint path.
plan_limit_reached / PLAN_LIMIT when linking another projectFree keeps one linked project current; upgrade for additional projects, or delete down to the project you want active
the first pull request never arrivesthe GitHub App is not installed on the destination repository; the project page says so
For AI agentsDo steps 1 and 2; stop before merging a pull request unless the user asked you to. Installing the GitHub App is a browser step for the user; give them the link from the error.

On this page