attio-cli 0.1.0

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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +175 -0
  3. package/dist/attio.js +1325 -0
  4. package/package.json +32 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 attio-cli contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,175 @@
1
+ # attio-cli
2
+
3
+ CLI for the Attio CRM API. Built for scripts, agents, and humans who prefer terminals.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g attio-cli
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```bash
14
+ export ATTIO_API_KEY=your_key
15
+ # or
16
+ attio config set api-key your_key
17
+
18
+ attio whoami
19
+ attio objects list
20
+ attio people list --limit 5
21
+ ```
22
+
23
+ ## Command Reference
24
+
25
+ | Command | Description |
26
+ |---------|-------------|
27
+ | `attio whoami` | Show current workspace and user info |
28
+ | **Objects** | |
29
+ | `attio objects list` | List all objects in the workspace |
30
+ | `attio objects get <slug>` | Get details for a specific object |
31
+ | **Attributes** | |
32
+ | `attio attributes list <object>` | List attributes for an object |
33
+ | **Records** | |
34
+ | `attio records list <object>` | List records for an object |
35
+ | `attio records get <object> <id>` | Get a specific record |
36
+ | `attio records create <object>` | Create a new record |
37
+ | `attio records update <object> <id>` | Update an existing record |
38
+ | `attio records delete <object> <id>` | Delete a record |
39
+ | `attio records upsert <object>` | Create or update a record by matching attribute |
40
+ | `attio records search <object>` | Full-text search across records |
41
+ | **People** | |
42
+ | `attio people list` | List people |
43
+ | `attio people get <id>` | Get a person by ID |
44
+ | `attio people create` | Create a person |
45
+ | `attio people update <id>` | Update a person |
46
+ | `attio people delete <id>` | Delete a person |
47
+ | `attio people search <query>` | Search people by name or email |
48
+ | **Companies** | |
49
+ | `attio companies list` | List companies |
50
+ | `attio companies get <id>` | Get a company by ID |
51
+ | `attio companies create` | Create a company |
52
+ | `attio companies update <id>` | Update a company |
53
+ | `attio companies delete <id>` | Delete a company |
54
+ | `attio companies search <query>` | Search companies by name or domain |
55
+ | **Lists** | |
56
+ | `attio lists list` | List all lists |
57
+ | `attio lists get <id>` | Get a specific list |
58
+ | **Entries** | |
59
+ | `attio entries list <list>` | List entries in a list |
60
+ | `attio entries get <list> <id>` | Get a specific entry |
61
+ | `attio entries create <list>` | Add an entry to a list |
62
+ | `attio entries update <list> <id>` | Update a list entry |
63
+ | `attio entries delete <list> <id>` | Remove an entry from a list |
64
+ | **Tasks** | |
65
+ | `attio tasks list` | List tasks |
66
+ | `attio tasks get <id>` | Get a specific task |
67
+ | `attio tasks create` | Create a task |
68
+ | `attio tasks update <id>` | Update a task |
69
+ | `attio tasks delete <id>` | Delete a task |
70
+ | **Notes** | |
71
+ | `attio notes list` | List notes |
72
+ | `attio notes get <id>` | Get a specific note |
73
+ | `attio notes create` | Create a note |
74
+ | `attio notes delete <id>` | Delete a note |
75
+ | **Comments** | |
76
+ | `attio comments list` | List comments on a thread |
77
+ | `attio comments create` | Create a comment |
78
+ | `attio comments delete <id>` | Delete a comment |
79
+ | **Members** | |
80
+ | `attio members list` | List workspace members |
81
+ | **Config** | |
82
+ | `attio config set <key> <value>` | Set a config value |
83
+ | `attio config get <key>` | Get a config value |
84
+ | `attio config path` | Print the config file path |
85
+ | **Open** | |
86
+ | `attio open` | Open the Attio web app in your browser |
87
+
88
+ ## Global Flags
89
+
90
+ | Flag | Description |
91
+ |------|-------------|
92
+ | `--api-key <key>` | Override the API key for this request |
93
+ | `--json` | Force JSON output |
94
+ | `--table` | Force table output |
95
+ | `--csv` | Force CSV output |
96
+ | `-q, --quiet` | Only output IDs (one per line) |
97
+ | `--no-color` | Disable colored output |
98
+ | `--debug` | Print request/response details to stderr |
99
+
100
+ Output format is auto-detected: table when stdout is a TTY (interactive terminal), JSON when piped.
101
+
102
+ ## Filtering
103
+
104
+ Use `--filter` to narrow results. The syntax is `attribute operator value`.
105
+
106
+ | Operator | Meaning | Example |
107
+ |----------|---------|---------|
108
+ | `=` | Equals | `--filter 'name=Acme'` |
109
+ | `!=` | Not equals | `--filter 'status!=closed'` |
110
+ | `~` | Contains | `--filter 'name~corp'` |
111
+ | `!~` | Does not contain | `--filter 'name!~test'` |
112
+ | `^` | Starts with | `--filter 'name^Acme'` |
113
+ | `>` | Greater than | `--filter 'revenue>1000000'` |
114
+ | `>=` | Greater than or equal | `--filter 'created_at>=2024-01-01'` |
115
+ | `<` | Less than | `--filter 'revenue<500000'` |
116
+ | `<=` | Less than or equal | `--filter 'created_at<=2024-12-31'` |
117
+ | `?` | Is set / not empty | `--filter 'email?'` |
118
+
119
+ Multiple filters are ANDed together:
120
+
121
+ ```bash
122
+ attio records list companies --filter 'name~Acme' --filter 'revenue>=1000000'
123
+ ```
124
+
125
+ ## Sorting
126
+
127
+ Use `--sort` with the format `attribute:direction`:
128
+
129
+ ```bash
130
+ attio records list companies --sort name:asc
131
+ attio people list --sort name.last_name:desc
132
+ ```
133
+
134
+ ## Scripting Examples
135
+
136
+ ```bash
137
+ # Create a company and immediately add a note
138
+ ID=$(attio records create companies --set name="Acme" --set domains='["acme.com"]' -q)
139
+ attio notes create --object companies --record $ID --title "New lead" --content "From website"
140
+
141
+ # Export all companies to JSON
142
+ attio records list companies --all --json > companies.json
143
+
144
+ # Pipe to jq
145
+ attio records list companies --all --json | jq -r '.[].values.name[0].value'
146
+ ```
147
+
148
+ ```bash
149
+ # Bulk update from a CSV
150
+ while IFS=, read -r id status; do
151
+ attio records update companies "$id" --set "status=$status"
152
+ done < updates.csv
153
+ ```
154
+
155
+ ```bash
156
+ # Find and delete test records
157
+ attio records list companies --filter 'name^TEST_' --json -q | \
158
+ xargs -I{} attio records delete companies {}
159
+ ```
160
+
161
+ ## Why CLI over MCP for Agents
162
+
163
+ While MCP tools let AI agents call APIs through natural language, a CLI is often the better choice for automated workflows. CLI commands are deterministic -- the same input always produces the same output, with no LLM interpretation layer to introduce variance. They are cheaper because they skip the token cost of encoding tool schemas and parsing responses. They are faster since there is no round-trip through a language model. And they are composable: you can pipe `attio` output into `jq`, `grep`, `xargs`, or any other Unix tool, building complex workflows from simple parts that are easy to debug and reproduce.
164
+
165
+ ## Contributing
166
+
167
+ 1. Fork the repo
168
+ 2. Create a feature branch (`git checkout -b feature/my-feature`)
169
+ 3. Make your changes
170
+ 4. Run tests (`npm test`)
171
+ 5. Submit a pull request
172
+
173
+ ## License
174
+
175
+ MIT -- see [LICENSE](LICENSE) for details.