zd-agent-cli
v0.1.6
Published
AI Agent ready Zendesk access through your existing browser session. No API keys required.
Downloads
17
Maintainers
Readme
zd-agent-cli
AI Agent ready Zendesk access through your existing browser session. No API keys required.
zagent connects to a locally authenticated Zendesk Agent Workspace session and outputs structured JSON for queue triage, ticket reads, and search.
Why this exists
Most Zendesk automations depend on API credentials that enterprise teams must issue, rotate, and govern.zd-agent-cli is built for teams that want LLM/agent workflows without introducing long-lived Zendesk API keys.
Install
npm install -g zd-agent-cliOr run from source:
npm install
npm run cli -- --help
npm run dev -- --helpQuickstart
- Ensure Chrome is running with CDP and logged into Zendesk.
- Add
zendesk.config.jsonat your working repo root. - Run first-launch checks:
zagent --json doctor
zagent --json auth check- If not authenticated yet, run:
zagent auth login --timeout 300- Discover queues:
zagent --json queue list- Read queue/ticket data:
zagent --json queue read support-open --count 20
zagent --json ticket read 123456 --comments 10Prerequisites
- macOS with Google Chrome installed.
- CDP endpoint reachable (default:
http://127.0.0.1:9223). - Default Chrome CDP profile dir is repo-local:
./output/zendesk/chrome-profile(gitignored). - Chrome profile used by CDP must be logged into Zendesk Agent Workspace.
zendesk.config.jsonis present (or pass--config <path>).- By default,
zagentenforces CDP/profile ownership (it will not reuse a CDP endpoint launched with a different--user-data-dirunless you opt in).
Config Contract
Create zendesk.config.json:
{
"domain": "acme.zendesk.com",
"startPath": "/agent/filters/123456789",
"defaultQueue": "support-open",
"queues": {
"support-open": {
"path": "/agent/filters/123456789",
"team": "support"
},
"technical-support-open": {
"path": "/agent/filters/360000973008",
"team": "technical-support"
}
}
}Required:
domainstartPath(must begin with/agent/)defaultQueue(must match a queue alias)queuesobject where each alias has requiredpath(must begin with/agent/)
Core Commands
zagent --json queue list
zagent --json queue read support-open --count 20
zagent --json ticket read 123456 --comments 10
zagent --json search tickets "checkout issue" --count 20
zagent --json auth check
zagent --json doctor
# ticket read cache controls
zagent --json ticket read 123456 --cache-ttl 120
zagent --json --cache-only ticket read 123456Security Model
What it does
- Uses the local logged-in Zendesk browser session.
- Operates with the same permissions as that human user.
- Produces structured JSON locally for downstream automations/LLMs.
What it does not do
- Does not provision or require Zendesk API keys by default.
- Does not create elevated access beyond the active user session.
- Does not bypass Zendesk auth controls (SSO/MFA/session expiry still apply).
Enterprise posture
- Works with existing identity controls and session policies.
- Reduces secret management overhead for pilot automations.
- Keeps execution local-first by default.
Data handling guidance
- Do not commit real
zendesk.config.jsonfiles. - Do not commit queue/ticket output snapshots with customer data.
- Redact sample outputs before sharing in issues/docs.
Troubleshooting
- Missing/invalid config:
- Run
zagent --json doctorand fixzendesk.config.json.
- Run
- Invalid queue alias:
- Run
zagent --json queue listand use a returned alias.
- Run
- CDP unavailable:
- Verify Chrome CDP is live on
http://127.0.0.1:9223, then rerunzagent --json doctor.
- Verify Chrome CDP is live on
- CDP in use by another profile:
- By default
zagentwill scan a local port range and either reuse a matching-profile CDP session or launch a new one on a free port. - Use
--no-auto-portto disable this behavior. - Use
--allow-shared-cdpto intentionally reuse a different profile on the same CDP endpoint.
- By default
- Auth/session issues:
- Run
zagent auth login --timeout 300and complete login in the opened Chrome profile.
- Run
- Transient navigation/network failures:
- Retry once, then validate
domain,startPath, and queuepath.
- Retry once, then validate
Global Options
--config <path>--domain <host>--start-path <path>--cdp-url <url>--cdp-port-span <n>--profile-dir <path>--store-root <path>--cache-ttl <seconds>--json--out <path>--no-store--no-cache--cache-only--no-launch--allow-shared-cdp--no-auto-port--foreground
Development
npm run lint
npm run typecheck
npm test
npm run smoke
npm run build
npm run verifyRelease
- Versions follow semantic versioning.
v*tags trigger npm publish workflow.- Keep changelog entries for every release.
