@wavyx/pdcli 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.
- package/CHANGELOG.md +24 -0
- package/LICENSE +21 -0
- package/README.md +32 -0
- package/bin/run.js +20 -0
- package/oclif.manifest.json +2308 -0
- package/package.json +128 -0
- package/src/base-command.js +99 -0
- package/src/commands/activity/get.js +41 -0
- package/src/commands/activity/list.js +61 -0
- package/src/commands/api.js +60 -0
- package/src/commands/auth/login.js +79 -0
- package/src/commands/auth/logout.js +24 -0
- package/src/commands/auth/status.js +62 -0
- package/src/commands/config/get.js +30 -0
- package/src/commands/config/list.js +25 -0
- package/src/commands/config/set.js +29 -0
- package/src/commands/deal/get.js +43 -0
- package/src/commands/deal/list.js +62 -0
- package/src/commands/doctor.js +123 -0
- package/src/commands/field/get.js +58 -0
- package/src/commands/field/list.js +41 -0
- package/src/commands/org/get.js +41 -0
- package/src/commands/org/list.js +40 -0
- package/src/commands/person/get.js +41 -0
- package/src/commands/person/list.js +49 -0
- package/src/commands/profile/current.js +16 -0
- package/src/commands/profile/list.js +36 -0
- package/src/commands/profile/use.js +26 -0
- package/src/commands/search.js +67 -0
- package/src/commands/user/me.js +26 -0
- package/src/commands/version.js +24 -0
- package/src/hooks/command-not-found.js +15 -0
- package/src/hooks/init.js +7 -0
- package/src/hooks/prerun.js +7 -0
- package/src/lib/auth.js +95 -0
- package/src/lib/body.js +26 -0
- package/src/lib/client.js +184 -0
- package/src/lib/config.js +71 -0
- package/src/lib/errors.js +118 -0
- package/src/lib/fields.js +120 -0
- package/src/lib/keychain.js +69 -0
- package/src/lib/output/index.js +22 -0
- package/src/lib/output/json.js +7 -0
- package/src/lib/output/record.js +27 -0
- package/src/lib/output/table.js +40 -0
- package/src/lib/pagination.js +14 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `pdcli` are documented here. Format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/); versions follow
|
|
5
|
+
[SemVer](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Token-first authentication (`auth login/status/logout`) — API token stored
|
|
12
|
+
only in the OS keychain; company domain in per-profile config.
|
|
13
|
+
- Profiles (`profile list/use/current`) and per-profile config
|
|
14
|
+
(`config get/set/list`).
|
|
15
|
+
- Core CRM reads on API v2: `deal|person|org|activity list/get` with cursor
|
|
16
|
+
pagination and `--limit`.
|
|
17
|
+
- Custom-field discovery and resolution: `field list/get` plus automatic
|
|
18
|
+
name/label resolution in table output.
|
|
19
|
+
- Global `search` (itemSearch).
|
|
20
|
+
- Host-locked raw escape hatch: `pdcli api <METHOD> <path>` (v1 + v2).
|
|
21
|
+
- `doctor` diagnostics and `version`.
|
|
22
|
+
- Dual-API client: token-budget-aware 429 backoff, 429→403 hard stop,
|
|
23
|
+
`--no-retry`, `--timeout`; deterministic sysexits exit codes.
|
|
24
|
+
- Output: table (TTY) and JSON (piped) via `--output`.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Eric Rodriguez
|
|
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,32 @@
|
|
|
1
|
+
# pdcli
|
|
2
|
+
|
|
3
|
+
Command-line interface for [Pipedrive](https://www.pipedrive.com/) — fast, scriptable, built for terminals, CI pipelines, and AI agents.
|
|
4
|
+
|
|
5
|
+
> **Status: pre-release (v0.1 in development).** Not affiliated with or endorsed by Pipedrive.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @wavyx/pdcli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pdcli auth login # company domain + API token (stored in your OS keychain)
|
|
17
|
+
pdcli user me
|
|
18
|
+
pdcli deal list --limit 10
|
|
19
|
+
pdcli deal list --output json | jq '.[].id'
|
|
20
|
+
pdcli field list deal # custom fields with their hash keys
|
|
21
|
+
pdcli search "acme"
|
|
22
|
+
pdcli api GET /api/v1/currencies # raw, host-locked escape hatch
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- Token lives **only** in the OS keychain — never in plaintext on disk.
|
|
26
|
+
- `--output table|json` on every command; table in a TTY, JSON when piped.
|
|
27
|
+
- Deterministic [sysexits](https://man.freebsd.org/cgi/man.cgi?query=sysexits) exit codes for scripting.
|
|
28
|
+
- CI: `PDCLI_COMPANY_DOMAIN=acme PDCLI_API_TOKEN=... pdcli deal list`
|
|
29
|
+
|
|
30
|
+
## License
|
|
31
|
+
|
|
32
|
+
MIT
|
package/bin/run.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { existsSync } from 'node:fs'
|
|
3
|
+
import { resolve } from 'node:path'
|
|
4
|
+
import { execute } from '@oclif/core'
|
|
5
|
+
|
|
6
|
+
const envFile = resolve(process.cwd(), '.env')
|
|
7
|
+
if (existsSync(envFile)) {
|
|
8
|
+
const { readFileSync } = await import('node:fs')
|
|
9
|
+
for (const line of readFileSync(envFile, 'utf8').split('\n')) {
|
|
10
|
+
const trimmed = line.trim()
|
|
11
|
+
if (!trimmed || trimmed.startsWith('#')) continue
|
|
12
|
+
const eq = trimmed.indexOf('=')
|
|
13
|
+
if (eq === -1) continue
|
|
14
|
+
const key = trimmed.slice(0, eq).trim()
|
|
15
|
+
const value = trimmed.slice(eq + 1).trim()
|
|
16
|
+
if (!process.env[key]) process.env[key] = value
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
await execute({ dir: import.meta.url })
|