CLI
Script and automate your assistant from the command line, or use the same client as an SDK in your own code.
Install
The CLI ships as an npm package scoped to your account, and installs a binary named after your account:
npm install -g @agnt-sdk/openassistant
This installs the openassistant binary. Run openassistant --help to see every available command.
Authenticating
Login takes two commands, with no browser or terminal prompts. Your agent runs the commands and asks for your email and verification code in your conversation when it cannot get them through tools you have authorized.
First, send the code to your email:
openassistant login --email [email protected]
The command emails a one-time code and exits. Its JSON output includes status: "code_sent", guidance for finding or asking for the code (findCode, askUser), and the next command (next). It never waits for input.
Then run the same command with --code, replacing 123456 with the code from your email:
openassistant login --email [email protected] --code 123456
Use the same email and options in both steps. If you use --profile, --api-url, or other login flags, keep them in the second command too; the printed next command includes them. Replace its <the code> placeholder with the actual code before running it.
This works for a new email address (it creates the account) or an existing one (it logs in). A successful second step returns status: "connected" and saves the API key in your local credentials profile; it never prints the key. Each completed login mints its own separately labeled, separately revocable key, so sign in again for a different agent or machine rather than copying credentials.
If a command returns onboarding_required, run openassistant onboard using the same profile. If that returns onboarding_incomplete, the server still requires your timezone and working hours: supply them with onboard --timezone and --working-hours. Run openassistant onboard --help for the accepted format.
If you already have an API key (minted by login elsewhere, or issued from your account's dashboard), wire it into a named profile instead:
openassistant configure --profile work --api-key ak_live_...
Pass --profile <name> on any command to use a profile other than the default.
For a different API, pass --api-url to login or configure, or set AGNT_API_URL. The saved profile keeps that URL for later commands. The API URL must use HTTPS; plain HTTP is accepted only for local loopback hosts (localhost, 127.0.0.1, or [::1]). Login warns when a code will be sent to an API other than the default, so check that destination before continuing.
Basic usage
openassistant tasks list
openassistant tasks create --assistant <assistantId> --message "Draft a follow-up to yesterday's call with Acme"
openassistant tasks get <taskId>
Every resource in the API reference has a matching CLI surface — assistants, chats, contacts, calendars, connections, memories, skills, and more. Run openassistant <resource> --help to see what's available for any of them.
Using it as an SDK
The same package works as a typed client in your own Node.js code, not just as a terminal tool:
import { PortalClient } from '@agnt-sdk/openassistant';
const client = new PortalClient({ apiKey: process.env.AGNT_API_KEY });
const { tasks } = await client.tasks.list();
This is the same client the CLI itself is built on, so anything you can do with a command you can also do programmatically — useful for wiring your assistant into scripts, CI jobs, or your own internal tools.
JSON output
Add --json to most commands to get machine-readable output instead of the formatted terminal view — useful for piping into jq or another script.
login always writes JSON to stdout. Its --json flag suppresses the additional plain summary on stderr; login errors are JSON on stderr.
openassistant tasks list --json | jq '.tasks[] | select(.status == "awaiting_user_input")'