CLI
Change a project from your terminal or your coding agent, follow it until it is live, set up runs that repeat, manage secrets and call any API route.
The syndai CLI is the owner's door to a project. You say what to change. Syndai builds it, runs every check, puts it live and prints the URL. It needs Node 22 or newer and nothing else. It sends no telemetry.
npx -y syndai@latest login
npx -y syndai@latest change "make the header blue"
Changing bakery.syndai.app · goes live when checks pass
· Working: Updating the header colour
· Checking and going live
Live: https://bakery.syndai.app
The rest of this page writes syndai for npx -y syndai@latest.
Log in
syndai login opens app.syndai.ai/cli with a one-time code. A workspace owner or admin approves it there. The CLI then gets a key named CLI · <your computer>. The key has the owner door scopes and lasts 90 days.
| command | does |
|---|---|
syndai login | browser approval; the key is stored for that workspace |
syndai login --scope <scope> | ask for one more scope on top of the ones you have; repeat the flag for more |
syndai login --with-token < key.txt | store a key you already have (read from stdin, never from a flag) |
syndai whoami | the workspace, key name, scopes and expiry in use, and where the key came from |
syndai logout | revoke the stored key and forget it |
When you log in again, the CLI saves the new key first. Then it revokes the old one. If that revoke fails, you get a warning and the new key still works.
No account yet? Use syndai signup.
In CI, set SYNDAI_API_KEY instead. It always wins over a stored login. There is no --api-key flag, so a key never lands in shell history.
Sign up
syndai signup <email> makes a workspace and a key with no browser. It is for an agent, or for you, before you have an account.
syndai signup you@example.com
It names the Terms and Privacy Policy and asks you to go on. Going on, and using the code, means you accept them. Syndai then mails a 6-digit code to that address. The CLI asks for it, then stores the key the way login does.
Off a terminal, the CLI mails the code and exits 3. It prints the next command. Run it with the code from the email:
syndai signup you@example.com --code 123456
With --code, it only checks the code and mails nothing new.
The key is named CLI · <your computer>. It has the owner door scopes and lasts 90 days. The new workspace gets the $10 sign-up credit, once per mailbox. If the address already has a workspace, no code is sent. Run syndai login instead, where you pick the workspace. The API calls behind it are in Sign up from curl.
Keys and scopes
A key can only do what its scopes allow. The key you get from syndai login has the Owner CLI and MCP scopes. They let you read and change projects, start and answer changes, and put changes live. They also let you edit site text, change project settings and manage runs that repeat. And they let you read billing and make checkout links.
Some calls need a scope that key does not have. In a terminal, the CLI asks: This needs <scope>. Approve it in your browser? [Y/n] Yes opens the same approval page. Your new key keeps every scope you had, plus the new one. The CLI saves it, revokes the old key and runs your command again. No mints nothing.
The CLI does not ask when:
- the key comes from
SYNDAI_API_KEY. That key belongs to your CI, so the CLI never swaps or revokes it; - you passed
--no-input, or the output is not a terminal; - the command is
watchor another command that streams.
Then it prints the scope and the syndai login --scope <scope> command to run, and exits 5.
Things only a person can do
A key is access you hand to a tool. Some things stay with a person signed in at app.syndai.ai:
- landing a held change anyway;
- loosening a project's protected files;
- paying, changing a plan, the card and spend settings;
- managing keys;
- managing members and unpublishing an app, from a CLI or MCP key.
A CLI or MCP key can't ask for these. The CLI prints the portal link instead. For a held change it exits 3 with the review page's URL. A key made in the portal with the Team admin or App publishing preset can manage members or unpublish. See Presets. The full list is in Done in the browser.
Make a change
syndai change "add an opening-hours section under the menu"
The first line says where the change goes and what happens to it. The CLI then follows the change and exits when it has an outcome.
| option | does |
|---|---|
--app <project> | choose the project (see Choosing the project) |
--review | open a pull request for your review instead of going live; finish with syndai go-live <run> |
--learn <url> | learn a feature from a public product (see below) |
--sign-in | with --learn: sign in to that product yourself first, so Syndai also learns from its in-app pages (see below) |
--image <file> | attach a PNG, JPEG, GIF or WebP (a mockup, a screenshot of the bug); repeatable |
--no-wait | start the change, print its state once, and exit 0 |
--timeout <duration> | stop following after 90s, 10m or 1h (exit 6); the change keeps going |
--no-input | never ask a question inline, even in a terminal |
To add a feature you like from another product, name it with --learn:
syndai change "add a booking page" --learn https://cal.com
Syndai reads that product's public pages, then asks which of its features to add, with 3 already checked. It adds only the ones you pick to your project. A link inside the text is never treated this way; only --learn is.
Some features only show once you are signed in. Add --sign-in and Syndai learns from those pages too:
syndai change "add a team inbox" --learn https://cal.com --sign-in
The CLI prints Sign in to cal.com on the run page once it asks. Before Syndai reads the product, the change's page asks you to sign in to it in a secure browser. You sign in there yourself, so Syndai never sees your password, and the CLI never asks for one. Open each in-app page you want learned and press Capture this page, then Use these pages. Or skip, and Syndai uses the public pages only. Screenshots of the pages you capture can show your account's data. They stay private to that change. --sign-in without --learn is a usage error (exit 2).
A change is never made twice. Before the request goes out, the CLI saves its request id under $XDG_STATE_HOME/syndai/pending/. Say the reply is lost, or the process dies. Run the same syndai change again. It sends the same id, and Syndai answers with the change it already made.
Start a new project
syndai new "a booking site for my hair salon"
syndai new starts a project from scratch, like New project on Build. Name a product you want to learn from, and Syndai builds your own version of it:
syndai new "my own Calendly-style scheduler, like https://cal.com"
Syndai first reads that product's public pages. This takes about a minute. Then it asks which features to build first. The core ones are already checked, and you can name your version. In a terminal you answer inline. Press Enter to keep the checked features. If no one answers, it starts with the checked features after 24 hours. A GitHub link is not treated as a product to learn from.
| option | does |
|---|---|
--no-learn | treat the link as context only; build from your words |
--sign-in | sign in to the linked product yourself first, so Syndai also learns from its in-app pages (as for syndai change --sign-in); needs a product link in the text |
--no-wait | start the project, print its state once, and exit 0 |
--timeout <duration> | stop following after 90s, 10m or 1h (exit 6); the build keeps going |
Follow a change
syndai watch <run> picks up any change, from any machine. It long-polls the change's state (GET /runs/{id}/change?wait=45). So it keeps going through proxies, restarts and Syndai deploys.
- Ctrl-C stops watching and prints
syndai watch <run>. It never cancels the change. --timeout <duration>exits 6 when time runs out. The change keeps going.--logsalso prints the change's events as they happen. With--jsonyou get one JSON object per line, then the final state.
When it needs you
| state | what to run |
|---|---|
a question (needs_input) | in a terminal the question is asked inline; otherwise syndai answer <run> |
held (held) | syndai review <run> |
ready for review (ready) | syndai go-live <run> |
syndai answer <run> asks the open question in a terminal. Scripts pass the answers with --input, from a file or from stdin (-):
echo '{"entries":[{"input_id":"shade","selected_option_ids":["navy"]}]}' | syndai answer $RUN --input -
syndai review <run> shows why a change is held, which files it touches and the diff. Then it asks Approve in your browser? [Y/n] Yes opens the review page and keeps watching until you decide. --retry runs the checks again and --close drops the change. Both act at once.
Landing a held change anyway, or loosening protected files, is only for a person. The CLI exits 3 with the review page's URL.
When a change waits on a connection, such as a GitHub install or a plan login, watch and answer print the link to connect it and open it in a terminal. Connect there, and the change goes on.
syndai go-live <run> puts a ready change live. syndai revert <run> undoes a change that went live (add --force when newer changes landed on top). syndai cancel <run> stops one.
On a project Syndai hosts, syndai land [branch] lands a branch you pushed with your own git login (Project › Clone with git). It defaults to the current branch, which must be under people/<you>/. The branch gets the same checks and review as Syndai's own changes and waits its turn to land. A branch named for a task, like people/you/t12, marks that task done when the landing goes live. --no-wait returns right away.
Publish
syndai publish [--app A] puts the project live as a hosted app, or deploys it again. It prints the live URL. The site is live there once the deploy ends, in a minute or two. Running it again while a deploy is going on starts nothing new.
Edit text in seconds
For an exact text swap on a live site, skip the coding run:
syndai edit-text --page /about --from "Open 9-5" --to "Open 8-6"
It is free and live in seconds. It prints the --undo <sha> command that puts the old text back. --all changes every match in the file that holds it. It is refused while a change is running on the site. Wait for that change, or make the edit with syndai change.
Runs that repeat
A schedule runs the same prompt on a project again and again, for example a weekly content refresh. Each run is a normal change. It shows on the project's Runs tab with a link back to its schedule.
syndai schedule add "refresh the specials on the home page" --every weekly --at "mon 09:00"
Repeats on bakery.
Weekly on Monday at 9:00 AM America/Chicago: "refresh the specials on the home page"
Next: Mon, Oct 19, 9:00 AM · Mon, Oct 26, 9:00 AM · Mon, Nov 2, 9:00 AM
Manage: syndai schedule show 3f2a9c1e-…
| command | does |
|---|---|
syndai schedule list [--app A | --all] | the project's schedules, or every project's with --all: when each runs next, or why it is paused |
syndai schedule show <id> | one schedule, its next 3 runs, and its history (time, what happened, the run id) |
syndai schedule add "<prompt>" --every … [--at …] [--tz Z] [--budget CREDITS] [--app A] | make a schedule |
syndai schedule edit <id> [--prompt P] [--every …] [--at …] [--tz Z] [--budget CREDITS|none] | change only the fields you pass; --budget none removes the cap |
syndai schedule pause <id> | stop it from running until you resume it |
syndai schedule resume <id> | start it again |
syndai schedule run-now <id> | run it once now; the schedule stays as it is |
syndai schedule delete <id> | delete it; asks y/N in a terminal, and needs --yes in a script |
syndai repeat <run> --every … [--at …] [--tz Z] [--budget CREDITS] | repeat a run you liked on the same project |
When it runs
--every | --at | example |
|---|---|---|
hourly | :MM | --every hourly --at :15 |
daily | HH:MM | --every daily --at 09:00 |
weekdays | HH:MM | --every weekdays --at 17:30 |
weekly | "<day> HH:MM", day is sun to sat | --every weekly --at "fri 16:00" |
| a 5-field cron | none | --every "0 9 1 * *" |
Leave out --at and it picks the next quarter hour. --tz takes a time zone such as Europe/Berlin. It defaults to your computer's time zone, and the CLI always prints the zone it used. Anything else in --every or --at exits 2.
--budget caps what one run may spend, in credits. The lowest cap is 20 credits.
Repeat a run
syndai repeat $RUN --every weekly --at "mon 09:00"
syndai repeat makes a schedule from a run that went well. Syndai copies that run's full prompt and project on its side, so nothing is cut. It does not start a run right away. The first one happens at the next scheduled time, which the CLI prints.
Safe to run twice
schedule add and repeat send a request id. If the reply is lost and the CLI tries again, you get the schedule it already made (exit 0), not a second one. schedule run-now on a run that is already going also exits 0.
To change what happens when a run overlaps the last one, use the project's Runs tab or syndai api updateSchedule.
Secrets and environments
The CLI keeps your app's secrets in Syndai, the way Doppler does, so you never commit a .env. Every workspace has environments (such as development, test and production). A value is shared by every project, or set for one project; the project's value wins.
syndai link bakery --env development # this directory: the project and the environment
syndai secrets # names, scope and when each was updated
printf %s "$TOKEN" | syndai secrets set API_TOKEN
syndai run npm run dev # npm gets the values; nothing is printed
| command | does |
|---|---|
syndai env ls | the workspace's environments, with the current one marked |
syndai env use <env> | use that environment in this directory (stored in your link, never in the repository) |
syndai secrets | names, environment, scope (shared or project) and updated date. Never a value, even with --json |
syndai secrets set KEY | set a value from a hidden prompt (one line), or from stdin (a multi-line value, like a private key). A value typed on the command line is refused, so it never lands in shell history |
syndai secrets rm KEY | delete it. Off a terminal it needs --yes |
syndai secrets import FILE | load a whole .env file (or - for stdin), all or nothing |
syndai secrets import --from-doppler | move a Doppler config over in one step, all or nothing. Reads DOPPLER_TOKEN (a service token for that config; a personal token also needs DOPPLER_PROJECT and DOPPLER_CONFIG) and calls Doppler from your machine only; Syndai never sees the token, and no value is printed |
syndai secrets get KEY | print one value. When the output is not a terminal it needs --plain |
syndai secrets download [-o FILE] | write a .env: to a pipe, or with -o to a file only you can read (mode 0600). It warns when git does not ignore the file |
syndai run [--env E] <command> | run the command with the values in its environment only. Its exit code is syndai's. Options after the command's name are the command's |
set, rm and import write shared values. Add --project to write the linked project's own value.
The environment is picked in this order: --env, the SYNDAI_ENV variable, syndai env use or syndai link --env, then the workspace's default.
Reading values
Reading a value needs the coding:secrets:reveal scope. Only a syndai login you approve in your browser grants it. A key you paste, a key made on the portal's API keys page, and the key syndai mcp install gives your coding agent can never hold it. The first secrets command asks once for all three secrets scopes (read, write and reveal).
Production is stricter. Production asks every time. A person approves each command in the browser: Allow production values for this command. That approval is for one command. Another command, or an agent with the same key, still can't read production. In a terminal the CLI asks, opens the page and carries on once you allow it. Off a terminal, or with SYNDAI_API_KEY, it exits 3 with PRODUCTION_STEP_UP_REQUIRED and reads nothing. Every value read is in the workspace's secret activity, marked as read by the CLI. Secrets says who can read what.
Sync a folder into Knowledge
syndai sync keeps a folder on your computer, such as an Obsidian vault, in a project's Knowledge. The project's runs and chat search it.
syndai sync ~/Notes --app bakery
Synced Notes to Bakery (bakery.syndai.app): 212 indexed, 9 linked, 0 failed
The first sync sends every file. After that, only new and changed files go up, and a file you delete here is removed there. Notes and other text files (.md, .txt, .csv, .json, .yaml and the like) are indexed so they can be searched. Any other file, such as an image or a PDF, is linked by its name only. The folder's name in Knowledge is the folder's own name.
| option | does |
|---|---|
--app <project> | choose the project (see Choosing the project) |
--watch | keep syncing as you edit, until Ctrl-C. A change goes up a second after you stop typing, so it is searchable within seconds |
Some files stay out:
- hidden files and folders, whose names start with a dot, such as
.obsidian/,.trash/and.git/; node_modules/, shortcuts (symlinks), and files over 10 MB;- anything matched by a
.syndaiignorefile in the folder. Write one pattern a line, like a.gitignore:drafts/for a folder,*.tmpfor a kind of file,/private.mdfor one file at the top. Lines starting with#are comments.
Syncing needs the coding:knowledge:sync scope, which owners and admins can hold. In a terminal, the first sync asks you to approve it in your browser. A folder someone paused on the project's Knowledge page is refused until it is resumed there, and so is a folder with the same name that someone else syncs. Both exit 1 with the reason.
Connect an account
syndai connect <provider> opens the card for that account in the app. You finish in the browser. No key can connect an account, so the CLI does not wait for it.
| provider | opens |
|---|---|
github | Settings, Repositories |
sentry | Sentry |
claude, chatgpt | Connections, the plan login |
openrouter | Connections, OpenRouter |
linkedin, instagram, x, threads, bluesky, buffer, tiktok, youtube, slack | Connections, that account's row |
Off a terminal, or with --json, it prints the link instead of opening it.
Billing
The key can read billing and make a checkout link. A person pays on that page. Nothing is charged until they do.
| command | does |
|---|---|
syndai billing | the plan, the balance and the billing page's URL; --open opens it |
syndai billing packs | the credit packs you can buy |
syndai billing buy <pack> | make a checkout link for that pack and open it |
syndai billing plan <tier> [--interval month|year] | make a checkout link for a first plan |
syndai billing card, syndai billing cancel | open the billing page, where a person changes the card or the plan, or cancels |
buy and plan price the checkout in your country. It comes from your locale, or pass --country DE. The payment page checks it again.
A workspace already on a paid plan can't start a new one from a key. syndai billing plan then prints the billing page, where a person changes the plan. A plan change charges the saved card at once, so it stays with a person.
An agent that runs out of credit can run syndai billing buy <pack> and hand the link to its person. Every budget, quota or plan error prints the billing page's link.
Done in the browser
These stay with a person signed in at app.syndai.ai. A key can't do them, so the CLI takes you to the page.
| what | why | how to get there |
|---|---|---|
| connections and plan logins | they happen on the provider's own page | syndai connect <provider> |
| plan changes, the card, cancelling | a plan change charges the saved card at once | syndai billing card or syndai billing cancel |
| standing spend, extra usage, paid hosting, paid translations, the AI cap | they spend money with no one there | syndai billing --open |
| buying a pack or a first plan | a person pays the checkout | syndai billing buy <pack>, syndai billing plan <tier> |
| API keys, SSO, notifications, branding | they change who and what has access | Settings in the app |
| members | a CLI or MCP key can't hold that scope | Settings, Members |
| spec ratify, skip and cosign | a person signs off on what gets built | the run's page |
| held merges, store releases, halt and resume | a person decides what goes live | syndai review <run> or the run's page |
| app payments | they move money for your app | the project's Payments page |
| approving what an agent asks | a click is the one thing an agent can't hold | Inbox in the app |
Choosing the project
Every command that acts on a project picks it in this order:
--app <project>: an id, the slug, the live host or URL, or the repository name;- the
SYNDAI_APPenvironment variable; syndai link <project>, run in this directory or a parent;- a git remote of the current checkout that matches a connected repository;
- the only project in the workspace;
- a picker, in a terminal.
Otherwise the command exits 2 and lists the projects. syndai link stores its map in $XDG_CONFIG_HOME/syndai/links.json, never in the repository. syndai link <project> --env <env> also stores the environment; linking again keeps it.
Status and settings
syndai status [--app A] lists what is running and every change that needs you. Each one comes with the command that moves it on.
syndai settings [--app A] shows a project's settings. syndai settings set key=value... changes them:
| key | values |
|---|---|
autonomy | merge (go live when every check passes), auto (open a pull request), gated |
feature_requests | off, members, public |
bug_scan | on, off (the weekly Bug Finder) |
protected_paths | protected_paths+=<pattern> adds one; protected_paths=<a>,<b> sets the list |
From the CLI, protected files can only be tightened. Removing a pattern, or adding a ! exemption, needs the owner in the browser (exit 3 with the URL).
Any API route
syndai api calls any route in the public API with your key, like gh api. It reads the list of routes from api.syndai.ai/openapi.json and keeps it for a day. So a new route works the day it ships.
| command | does |
|---|---|
syndai api | list every operation, grouped |
syndai api <operationId> --help | the method, path and summary, and each field (required ones are marked) |
syndai api <operationId> [fields] | call it by name, such as listSchedules |
syndai api <METHOD> <path> [fields] | call a raw path; a path without /api/ is under /api/v1/external/coding |
| option | does |
|---|---|
-f key=value | a text field; repeatable |
-F key=value | a typed field: true, false, null and numbers keep their type, and key=@file reads the value from a file; repeatable |
--input <file> | the whole request body, from a file, or from stdin with -; not mixed with body fields |
--paginate | for a GET, follow next_cursor page by page and print one list (up to 50 pages) |
--json | print JSON |
A field named like a part of the path fills that part. Any other field goes in the query for GET and DELETE, and in the body for the rest. The CLI fills in customer_id, coding_repository_id and repository_id when the path needs them. It never adds them to a query or body.
syndai api listSchedules -f limit=5 --paginate
syndai api getRun -f coding_run_id=$RUN
syndai api createWebhookEndpoint --input hook.json
syndai api GET runs?limit=5
An unknown name prints the three closest names and exits 2. If the call needs a scope your key lacks, see Keys and scopes.
Output and scripting
Progress goes to stderr. The result goes to stdout. The result is JSON when you pass --json, or when stdout is not a terminal (a pipe, CI, a coding agent). Colour is off when stdout is not a terminal or NO_COLOR is set.
For a change, the JSON result is its ChangeState, plus next when there is a command to run next:
| field | meaning |
|---|---|
run_id, project | the change and its project (id, name, live_url) |
state | queued, working, needs_input, landing, held, ready, unverified, live, live_unverified, failed, reverted, cancelled |
headline | one line about what is happening |
needs_input | open questions: hitl_request_id, summary, inputs |
held | reason, message, paths, head_sha, can_retry, review_url |
live_url, verified | where it is live, and whether the live check confirmed it |
run_url, receipt_url | the change in the portal, and its public receipt |
done | true once nothing more will happen without you |
cursor | pass to GET /runs/{id}/change?cursor= to wait for the next change |
An error prints error: <one sentence> and next: <command> on stderr. With JSON output it also prints {"error": {"exit_code", "code", "message", "next"}} on stdout.
Error codes
Every refused call has a code. The ones you will meet most:
| code | what to do |
|---|---|
INVALID_SCOPE | the key lacks a scope; the error names it in required_scope (see Keys and scopes) |
HUMAN_APPROVAL_REQUIRED | a person must decide at the review_url (exit 3) |
REPO_NOT_BOUND | the project is not in this workspace; run syndai link (exit 2) |
PRODUCTION_STEP_UP_REQUIRED | allow production values in the browser, then run the command again (exit 3; see Reading values) |
CLI_UPGRADE_REQUIRED | run npx -y syndai@latest |
Exit codes
| code | meaning |
|---|---|
| 0 | done: live and confirmed by the live check, ready for review, or the command succeeded |
| 1 | the change failed, was reverted or cancelled, or the request was refused |
| 2 | a usage error, or no project could be chosen |
| 3 | needs you: a question, a hold, or a decision only the browser can make |
| 4 | live, but the live check could not confirm it |
| 5 | sign-in, scope or plan (401, 402, 403) |
| 6 | --timeout reached; the change keeps going |
| 7 | Syndai did not answer after retries |
| 130 | stopped with Ctrl-C; the change keeps going |
Retries
The CLI retries only reads, and requests that carry their own request id (change, answers, text edits, revert, new schedules). A 429 waits out Retry-After. A 5xx or network error backs off from 0.5 s to 8 s with jitter. After five tries it exits 7. Every request sends User-Agent: syndai-cli/<version>. A CLI older than the server supports gets CLI_UPGRADE_REQUIRED. Run npx -y syndai@latest to fix it.
Files and environment
$XDG_CONFIG_HOME/syndai/credentials.json | keys by workspace, mode 0600 (default ~/.config) |
$XDG_CONFIG_HOME/syndai/links.json | directory to project and environment |
$XDG_STATE_HOME/syndai/pending/ | request ids of changes not yet confirmed (default ~/.local/state) |
$XDG_CACHE_HOME/syndai/ | the API route list, kept for a day (default ~/.cache) |
SYNDAI_API_KEY | the key to use; wins over syndai login |
SYNDAI_APP | the project to use |
SYNDAI_ENV | the environment to use |
SYNDAI_API_URL | the API base (default https://api.syndai.ai) |
To let Claude Code, Cursor or Codex change your projects directly, see MCP.
A pull request can appear before its checks finish. The CLI still shows working and done: false. Use pr_url to open it; watch keeps waiting. ready means the delivered revision passed its declared checks. It is ready to review. Review and merge are separate steps. A run without matching check results is unverified. This also applies to older runs marked complete. The pull request stays available, and watch exits with code 4. This does not mean the change is live.