You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`GeneratorOptions.appExtensions` is `AppExtensionType[]` where `AppExtensionType = 'custom-panel' | 'custom-modal'`. Check membership with `.includes('custom-panel')`, not boolean equality.
41
+
`GeneratorOptions.appExtensions` is `AppExtensionType[]` where `AppExtensionType` is derived from the `APP_EXTENSION_TYPES` const (`'custom-panel' | 'custom-modal'`). Use `isAppExtensionType(value)` to validate CLI input. Check membership with `.includes('custom-panel')`, not boolean equality.
42
+
43
+
### CLI subcommands
44
+
45
+
Beyond the interactive main flow, the CLI supports subcommands invoked by the AI plugin skills:
**There is no template directory.** Generators build file content as strings using `dedent()`, with conditional string interpolation for optional features. The `src/utils/writeFile.ts` utility writes files, creates parent directories, and auto-formats output with Prettier — generated code is formatted automatically without an explicit format step.
**Rule: never put conditional logic inside `execute()`** — use `when()` at the call site. Steps must be unconditional internally; the builder chain controls what runs.
-**New App Extension type**: add a file under `src/generators/node/appExtensions/` that exports an `async generate*` function and a `*ReactSnippets()` function returning `ReactSnippetContribution`, then wire it in `appExtensions.ts` and `frontend.ts`
123
130
-**Modify generated scaffold**: edit template strings in the corresponding generator file
124
131
125
-
## Core Modules
132
+
## Generated Project Modules
126
133
127
-
### OAuth (`backend/oauth/`)
128
-
Full OAuth 2.0: app registration guidance, authorization redirect, callback handling, token exchange, token refresh, state validation.
134
+
### OAuth (`src/oauth/`)
135
+
Full OAuth 2.0: authorization redirect, callback handling, token exchange, HMAC-signed state parameter with TTL validation.
129
136
130
-
### Database (`backend/database/`)
137
+
### Database (`src/database/`)
131
138
Uses **Drizzle ORM** (`drizzle-orm` + `drizzle-kit`) for schema definition and migrations. Supports Postgres, MySQL, and SQLite with the same TypeScript API.
-`migrations/` — SQL migration files managed by `drizzle-kit`
136
142
-`db.ts` — driver setup (selects `postgres-js`, `mysql2`, or `better-sqlite3` based on chosen DB)
137
143
138
-
### Pipedrive API client (`backend/pipedrive-client/`)
139
-
Wrapper around the official Pipedrive Node.js client with preconfigured authentication and helpers for common API calls.
144
+
### Pipedrive API client (`src/pipedrive/`)
145
+
Wraps the official Pipedrive Node.js SDK. `getClient(companyId)` loads the stored OAuth token and configures `onTokenUpdate` so the SDK handles token refresh automatically.
Generated when the user selects `custom-panel` and/or `custom-modal`. Iframe-based React + Vite UI using the App Extensions SDK (`usePipedriveSdk` hook), with: SDK initialization, theme handling, resize, snackbar, confirmation dialog, signed token, and extension-type-specific actions (open modal from panel, close modal).
@@ -145,11 +151,15 @@ Generated when the user selects `custom-panel` and/or `custom-modal`. Iframe-bas
145
151
146
152
Vitest. Tests generate files into a `tmpdir()/cpa-app-test` directory, read them back to verify content, and clean up in `afterEach`.
147
153
148
-
## AI Plugin Commands (future layer)
154
+
## AI Plugin Layer
149
155
150
-
```
151
-
/pipedrive-new-app
152
-
/pipedrive-add-oauth
153
-
/pipedrive-add-app-extension
154
-
/pipedrive-review-marketplace-readiness
155
-
```
156
+
The `plugin/` directory is shipped with the npm package (`"files": ["dist", "plugin"]`) and contains Claude Code skills that wrap the CLI for AI-assisted development. Each skill is a markdown instruction document in `plugin/skills/<name>/SKILL.md`.
157
+
158
+
| Skill | Purpose |
159
+
|-------|---------|
160
+
|`pipedrive-new-app`| Scaffold a new app interactively via `npx create-pipedrive-app`|
161
+
|`pipedrive-add-app-extension`| Add a panel or modal extension via the `add-app-extension` subcommand |
162
+
|`pipedrive-api`| Guide on using the Pipedrive REST API and SDK within a generated project |
163
+
|`pipedrive-review-marketplace-readiness`| Gap analysis before marketplace submission: checks token refresh, HTTPS, error handling, and rate limit handling |
164
+
165
+
Skills use `allowed-tools` frontmatter to restrict which Claude tools they can invoke. Adding a new skill means creating a `SKILL.md` in a new subdirectory under `plugin/skills/`.
CLI scaffolding tool for Pipedrive Marketplace integrations.
3
+
CLI scaffolding tool for Pipedrive Marketplace integrations. Generates an Express + TypeScript + Drizzle ORM project with OAuth 2.0, a Pipedrive API client, and optional App Extensions frontend (React + Vite). The CLI can be used standalone without any AI tooling.
4
4
5
5
## Usage
6
6
7
7
```bash
8
-
npx create-pipedrive-app<project-name>
8
+
npx create-pipedrive-app
9
9
```
10
10
11
-
The CLI will prompt for:
11
+
The CLI prompts for:
12
12
13
+
-**Project name**
13
14
-**Database**: Postgres, MySQL, or SQLite
14
-
-**App Extensions**: custom panel, custom modal, or none
15
-
-**Webhooks**: yes or no
15
+
-**App Extensions**: custom panel, custom modal, or neither
16
16
17
17
## Generated project
18
18
19
19
```
20
20
<project-name>/
21
21
src/
22
-
index.ts # server entry point (port 3000)
23
-
app.ts # Express app with OAuth router (+ optional webhooks/extensions)
When App Extensions are selected, the generated project also includes a shared React iframe app for custom panels and custom modals. `docker-compose up --watch` starts the backend and Vite dev server in containers with Compose Watch. Local Developer Hub iframe URLs should point at an HTTPS tunnel to the Vite dev server, for example `https://<your-vite-tunnel>/extensions/panel` or `https://<your-vite-tunnel>/extensions/modal`. After `npm run build`, production iframe URLs can point at the backend-hosted`/extensions/panel` and `/extensions/modal` routes.
39
+
When App Extensions are selected, the project includes a shared React iframe app for custom panels and modals. `docker-compose up --watch` starts the backend and Vite dev server in containers with Compose Watch. Local Developer Hub iframe URLs must point at an HTTPS tunnel to the Vite dev server — for example `https://<your-vite-tunnel>/extensions/panel` or `https://<your-vite-tunnel>/extensions/modal`. After `npm run build`, production iframe URLs can point at the backend-hosted routes.
41
40
42
-
## Next steps after generation
41
+
## Requirements
42
+
43
+
- Node.js (to run `npx create-pipedrive-app`)
44
+
- Docker (for Postgres/MySQL databases and App Extensions development)
45
+
46
+
## Using with an AI coding assistant
47
+
48
+
The package ships plugins for **Claude Code** and **Codex** that wrap the CLI with guided slash commands. The plugins require the CLI — they call `npx create-pipedrive-app` under the hood.
49
+
50
+
### Claude Code
51
+
52
+
This repository acts as the Claude Code plugin marketplace. Claude reads the marketplace catalog from `.claude-plugin/marketplace.json`, then installs the plugin from `plugin/`.
53
+
54
+
After this repository is public, install the plugin with:
43
55
44
56
```bash
45
-
cd<project-name>
46
-
cp .env.example .env
47
-
docker-compose up -d db # if Postgres or MySQL was selected
48
-
npm install
49
-
npm run dev
57
+
claude plugin marketplace add pipedrive/create-pipedrive-app
58
+
claude plugin install create-pipedrive-app@pipedrive
59
+
```
60
+
61
+
Inside Claude Code, use the equivalent slash commands:
0 commit comments