Connect your agent · Task 03 · 6 min
Use the command line
Install the syndcast command, sign in from your browser, and run Syndcast operations from a terminal or a script.
The syndcast command runs the same operations as the other doors: syndcast <family> <verb> --flags. Use it in a terminal or in a script.
Before you start
You need Node 20 or newer, and a channel you own. Only the channel's owner can approve a command line sign-in.
Step 1 of 7
Install
There is no public package yet. Until the first release, the Syndcast team sends you the command as a tarball. Install it like this:
npm i -g ./syndcast-<version>.tgz
Step 2 of 7
Sign in
Run syndcast login with your Syndcast address:
syndcast login --host https://syndcast.com
The command prints a link and a code such as ABCD-EFGH. It opens the link in your browser when it can. Over SSH, or with --no-browser, open the link yourself.
- Sign in to Syndcast if the page asks you to.
- Compare the code on the page with the code in your terminal.
- Choose the Channel, then the role, autonomy and scope the command line may have.
- Press Approve. Deny ends the sign-in.
Approve only your own sign-in
Approve a sign-in only if you started it yourself, in your own terminal, just now.
The terminal waits for your answer, then saves a key on your computer and prints who you are. The key lasts one year. Signing in again replaces the old key. To keep more than one sign-in, give each a name with --profile <name>. syndcast profiles lists them.
Step 3 of 7
Run commands
Every operation is a command. These help you find them:
syndcast opslists every operation. Add a word to search, such assyndcast ops clip.syndcast <family> --helplists the operations in one family.syndcast <family> <verb> --helpshows the flags for one operation.syndcast whoamishows who you are signed in as.
Pass values as flags: syndcast <family> <verb> --name value. To pass a whole JSON object, use --input @file.json, or --input - to read it from the keyboard or a pipe. Flags win over the file. The operation brain.act has its own property named input. Pass that one only through --input @file or --input -.
A list that has more pages stops after the first. Add --all to follow every page.
Step 4 of 7
Approvals
Some requests need your yes. In a terminal, the command waits and tells you to answer in your channel's Agent tab. Ctrl-C leaves the request open. With --no-wait, or when no terminal is attached, the command stops at once and exits with code 4.
Step 5 of 7
Scripts and exit codes
Add --json to print the answer exactly as Syndcast sent it. The exit code tells a script what happened.
| Code | Meaning |
|---|---|
| 0 | It worked. |
| 1 | Anything else. |
| 2 | Bad input, or an unknown command or flag. |
| 3 | Not allowed, declined, or the key is revoked or expired. Sign in again. |
| 4 | It needs approval and you used --no-wait or have no terminal, or the approval expired. |
| 5 | You were rate limited, or you are out of credits or budget. |
Step 6 of 7
Use it in CI
A script or CI job does not need a browser sign-in. Create an agent token and set two variables:
export SYNDCAST_TOKEN=<your token>
export SYNDCAST_HOST=https://syndcast.com
SYNDCAST_TOKEN needs SYNDCAST_HOST, or --host. When both are set, the saved sign-in is ignored. A token without a host is ignored when you have a saved sign-in, and the CLI says so. Without a saved sign-in, it stops and asks for the host.
Step 7 of 7
Sign out
syndcast logout revokes the saved key and removes it from your computer. Add --profile <name> for a named sign-in.
logout signs out a saved sign-in only. To end a SYNDCAST_TOKEN key, run syndcast tokens revokeSelf.