Skip to content

Start from a template

When you don’t have any code yet, jiayang init writes a small app that deploys as it is. Every template with code already checks who is calling with our SDK, so you start with sign-in done properly.

Template What it is Runs as
static-site A page of HTML and CSS. Nothing to install or build. A static site
worker A JavaScript app that greets whoever signed in and shows their role A Worker
internal-tool A list your team shares and adds to, kept in the app’s own database A Worker
express A Node server with Express and @jiayang-cloud/sdk A container
fastapi A Python app with FastAPI and the jiayang package A container

Container apps need a paid plan. Static sites and Workers run on every plan, Free included.

jiayang init on its own lists them:

Terminal window
jiayang init
  1. Write the template.

    Terminal window
    jiayang init worker
    Made a Worker in ./worker, with README.md, index.js and jiayang.mjs.
    Deploy it, with your workspace in place of <workspace>:
    jiayang deploy <workspace>/worker ./worker --create

    If you’re signed in and in one workspace, the command names it in place of <workspace>.

    It goes in ./<template> unless you name a directory: jiayang init worker hello writes it into ./hello. Each template has a README.md saying what it does and how to change it.

  2. Deploy it.

    Terminal window
    jiayang deploy acme/hello ./worker --create
    a Worker
    because it has index.js
    Version 1 (8b217ef9bf3c) is live.
    https://hello--acme.jiayang-apps.cloud

    The app is private, so only you can open it until you share it.

  3. Check who it thinks you are.

    Terminal window
    jiayang curl acme/hello /api/me
    {"email":"ada@example.com","role":"owner","kind":"user"}
    200 OK

jiayang init never replaces a file. If any of the template’s files is already in the directory, it writes nothing at all and says which:

error: ./worker already has README.md, index.js and jiayang.mjs, and a template never replaces a file. Nothing was written. Pick a new directory, or an empty one.

Other files in the directory are left as they are, so you can write a template into a directory that already has, say, a .git.

In a script, --json gives the files it wrote and the command to run next:

Terminal window
jiayang --json init internal-tool team-list

The agent plugin and MCP server have the same templates. Ask for an app that doesn’t exist yet, like “make me a page where the team can keep a list of orders”, and the agent calls list_templates, writes one with create_from_template, changes it to do what you asked, and deploys it.

create_from_template writes only inside the project the agent is working in, never into a hidden directory, and never over a file. Neither tool needs you to be signed in, since they don’t reach the platform. Deploying does.