Skip to main content
idapt
HomeCodeAI ModelsPricing
Sign inStart free
  • Home
  • Pricing
  • AI Models
  • Image models
  • Voice models
  • Video models
  • Rankings
  • New models
  • Model status
  • Multi-Model Chat
  • Voice Mode
  • Voice HUD
  • Web Search
  • Image Generation
  • Video Generation
  • Audio Generation
  • Transcription
  • Drive
  • Credentials
  • Sharing
  • Workspaces
  • Tasks
  • Memory
  • Agents
  • Subagents
  • Automations
  • Skills
  • idapt Code
  • Code Execution
  • Computers
  • Computer Use
  • Computer Assist · Soon
  • Containers · Soon
  • Cloud Computers
  • Local AI
  • AI Gateway
  • API & SDK
  • CLI
  • MCP
  • Tunnels
  • All features →
  • LLM cost calculator
  • Token counter
  • Context window checker
  • Can I run it
  • Model picker quiz
  • Savings finder
  • Video cost estimator
  • Text to speech cost
  • Transcription cost
  • API endpoint tester
  • All free tools →
  • Blog
  • Use cases
  • Comparisons
  • Best of
  • Skills
  • Learn
  • Changelog
  • Help center
  • FAQ
  • Privacy
  • Compare all models
  • Support
  • idapt Code
  • Developers
  • Quickstarts
  • API reference
  • API pricing
  • CLI
  • MCP
  • Downloads
  • Desktop
  • Badges and embeds
© idapt[email protected]TermsPrivacy PolicyLegal noticeReport content
X (Twitter)
Help Center
⚙️

Automation and scripting

Found this helpful? Share it:

The CLI is built for unattended use. JSON output, a simple exit convention, stdin and file input, and environment variables let you drop it straight into scripts and pipelines ⚙️

Environment variables

Two variables cover most automation:

  • IDAPT_API_KEY: the API key to authenticate with. Set it from a CI secret. See CLI authentication.

  • IDAPT_API_URL: the base URL, default https://idapt.app. Change it only to target another environment.

For the workspace a script runs against, pin it once with idapt workspace use <workspace-id>or pass --workspace-id per command. There is no IDAPT_PROJECT variable.

Capture ids and structured input

Use -o quiet to capture an id, and --json to pass input that a shell would otherwise mangle:

#!/bin/bash
set -euo pipefail

# Create an agent and capture its id
AGENT_ID=$(idapt agent create --json @agent.json -o quiet)
echo "created agent: $AGENT_ID"

# Send a message on a chat
idapt chat send --id "$CHAT_ID" \
  --json '{"content":"What is the deploy status?"}' -o json | jq -r '.message.content'

Handle success and failure

The CLI maps the failure kind onto a structured exit code, so a script can branch without parsing stderr: 0 success, 1 generic error, 2 authentication (sign in again), 3 forbidden (retrying will not help), 4 not found, 5 payment or quota required, 6 a bad argument or a rejected request, 7 rate limited (back off), 8 service unavailable (retryable). The JSON error.type is still there when you need the finer reason:

if ! OUT=$(idapt chat send --id "$CHAT_ID" \
  --json '{"content":"hi"}' -o json 2>err.json); then
  TYPE=$(jq -r '.error.type // "unknown"' err.json)
  echo "send failed: $TYPE"
  exit 1
fi

The CLI never prompts. It has no --confirm flag and no interactive confirmations, so it never blocks a pipeline waiting for input.

Batch input

Loop a file of JSON payloads through a create command:

# One JSON object per line
while IFS= read -r line; do
  printf '%s' "$line" | idapt agent create --json -
done < agents.jsonl

# Upload every PDF in a directory
for f in ./reports/*.pdf; do
  idapt drive upload --file "$f"
done

CI/CD

A GitHub Actions step, authenticating from a secret:

- name: Install the idapt CLI
  run: npm i -g @idapt/cli

- name: Notify the team
  env:
    IDAPT_API_KEY: ${{ credentials.IDAPT_API_KEY }}
  run: |
    idapt workspace use ${{ vars.IDAPT_WORKSPACE_ID }}
    idapt chat send --id ${{ vars.IDAPT_CHAT_ID }} \
      --json '{"content":"CI finished on main"}'

Keep payloads in files and pass --json @file so quotes and newlines survive the YAML and the shell intact.

Related articles

📋

Output and input formats

Control CLI output (table, JSON, JSONL, quiet) and pass input (flags, JSON, a file, or stdin).

📖

Command reference

The idapt <resource> <verb> grammar, how to discover any command from the terminal, and the full command list.

🔑

API keys and scopes

Create a key, choose its scopes, pin it to an API version, rotate it, and cap what it can spend.

Up next

The computer daemon

What idapt-computer runs on a paired machine, how to manage the service, and where its config lives.

Was this helpful?