Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

Notable changes to `@wirecat/attio-cli`. One section per version, newest first.

## 0.2.0 — 19.11.2026

### Changed — may break callers

- **`attio <profile> sync` copies only the people and companies your deals name**, as bitrix24-cli does. Attio adds a
person and a company for every address in your mail, and a full copy held thousands you never sell to. Every other
one is still found by `people list` and `organizations list`, which read Attio live.

### Fixed

- **A workspace with Attio's Deals object turned off syncs**, and `sync` names that as a gap. It failed with
`not_found` before.

## 0.1.0 — 18.11.2026

### Added
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ Agent: (runs attio work changes list change:won "at>=7d")

## Why attio

- **A copy of your CRM on your computer.** `sync` copies your deals, people and companies into a local store. Lists,
the pipeline board and search answer from it with no request to Attio, also offline.
- **A copy of your CRM on your computer.** `sync` copies your deals and the people and companies on them into a local
store. Lists, the pipeline board and search answer from it with no request to Attio, also offline.
- **A permission on every action.** Each command and each Attio API operation has its own level: allow, ask, read
only or deny. `WCATTIO_READ_ONLY=1` stops every write.
- **The token stays in your system keyring.** It never appears in output, errors or run records, and is never taken
Expand All @@ -68,7 +68,7 @@ a terminal:
npm install -g @wirecat/attio-cli
attio skill install # the agent skill, for Claude Code, Codex, Gemini CLI and OpenClaw
attio work session start # paste your Attio access token
attio work sync # copy your deals, people and companies
attio work sync # copy your deals and their people and companies
attio work deals list status:open
```

Expand Down Expand Up @@ -167,8 +167,9 @@ More: [using attio](https://github.com/WireCatLabs/attio-cli/blob/main/docs/usag

- **An access token.** A workspace admin makes it in Attio. It is kept in the system keyring, or in a private file
on a computer without one.
- **A local copy.** `sync` copies the workspace's deals, people and companies, with the stages of Attio's deal
pipeline, into the WireCat local store. Attio cannot list only what changed, so each sync reads every record.
- **A local copy.** `sync` copies the workspace's deals and the people and companies they name, with the stages of
Attio's deal pipeline, into the WireCat local store. Attio cannot list only what changed, so each sync reads every
record.
- **Live where it matters.** `people`, `organizations` and `users` ask Attio each time, so they show the newest data.
- **Made for scripts.** `--json` prints one JSON value for every command, and an error comes as JSON with a code to
branch on.
Expand Down
22 changes: 20 additions & 2 deletions contracts/wirecat.json
Original file line number Diff line number Diff line change
Expand Up @@ -2301,7 +2301,7 @@
"--json"
],
"lastShape": "runs",
"what": "your deals, people and companies",
"what": "your deals and their clients",
"note": null
},
"storeInfo": null,
Expand All @@ -2316,6 +2316,24 @@
"app": "attio-cli",
"env": "WCATTIO"
},
"settings": null
"settings": null,
"accountRemove": {
"signOut": [
"{profile}",
"session",
"end",
"--record",
"--json"
],
"remove": null,
"removes": [
"signIn"
],
"keeps": [
"settings",
"data",
"listed"
]
}
}
}
2 changes: 1 addition & 1 deletion docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -1968,7 +1968,7 @@ attio api self-list

## `attio sync`

bring the CRM's copy in the local store up to date: pipelines, companies, contacts, deals and leads that changed since the last sync, or everything with --rescan; a run stops before its deadline or --max-pages and the next one goes on from there. With the activities setting on, also the activities and tasks on the deals and leads it keeps. Then each deal or lead that moved into a stage the stage-tasks setting names opens a local task, once per move
bring the CRM's copy in the local store up to date: pipelines, companies, contacts, deals and leads that changed since the last sync, or everything with --rescan; a run stops before its deadline or --max-pages and the next one goes on from there

**Changes something on this computer only.**

Expand Down
1 change: 1 addition & 0 deletions docs/dev/live-checks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
0.0.0 9fb9e9b4c7b130c230ec470b6997eb98ae980cab 2026-11-18 scripts/live.sh v2:bcecdc6c78f330e20db1ae5121dea074362ec207c91002b2fef2ae12d9252e37
0.0.0 566a4c49762f2a040aedea214d599f6901adfc49 2026-11-18 scripts/live.sh v2:801aaeff341e47af83c63f58dd20a61343e5034469ec3275b6bcc157d4492789
0.1.0 e50bb05bb98123226a9a885a3ec65c9977b33e15 2026-11-18 scripts/live.sh v2:6955831e23adf6de8d6be01900945c9c2bf64d4a6c0b5785dacf689deb65cbe9
0.2.0 1513a2caa1c5933137f1af42b5395880bcbe177d 2026-11-18 scripts/live.sh v2:2dfc209ec1e1767b3de3a3454a9ffdbdf63395678935f24670188b512d072f94
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ Agent: (runs attio work changes list change:won "at>=7d")

## How it works

- **A copy on your computer.** `sync` puts your deals, people and companies into the WireCat local store, the one
file on your computer that every WireCat tool shares. Lists, the pipeline and search read it, also offline.
- **A copy on your computer.** `sync` puts your deals and the people and companies on them into the WireCat local store,
the one file on your computer that every WireCat tool shares. Lists, the pipeline and search read it, also offline.
- **Sign-in with an access token.** It is kept in the system keyring, or in a private file on a computer without one.
- **Made for scripts and agents.** `--json` gives a JSON answer, and an error comes with a code to branch on.
[MCP](mcp.md)
Expand All @@ -114,7 +114,7 @@ Or in a terminal:
npm install -g @wirecat/attio-cli
attio skill install # teaches Claude Code, Codex and Gemini CLI to use attio
attio work session start # paste the Attio access token when it asks
attio work sync # copy your deals, people and companies
attio work sync # copy your deals and their people and companies
attio work deals list status:open
```

Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ does not land in your shell history.

