autoblogger 0.1.15 → 0.1.17
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/README.md +136 -54
- package/dist/cli/index.js +1224 -0
- package/dist/index.d.mts +54 -8
- package/dist/index.d.ts +54 -8
- package/dist/index.js +932 -99
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +928 -99
- package/dist/index.mjs.map +1 -1
- package/dist/styles/article.d.mts +4 -4
- package/dist/styles/article.d.ts +4 -4
- package/dist/styles/article.js +4 -4
- package/dist/styles/article.js.map +1 -1
- package/dist/styles/article.mjs +4 -4
- package/dist/styles/article.mjs.map +1 -1
- package/dist/styles/autoblogger.css +165 -0
- package/dist/styles/preset.js +48 -8
- package/dist/ui.d.mts +5 -2
- package/dist/ui.d.ts +5 -2
- package/dist/ui.js +1814 -1369
- package/dist/ui.js.map +1 -1
- package/dist/ui.mjs +1734 -1290
- package/dist/ui.mjs.map +1 -1
- package/package.json +15 -2
- package/prisma/schema.prisma +4 -0
package/README.md
CHANGED
|
@@ -68,7 +68,47 @@ You'll also need API keys if you want AI features:
|
|
|
68
68
|
|
|
69
69
|
## Installation
|
|
70
70
|
|
|
71
|
-
###
|
|
71
|
+
### Quick Start (CLI)
|
|
72
|
+
|
|
73
|
+
The fastest way to set up Autoblogger is with the CLI:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
npx autoblogger init
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
This command will:
|
|
80
|
+
|
|
81
|
+
1. Detect your Next.js project and Prisma setup
|
|
82
|
+
2. Merge the required models into your Prisma schema
|
|
83
|
+
3. Create boilerplate files (`lib/cms.ts`, API route, dashboard page)
|
|
84
|
+
4. Patch your Tailwind config to include Autoblogger's components
|
|
85
|
+
5. Run the database migration
|
|
86
|
+
6. Optionally import existing markdown content
|
|
87
|
+
|
|
88
|
+
**CLI Options:**
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npx autoblogger init --yes # Skip prompts, use defaults
|
|
92
|
+
npx autoblogger init --dry-run # Preview changes without writing files
|
|
93
|
+
npx autoblogger init --skip-migrate # Skip database migration
|
|
94
|
+
npx autoblogger init --import=./posts # Import content after setup
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Import Existing Content:**
|
|
98
|
+
|
|
99
|
+
If you have markdown or MDX files, import them into the database:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npx autoblogger import ./content/posts
|
|
103
|
+
npx autoblogger import ./posts --status=published # Import as published
|
|
104
|
+
npx autoblogger import ./posts --tag=imported # Add a tag to all
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Manual Installation
|
|
108
|
+
|
|
109
|
+
If you prefer to set things up manually:
|
|
110
|
+
|
|
111
|
+
#### Step 1: Install the package
|
|
72
112
|
|
|
73
113
|
```bash
|
|
74
114
|
npm install autoblogger
|
|
@@ -76,7 +116,7 @@ npm install autoblogger
|
|
|
76
116
|
|
|
77
117
|
This installs Autoblogger and its dependencies (Tiptap editor, AI SDKs, markdown utilities).
|
|
78
118
|
|
|
79
|
-
|
|
119
|
+
#### Step 2: Add the database models
|
|
80
120
|
|
|
81
121
|
Autoblogger needs several tables in your database. Copy the models from the package's schema file into your own Prisma schema.
|
|
82
122
|
|
|
@@ -110,7 +150,7 @@ The required models are:
|
|
|
110
150
|
| `TopicSubscription` | RSS feed subscriptions for auto-drafting |
|
|
111
151
|
| `NewsItem` | Individual RSS items fetched from subscriptions |
|
|
112
152
|
|
|
113
|
-
|
|
153
|
+
#### Step 3: Run the migration
|
|
114
154
|
|
|
115
155
|
After adding the models to your schema:
|
|
116
156
|
|
|
@@ -120,7 +160,7 @@ npx prisma migrate dev --name add-autoblogger
|
|
|
120
160
|
|
|
121
161
|
This creates the tables in your database.
|
|
122
162
|
|
|
123
|
-
|
|
163
|
+
#### Step 4: Generate the Prisma client
|
|
124
164
|
|
|
125
165
|
```bash
|
|
126
166
|
npx prisma generate
|
|
@@ -273,68 +313,74 @@ The `[[...path]]` syntax is a catch-all route that captures the dashboard's inte
|
|
|
273
313
|
|
|
274
314
|
## Configuring Tailwind
|
|
275
315
|
|
|
276
|
-
Autoblogger's UI uses Tailwind CSS
|
|
316
|
+
Autoblogger's UI uses Tailwind CSS. Add the package's files to your Tailwind content configuration so the classes aren't purged:
|
|
277
317
|
|
|
278
318
|
```javascript
|
|
279
|
-
// tailwind.config.js
|
|
319
|
+
// tailwind.config.js
|
|
280
320
|
module.exports = {
|
|
321
|
+
presets: [require('autoblogger/styles/preset')],
|
|
281
322
|
content: [
|
|
282
323
|
'./app/**/*.{js,ts,jsx,tsx}',
|
|
283
324
|
'./components/**/*.{js,ts,jsx,tsx}',
|
|
284
325
|
// Add this line to include Autoblogger's components
|
|
285
326
|
'./node_modules/autoblogger/dist/**/*.{js,mjs}',
|
|
286
327
|
],
|
|
328
|
+
darkMode: 'class',
|
|
287
329
|
// ... rest of your config
|
|
288
330
|
}
|
|
289
331
|
```
|
|
290
332
|
|
|
291
|
-
The
|
|
333
|
+
The `autoblogger/styles/preset` includes:
|
|
334
|
+
- Typography scale (`text-title`, `text-h1`, `text-h2`, `text-h3`, `text-body`, `text-table`)
|
|
335
|
+
- Color tokens (`bg-background`, `text-muted-foreground`, `border-border`, etc.)
|
|
336
|
+
- Border radius utilities
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## Styling
|
|
341
|
+
|
|
342
|
+
Autoblogger includes a complete theme with CSS variables, prose styles, and editor styling. Import it in your global CSS:
|
|
292
343
|
|
|
293
344
|
```css
|
|
294
|
-
/* globals.css */
|
|
345
|
+
/* app/globals.css */
|
|
346
|
+
@import 'autoblogger/styles/autoblogger.css';
|
|
347
|
+
|
|
348
|
+
@tailwind base;
|
|
349
|
+
@tailwind components;
|
|
350
|
+
@tailwind utilities;
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
This provides:
|
|
354
|
+
- **Light and dark mode colors** — shadcn/ui Zinc theme tokens
|
|
355
|
+
- **Typography scale** — Consistent heading and body sizes
|
|
356
|
+
- **Prose styles** — Article content formatting (headings, paragraphs, lists, code, blockquotes)
|
|
357
|
+
- **Editor styles** — Tiptap focus states and placeholder styling
|
|
358
|
+
- **Animations** — Fade-in effects with reduced motion support
|
|
359
|
+
|
|
360
|
+
### Customizing
|
|
361
|
+
|
|
362
|
+
Override any CSS variable after the import:
|
|
363
|
+
|
|
364
|
+
```css
|
|
365
|
+
@import 'autoblogger/styles/autoblogger.css';
|
|
366
|
+
|
|
295
367
|
:root {
|
|
296
|
-
--
|
|
297
|
-
--foreground: 0 0% 3.9%;
|
|
298
|
-
--card: 0 0% 100%;
|
|
299
|
-
--card-foreground: 0 0% 3.9%;
|
|
300
|
-
--popover: 0 0% 100%;
|
|
301
|
-
--popover-foreground: 0 0% 3.9%;
|
|
302
|
-
--primary: 0 0% 9%;
|
|
303
|
-
--primary-foreground: 0 0% 98%;
|
|
304
|
-
--secondary: 0 0% 96.1%;
|
|
305
|
-
--secondary-foreground: 0 0% 9%;
|
|
306
|
-
--muted: 0 0% 96.1%;
|
|
307
|
-
--muted-foreground: 0 0% 45.1%;
|
|
308
|
-
--accent: 0 0% 96.1%;
|
|
309
|
-
--accent-foreground: 0 0% 9%;
|
|
310
|
-
--destructive: 0 84.2% 60.2%;
|
|
311
|
-
--destructive-foreground: 0 0% 98%;
|
|
312
|
-
--border: 0 0% 89.8%;
|
|
313
|
-
--input: 0 0% 89.8%;
|
|
314
|
-
--ring: 0 0% 3.9%;
|
|
368
|
+
--primary: 221 83% 53%; /* Custom blue primary */
|
|
315
369
|
}
|
|
370
|
+
```
|
|
316
371
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
--muted-foreground: 0 0% 63.9%;
|
|
330
|
-
--accent: 0 0% 14.9%;
|
|
331
|
-
--accent-foreground: 0 0% 98%;
|
|
332
|
-
--destructive: 0 62.8% 30.6%;
|
|
333
|
-
--destructive-foreground: 0 0% 98%;
|
|
334
|
-
--border: 0 0% 14.9%;
|
|
335
|
-
--input: 0 0% 14.9%;
|
|
336
|
-
--ring: 0 0% 83.1%;
|
|
337
|
-
}
|
|
372
|
+
Or pass custom styles when creating the CMS:
|
|
373
|
+
|
|
374
|
+
```typescript
|
|
375
|
+
// lib/cms.ts
|
|
376
|
+
export const cms = createAutoblogger({
|
|
377
|
+
// ... other config
|
|
378
|
+
styles: {
|
|
379
|
+
container: 'max-w-3xl mx-auto px-8',
|
|
380
|
+
title: 'text-4xl font-serif',
|
|
381
|
+
prose: 'prose prose-lg dark:prose-invert',
|
|
382
|
+
},
|
|
383
|
+
})
|
|
338
384
|
```
|
|
339
385
|
|
|
340
386
|
---
|
|
@@ -447,16 +493,52 @@ import { ARTICLE_STYLES } from 'autoblogger/styles/article'
|
|
|
447
493
|
|
|
448
494
|
---
|
|
449
495
|
|
|
496
|
+
## CLI Reference
|
|
497
|
+
|
|
498
|
+
Autoblogger includes a CLI for project setup and content management.
|
|
499
|
+
|
|
500
|
+
### Commands
|
|
501
|
+
|
|
502
|
+
| Command | Description |
|
|
503
|
+
|---------|-------------|
|
|
504
|
+
| `npx autoblogger init` | Set up Autoblogger in your Next.js project |
|
|
505
|
+
| `npx autoblogger import <path>` | Import markdown/MDX content into the database |
|
|
506
|
+
|
|
507
|
+
### Init Options
|
|
508
|
+
|
|
509
|
+
| Option | Description |
|
|
510
|
+
|--------|-------------|
|
|
511
|
+
| `--yes`, `-y` | Skip prompts and use defaults |
|
|
512
|
+
| `--skip-migrate` | Don't run database migration |
|
|
513
|
+
| `--import=<path>` | Import content from specified path after setup |
|
|
514
|
+
| `--dry-run` | Show what would be done without making changes |
|
|
515
|
+
|
|
516
|
+
### Import Options
|
|
517
|
+
|
|
518
|
+
| Option | Description |
|
|
519
|
+
|--------|-------------|
|
|
520
|
+
| `--status=<status>` | Set imported posts status (`draft` or `published`) |
|
|
521
|
+
| `--tag=<tag>` | Add a tag to all imported posts |
|
|
522
|
+
| `--dry-run` | Show what would be imported without making changes |
|
|
523
|
+
|
|
524
|
+
---
|
|
525
|
+
|
|
450
526
|
## AI Models
|
|
451
527
|
|
|
452
528
|
Autoblogger supports these AI models out of the box:
|
|
453
529
|
|
|
454
|
-
| ID | Name | Provider |
|
|
455
|
-
|
|
456
|
-
| `claude-sonnet` |
|
|
457
|
-
| `claude-opus` |
|
|
458
|
-
| `gpt-5.2` | GPT-5.2 | OpenAI |
|
|
459
|
-
| `gpt-5-mini` | GPT-5 Mini | OpenAI |
|
|
530
|
+
| ID | Name | Provider | Description |
|
|
531
|
+
|----|------|----------|-------------|
|
|
532
|
+
| `claude-sonnet` | Sonnet 4.5 | Anthropic | Fast, capable, best value |
|
|
533
|
+
| `claude-opus` | Opus 4.5 | Anthropic | Highest quality, slower |
|
|
534
|
+
| `gpt-5.2` | GPT-5.2 | OpenAI | Latest OpenAI flagship |
|
|
535
|
+
| `gpt-5-mini` | GPT-5 Mini | OpenAI | Fast and cost-efficient |
|
|
536
|
+
|
|
537
|
+
### AI Features
|
|
538
|
+
|
|
539
|
+
- **URL Context**: Paste a URL into your prompt and the AI will fetch and read the article content
|
|
540
|
+
- **Chat Modes**: Rewrite, expand, shorten, or chat freely with your content
|
|
541
|
+
- **Custom Prompts**: Configure prompt templates in **Settings → AI**
|
|
460
542
|
|
|
461
543
|
Configure the default model and custom prompts in the dashboard under **Settings → AI**.
|
|
462
544
|
|