@tangent-9/create-tina-miniapp
v0.14.0
Published
Scaffold, validate and submit a TINA mini app.
Readme
@tangent-9/create-tina-miniapp
Scaffold, check, host and submit a TINA mini app. One binary under two names: you meet it first
as create-tina-miniapp to start a project, and stay with it as tina-miniapp inside the
project it made.
npm create @tangent-9/tina-miniapp
pnpm create @tangent-9/tina-miniapp
yarn create @tangent-9/tina-miniapp
bun create @tangent-9/tina-miniappIt asks what the app needs (a screen, a server of its own) and recommends the template that fits, then installs dependencies with the package manager you ran it with. The next steps it prints, and the commands in the project's README, use that package manager too.
Flags answer their own question, and the prompts ask whatever is left. my-app --template
fullstack asks only whether to install. --install and --no-install answer that one.
Without a terminal (CI, a pipe) or with --yes, nothing is asked: the defaults are
react-vite and no install.
npx @tangent-9/create-tina-miniapp my-app --template fullstack --install
cd my-app && npx tina-miniapp dev --sandboxThen open http://localhost:4100. --sandbox starts a local stand-in for TINA beside the
app, so it runs with no account and nothing published.
To run it on TINA itself, sign in once and deploy. TINA hosts the page, so there is no server to set up:
npx tina-miniapp login
npx tina-miniapp deployHosting the page yourself
For a template with a page, the create flow asks who hosts it (--hosting tina|self).
Choose your own server and the project starts with no hosting block and no embed_url:
nobody knows the page's address before it is deployed, and nothing needs it before then.
dev --sandbox frames your dev server either way.
Once the page is live, on a host that sends Content-Security-Policy: frame-ancestors
naming the workspace:
npx tina-miniapp url https://your-app.example.com/ # writes embed_url, checks the header
npx tina-miniapp submit # or skip `url`: submit asks for ithooks.url and MCP server URLs can stay paths such as /api/hooks/tina. The CLI resolves
them against embed_url when it uploads the manifest, and the sandbox against your dev
server, so the file never names a host. In CI, submit --url <https://…> sets the URL
without asking.
Templates
Chosen by the questions, or with --template. --yes takes the default, react-vite,
without asking.
| Template | What you get |
| ----------------- | ------------------------------------------------------------------- |
| react-vite | A React screen TINA hosts, plus an agent |
| fullstack | A screen and an agent, with your own backend at /api for records and tools |
| agent-companion | An agent and no screen, the smallest thing that works |
Commands
| Command | What it does |
| ----------------------------- | -------------------------------------------------------- |
| tina-miniapp login | Signs this machine in, approved in the partner portal |
| tina-miniapp whoami | Shows the partner and role you are signed in as |
| tina-miniapp logout | Revokes this machine's sign-in |
| tina-miniapp link [dir] | Records which listing the project is, in .tina/project.json |
| tina-miniapp dev [dir] | Runs the app's page and backend together |
| tina-miniapp dev --sandbox | Adds the SDK's tina-sandbox and points the backend at it |
| tina-miniapp doctor [dir] | Checks framing headers and the hook endpoint |
| tina-miniapp url [https://…] [dir] | Records where your own server has the page (embed_url), and checks its framing header |
| tina-miniapp validate [dir] | Checks the manifest against the platform schema |
| tina-miniapp pack [dir] | Writes a .tinapkg of the manifest and listing assets |
| tina-miniapp deploy [dir] | Builds the page, uploads what changed, and hosts it on TINA (needs hosting in the manifest) |
| tina-miniapp deployments | Lists the app's recent deploys |
| tina-miniapp rollback <id> | Points the app's URL back at an earlier deploy |
| tina-miniapp submit [dir] | Submits for review: a hosted app's deployed draft, or an uploaded manifest, with assets/icon.png as the listing's logo when there is one |
Environment
| Variable | Meaning |
| -------------------- | ------------------------------------------------------ |
| TINA_PARTNER_KEY | Partner API key (tinapk_…) for CI; people use login |
| TINA_API_URL | API base URL (--api for one command) |
| TINA_WORKSPACE_URL | Workspace origin, for dev |
The app itself talks to the platform through
@tangent-9/miniapps-sdk, which
the templates already depend on.
Licence
MIT.