```sh
attio work session status --check # asks Attio which workspace the token belongs to
attio work sync # copies your deals, people and companies
attio work sync # copies your deals and their people and companies
attio work deals list status:open
```

Expand Down
8 changes: 4 additions & 4 deletions docs/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ agent asks. Attio's tokens do not expire, so delete one you no longer use.

## What the copy holds

`sync` stores the workspace's deals, people and companies in the WireCat local store on this computer, where every
WireCat tool can read them: a deal's stage, amount, company, people and owner, and a person's name, e-mails, phones
and job title. Each record keeps its current values only. `people` and `organizations` read Attio live and add
nothing to the copy.
`sync` stores the workspace's deals, and the people and companies they name, in the WireCat local store on this
computer, where every WireCat tool can read them: a deal's stage, amount, company, people and owner, and a person's
name, e-mails, phones and job title. Each record keeps its current values only. `people` and `organizations` read Attio
live and add nothing to the copy.

Text from Attio, such as deal titles, names and attribute values, reaches an agent marked `untrusted`, so the agent
reads it as data, not as an instruction.
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wirecat/attio-cli",
"version": "0.1.0",
"version": "0.2.0",
"description": "Attio CRM: people and companies, searchable with your other WireCat data",
"license": "Apache-2.0",
"author": "Viacheslav Ptsarev",
Expand Down Expand Up @@ -60,8 +60,8 @@
"source:check": "node --experimental-strip-types scripts/source-check.ts"
},
"dependencies": {
"@wirecat/cli-base": "0.118.0",
"@wirecat/cli-core": "0.700.0",
"@wirecat/cli-base": "0.119.0",
"@wirecat/cli-core": "0.703.0",
"commander": "15.0.0",
"valibot": "1.5.0"
},
Expand Down
22 changes: 11 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions scripts/live.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ node -e '
const sync = JSON.parse(require("fs").readFileSync(process.argv[1], "utf8"))
const item = sync.item ?? {}
if (item.provider !== "attio") throw new Error(`not an attio sync: ${JSON.stringify(sync).slice(0, 200)}`)
const kinds = (item.synced ?? []).filter((one) => one.error === undefined && one.saved > 0).map((one) => one.kind)
for (const kind of ["person", "organization"])
if (!kinds.includes(kind)) throw new Error(`no ${kind} saved: ${JSON.stringify(item.synced).slice(0, 300)}`)
// People and companies are copied only as a deal names them, so a workspace with no deals saves none.
const failed = (item.synced ?? []).filter((one) => one.error !== undefined)
if (failed.length || !(item.synced ?? []).length)
throw new Error(`sync failed: ${JSON.stringify(item.synced).slice(0, 300)}`)
' "$work/sync.json"
# Totals only: the record is public, the workspace's data is not.
"${cli[@]}" live pipelines list --json >"$work/pipelines.json"
Expand All @@ -51,6 +52,8 @@ node -e '
const kinds = synced.map((one) => `${one.kind} ${one.error ? `error ${one.error.code ?? one.error}` : one.saved}`)
const stages = (read("pipelines").items ?? []).map((one) => (one.stages ?? []).length)
const live = ["people", "organizations"].map((name) => `${name} ${(read(name).items ?? []).length}`)
for (const name of ["people", "organizations"])
if (!(read(name).items ?? []).length) throw new Error(`no ${name} listed live`)
process.stdout.write(`synced: ${kinds.join(", ")}; pipelines: ${stages.length} with ${stages.join("+")} stages; live: ${live.join(", ")}\n`)
' "$work"
"${cli[@]}" live doctor --json >/dev/null
Expand Down
6 changes: 4 additions & 2 deletions src/attio-map.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,15 @@ const source = (calls: { operation: string; body: unknown }[] = []) =>
return request.path.identifier === "deals" && !Number(request.query.offset)
? { data: [{ api_slug: "priority", title: "Priority", type: "select", is_system_attribute: false }] }
: { data: [] }
// A person or a company is copied as a deal names it, each read by id.
if (operation === "getV2ObjectsByObjectRecordsByRecordId") return { data: RECORDS[String(request.path.object)] }
expect(operation).toBe("postV2ObjectsByObjectRecordsQuery")
return { data: Number(body?.offset) ? [] : [RECORDS[String(request.path.object)]] }
},
...HOOK_OPTIONS,
})

