@hiro5409/attio-cli 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +174 -2
- package/bin/attio-api +2 -0
- package/dist/cli-cTGHeWUi.mjs +4747 -0
- package/dist/cli-cTGHeWUi.mjs.map +1 -0
- package/dist/main.mjs +7 -0
- package/dist/main.mjs.map +1 -0
- package/dist/package-lsdxDgro.mjs +70 -0
- package/dist/package-lsdxDgro.mjs.map +1 -0
- package/package.json +70 -3
- package/skills/attio-cli/SKILL.md +26 -0
package/dist/main.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.mjs","names":[],"sources":["../src/main.ts"],"sourcesContent":["const { main } = await import(\"./cli.ts\");\n\nprocess.exitCode = await main();\n"],"mappings":";AAAA,MAAM,EAAE,SAAS,MAAM,OAAO;AAE9B,QAAQ,WAAW,MAAM,KAAK"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
//#region package.json
|
|
2
|
+
var package_default = {
|
|
3
|
+
name: "@hiro5409/attio-cli",
|
|
4
|
+
version: "0.1.1",
|
|
5
|
+
description: "A type-safe, agent-friendly CLI for the Attio API.",
|
|
6
|
+
keywords: [
|
|
7
|
+
"attio",
|
|
8
|
+
"cli",
|
|
9
|
+
"crm",
|
|
10
|
+
"typescript"
|
|
11
|
+
],
|
|
12
|
+
homepage: "https://github.com/Hiro5409/attio-cli#readme",
|
|
13
|
+
bugs: { "url": "https://github.com/Hiro5409/attio-cli/issues" },
|
|
14
|
+
license: "MIT",
|
|
15
|
+
repository: {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/Hiro5409/attio-cli.git"
|
|
18
|
+
},
|
|
19
|
+
bin: { "attio-api": "bin/attio-api" },
|
|
20
|
+
files: [
|
|
21
|
+
"bin",
|
|
22
|
+
"dist",
|
|
23
|
+
"skills"
|
|
24
|
+
],
|
|
25
|
+
type: "module",
|
|
26
|
+
publishConfig: { "access": "public" },
|
|
27
|
+
scripts: {
|
|
28
|
+
"dev": "vp pack --logLevel silent && node dist/main.mjs",
|
|
29
|
+
"build": "vp pack",
|
|
30
|
+
"test": "vp test",
|
|
31
|
+
"check": "vp run check:generated && vp check && tsc --noEmit && vp test && knip && vp pack && publint --strict",
|
|
32
|
+
"lint": "vp lint",
|
|
33
|
+
"lint:fix": "vp lint --fix",
|
|
34
|
+
"format": "vp fmt",
|
|
35
|
+
"format:check": "vp fmt --check",
|
|
36
|
+
"knip": "knip",
|
|
37
|
+
"check:generated": "vp run generate-types && git diff --exit-code -- src/types && test -z \"$(git ls-files --others --exclude-standard -- src/types)\"",
|
|
38
|
+
"api-schema:update": "node scripts/update-api-schema.ts",
|
|
39
|
+
"api-schema:check": "node scripts/update-api-schema.ts --check",
|
|
40
|
+
"generate-types": "openapi-ts --file openapi-ts.config.ts",
|
|
41
|
+
"prepack": "vp pack",
|
|
42
|
+
"prepublishOnly": "vp run check"
|
|
43
|
+
},
|
|
44
|
+
dependencies: {
|
|
45
|
+
"gunshi": "1.0.0-rc.1",
|
|
46
|
+
"ky": "^2.2.0",
|
|
47
|
+
"valibot": "^1.5.0"
|
|
48
|
+
},
|
|
49
|
+
devDependencies: {
|
|
50
|
+
"@hey-api/openapi-ts": "0.0.0-next-20260930190945",
|
|
51
|
+
"@hey-api/shared": "0.0.0-next-20260930190945",
|
|
52
|
+
"@types/node": "^24.19.1",
|
|
53
|
+
"knip": "^6.39.0",
|
|
54
|
+
"msw": "^3.0.2",
|
|
55
|
+
"publint": "^0.3.25",
|
|
56
|
+
"typescript": "^7.0.2",
|
|
57
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@1.0.0",
|
|
58
|
+
"vite-plus": "1.0.0"
|
|
59
|
+
},
|
|
60
|
+
devEngines: { "packageManager": {
|
|
61
|
+
"name": "pnpm",
|
|
62
|
+
"version": "12.12.1",
|
|
63
|
+
"onFail": "download"
|
|
64
|
+
} },
|
|
65
|
+
engines: { "node": ">=24.11.0" }
|
|
66
|
+
};
|
|
67
|
+
//#endregion
|
|
68
|
+
export { package_default as default };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=package-lsdxDgro.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-lsdxDgro.mjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,73 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hiro5409/attio-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "A type-safe, agent-friendly CLI for the Attio API.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"attio",
|
|
7
|
+
"cli",
|
|
8
|
+
"crm",
|
|
9
|
+
"typescript"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/Hiro5409/attio-cli#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/Hiro5409/attio-cli/issues"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/Hiro5409/attio-cli.git"
|
|
19
|
+
},
|
|
20
|
+
"bin": {
|
|
21
|
+
"attio-api": "bin/attio-api"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"bin",
|
|
25
|
+
"dist",
|
|
26
|
+
"skills"
|
|
27
|
+
],
|
|
28
|
+
"type": "module",
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"gunshi": "1.0.0-rc.1",
|
|
34
|
+
"ky": "^2.2.0",
|
|
35
|
+
"valibot": "^1.5.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@hey-api/openapi-ts": "0.0.0-next-20260930190945",
|
|
39
|
+
"@hey-api/shared": "0.0.0-next-20260930190945",
|
|
40
|
+
"@types/node": "^24.19.1",
|
|
41
|
+
"knip": "^6.39.0",
|
|
42
|
+
"msw": "^3.0.2",
|
|
43
|
+
"publint": "^0.3.25",
|
|
44
|
+
"typescript": "^7.0.2",
|
|
45
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@1.0.0",
|
|
46
|
+
"vite-plus": "1.0.0"
|
|
47
|
+
},
|
|
48
|
+
"devEngines": {
|
|
49
|
+
"packageManager": {
|
|
50
|
+
"name": "pnpm",
|
|
51
|
+
"version": "12.12.1",
|
|
52
|
+
"onFail": "download"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=24.11.0"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"dev": "vp pack --logLevel silent && node dist/main.mjs",
|
|
60
|
+
"build": "vp pack",
|
|
61
|
+
"test": "vp test",
|
|
62
|
+
"check": "vp run check:generated && vp check && tsc --noEmit && vp test && knip && vp pack && publint --strict",
|
|
63
|
+
"lint": "vp lint",
|
|
64
|
+
"lint:fix": "vp lint --fix",
|
|
65
|
+
"format": "vp fmt",
|
|
66
|
+
"format:check": "vp fmt --check",
|
|
67
|
+
"knip": "knip",
|
|
68
|
+
"check:generated": "vp run generate-types && git diff --exit-code -- src/types && test -z \"$(git ls-files --others --exclude-standard -- src/types)\"",
|
|
69
|
+
"api-schema:update": "node scripts/update-api-schema.ts",
|
|
70
|
+
"api-schema:check": "node scripts/update-api-schema.ts --check",
|
|
71
|
+
"generate-types": "openapi-ts --file openapi-ts.config.ts"
|
|
72
|
+
}
|
|
6
73
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: attio-cli
|
|
3
|
+
description: Use when reading or changing an Attio workspace through the attio-api CLI, including records, list entries, attributes, notes, tasks, and webhooks.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
source: https://github.com/Hiro5409/attio-cli
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# attio-cli
|
|
10
|
+
|
|
11
|
+
Probe with `command -v attio-api && attio-api --version`.
|
|
12
|
+
If unavailable, install with `npm install --global @hiro5409/attio-cli`.
|
|
13
|
+
|
|
14
|
+
1. Use `attio-api --help` and `attio-api <group> --help` as the supported command surface. Each command carries the name of its page in Attio's API reference: "Upsert a record" is `attio-api records upsert-a-record`.
|
|
15
|
+
Read the selected command's `--help` for its options.
|
|
16
|
+
2. Start with `attio-api meta identify`. An access token belongs to one workspace; confirm the reported workspace is the intended one and that its scopes cover the task.
|
|
17
|
+
For a missing token, have `ATTIO_ACCESS_TOKEN` supplied through the execution environment. Keep tokens out of command arguments, logs, and repository files.
|
|
18
|
+
3. `--help` names `--body` without describing its shape. Take the shape from the command's page, `https://docs.attio.com/rest-api/endpoint-reference/<group>/<command>`, and pass it as one JSON string.
|
|
19
|
+
4. Resolve what a write refers to with read commands first: `objects list-objects`, `lists list-all-lists`, `attributes list-attributes`, `attributes list-select-options`, `attributes list-statuses`. Write with the slugs and IDs they return; a select or status value must already exist as an option.
|
|
20
|
+
5. To create something that may already exist, use the upsert commands with a unique matching attribute, so that repeating the command changes nothing.
|
|
21
|
+
6. Each command returns one page. With `limit` and `offset`, continue until a page comes back short; with a cursor, continue while the response carries a next cursor.
|
|
22
|
+
7. Execute the requested writes only. A delete has no command that reverses it; ask before deleting anything the request did not name.
|
|
23
|
+
|
|
24
|
+
A command succeeded when it exits with 0 and prints parseable JSON; check a write's returned values against the requested ones.
|
|
25
|
+
|
|
26
|
+
On failure, read `error.code` and `error.hint` from stderr. `INVALID_ARGUMENT` means the command line was wrong and nothing was sent. `BAD_REQUEST` means Attio rejected the options or the body: correct them against `error.message` and the command's page. `FORBIDDEN` means Attio denied the operation; `error.message` says whether a scope, access to the resource, or the workspace's plan is missing, and only the workspace's owner can change that. After `NETWORK_ERROR` or `API_ERROR` on a write, read the target back before sending the write again.
|