it("maps an Attio person", async () => {
it("copies the person a deal names, mapped from Attio", async () => {
const page = await source().changes("person", null)
expect("items" in page && page.items).toEqual([
expect.objectContaining({
Expand Down Expand Up @@ -128,7 +130,7 @@ it("reads Attio's one deal pipeline: won where it celebrates, lost by the title"
])
})

it("maps an Attio company with its domain and team", async () => {
it("copies the company a deal names, with its domain and team", async () => {
const page = await source().changes("organization", null)
expect("items" in page && page.items).toEqual([
expect.objectContaining({
Expand Down
4 changes: 1 addition & 3 deletions src/crm-options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ it("every option of the CRM commands runs against the fake workspace", async ()
["pipelines", "show", "Deals"],
["pipelines", "show", "Deals", "--since-time", "2026-01-01", "--until-time", "2026-12-31"],
["people", "list", "--limit", "1", "--page", "2"],
// Words go through Attio's filter `$or`, which its API description leaves out (an open object): src/attio-map.test.ts
// checks that search.
["people", "list", "--format", "csv"],
["people", "list", "name", "--format", "csv"],
["people", "show", refs.person],
["organizations", "list", "--limit", "1", "--page", "1"],
["organizations", "list", "--format", "csv"],
Expand Down
15 changes: 15 additions & 0 deletions src/generated/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5367,6 +5367,9 @@ export const definitions: Readonly<Record<string, SchemaNode>> = {
type: "object",
properties: {},
required: [],
additionalProperties: {
type: "unknown",
},
},
filter_view_id: {
description:
Expand Down Expand Up @@ -16564,6 +16567,9 @@ export const definitions: Readonly<Record<string, SchemaNode>> = {
type: "object",
properties: {},
required: [],
additionalProperties: {
type: "unknown",
},
},
{
type: "string",
Expand Down Expand Up @@ -18358,6 +18364,9 @@ export const definitions: Readonly<Record<string, SchemaNode>> = {
type: "object",
properties: {},
required: [],
additionalProperties: {
type: "unknown",
},
},
sorts: {
description:
Expand Down Expand Up @@ -28562,6 +28571,9 @@ export const definitions: Readonly<Record<string, SchemaNode>> = {
type: "object",
properties: {},
required: [],
additionalProperties: {
type: "unknown",
},
},
filter_view_id: {
description:
Expand Down Expand Up @@ -39756,6 +39768,9 @@ export const definitions: Readonly<Record<string, SchemaNode>> = {
type: "object",
properties: {},
required: [],
additionalProperties: {
type: "unknown",
},
},
{
type: "string",
Expand Down
10 changes: 5 additions & 5 deletions src/generated/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2675,7 +2675,7 @@ export const PostV2ObjectsByObjectRecordsQueryRequest: v.GenericSchema<
unknown,
T.PostV2ObjectsByObjectRecordsQueryRequest
> = v.looseObject({
filter: v.optional(v.looseObject({})),
filter: v.optional(v.record(v.string(), v.unknown())),
filter_view_id: v.optional(v.string()),
sorts: v.optional(
v.array(
Expand Down Expand Up @@ -8193,7 +8193,7 @@ export const PutV2ObjectsByObjectRecordsByRecordIdAttributesByAttributeValuesReq
values: v.pipe(
v.array(
v.looseObject({
value: v.union([v.looseObject({}), v.string(), number(), v.boolean()]),
value: v.union([v.record(v.string(), v.unknown()), v.string(), number(), v.boolean()]),
active_from: v.string(),
active_until: v.nullable(v.string()),
}),
Expand Down Expand Up @@ -9050,7 +9050,7 @@ export const PostV2ActivitiesByActivityRecordsQueryRequest: v.GenericSchema<
unknown,
T.PostV2ActivitiesByActivityRecordsQueryRequest
> = v.looseObject({
filter: v.optional(v.looseObject({})),
filter: v.optional(v.record(v.string(), v.unknown())),
sorts: v.optional(
v.array(
v.union([
Expand Down Expand Up @@ -13951,7 +13951,7 @@ export const DeleteV2ListsByListViewsByViewIdResponse: v.GenericSchema<

export const PostV2ListsByListEntriesQueryRequest: v.GenericSchema<unknown, T.PostV2ListsByListEntriesQueryRequest> =
v.looseObject({
filter: v.optional(v.looseObject({})),
filter: v.optional(v.record(v.string(), v.unknown())),
filter_view_id: v.optional(v.string()),
sorts: v.optional(
v.array(
Expand Down Expand Up @@ -19461,7 +19461,7 @@ export const PutV2ListsByListEntriesByEntryIdAttributesByAttributeValuesRequest:
values: v.pipe(
v.array(
v.looseObject({
value: v.union([v.looseObject({}), v.string(), number(), v.boolean()]),
value: v.union([v.record(v.string(), v.unknown()), v.string(), number(), v.boolean()]),
active_from: v.string(),
active_until: v.nullable(v.string()),
}),
Expand Down
Loading
Loading