autoblogger 0.2.12 → 0.2.14
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 +13 -141
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,54 +11,13 @@ In the age of AI and SEO, the blogs that win are the ones that publish consisten
|
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
## 🚀 Quickstart
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
# Install
|
|
18
|
-
npm install autoblogger
|
|
19
|
-
|
|
20
|
-
# Initialize (auto-configures everything)
|
|
21
|
-
npx autoblogger init
|
|
22
|
-
|
|
23
|
-
# Add your AI key to .env
|
|
24
|
-
ANTHROPIC_API_KEY="sk-ant-..."
|
|
25
|
-
|
|
26
|
-
# Start your app and visit /writer
|
|
27
|
-
npm run dev
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
That's it. You're ready to write.
|
|
31
|
-
|
|
32
|
-
📖 **[Full Setup Guide →](docs/GUIDE.md)**
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
14
|
## Why Autoblogger?
|
|
37
15
|
|
|
38
|
-
|
|
16
|
+
The game has changed. AI-generated content is everywhere. SEO rewards fresh, frequent publishing. You need to write fast.
|
|
39
17
|
|
|
40
|
-
**
|
|
18
|
+
**Before:** Open CMS. Open ChatGPT. Copy. Paste. Format. Fix formatting. Publish. *2 hours later...*
|
|
41
19
|
|
|
42
|
-
|
|
43
|
-
|---------|------------------|
|
|
44
|
-
| Open CMS → Open ChatGPT → Copy-paste → Format → Publish | Type idea → AI writes → Edit → Publish |
|
|
45
|
-
| 2 hours per post | 15 minutes per post |
|
|
46
|
-
| "I should write more..." | Actually writing more |
|
|
47
|
-
| Content calendar anxiety | Content machine confidence |
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## ⚡ How It Works
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
You: "Write about why morning routines are overrated"
|
|
55
|
-
|
|
56
|
-
Autoblogger: *generates a 500-word essay with title, subtitle, and body*
|
|
57
|
-
|
|
58
|
-
You: *tweak the intro, hit publish*
|
|
59
|
-
|
|
60
|
-
Done.
|
|
61
|
-
```
|
|
20
|
+
**After:** Type your idea. AI writes. You tweak. Publish. *Done in 15 minutes.*
|
|
62
21
|
|
|
63
22
|
---
|
|
64
23
|
|
|
@@ -94,97 +53,22 @@ Done.
|
|
|
94
53
|
|
|
95
54
|
---
|
|
96
55
|
|
|
97
|
-
##
|
|
98
|
-
|
|
99
|
-
```typescript
|
|
100
|
-
// lib/cms.ts
|
|
101
|
-
import { createAutoblogger } from 'autoblogger'
|
|
102
|
-
import { prisma } from '@/lib/db'
|
|
103
|
-
import { auth } from '@/lib/auth'
|
|
104
|
-
|
|
105
|
-
export const cms = createAutoblogger({
|
|
106
|
-
prisma,
|
|
107
|
-
auth: {
|
|
108
|
-
getSession: () => auth(),
|
|
109
|
-
isAdmin: (session) => session?.user?.role === 'admin',
|
|
110
|
-
canPublish: (session) => ['admin', 'writer'].includes(session?.user?.role ?? ''),
|
|
111
|
-
},
|
|
112
|
-
ai: {
|
|
113
|
-
anthropicKey: process.env.ANTHROPIC_API_KEY,
|
|
114
|
-
openaiKey: process.env.OPENAI_API_KEY,
|
|
115
|
-
},
|
|
116
|
-
})
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
📖 **[See all configuration options →](docs/GUIDE.md#configuration-options)**
|
|
120
|
-
|
|
121
|
-
---
|
|
122
|
-
|
|
123
|
-
## Display Your Posts
|
|
124
|
-
|
|
125
|
-
```typescript
|
|
126
|
-
// app/blog/page.tsx
|
|
127
|
-
import { cms } from '@/lib/cms'
|
|
128
|
-
|
|
129
|
-
export default async function BlogPage() {
|
|
130
|
-
const posts = await cms.posts.findPublished()
|
|
131
|
-
|
|
132
|
-
return (
|
|
133
|
-
<ul>
|
|
134
|
-
{posts.map(post => (
|
|
135
|
-
<li key={post.id}>
|
|
136
|
-
<a href={`/blog/${post.slug}`}>{post.title}</a>
|
|
137
|
-
</li>
|
|
138
|
-
))}
|
|
139
|
-
</ul>
|
|
140
|
-
)
|
|
141
|
-
}
|
|
142
|
-
```
|
|
56
|
+
## Quickstart
|
|
143
57
|
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
import { renderMarkdown } from 'autoblogger/markdown'
|
|
148
|
-
import { notFound } from 'next/navigation'
|
|
149
|
-
|
|
150
|
-
export default async function PostPage({ params }: { params: Promise<{ slug: string }> }) {
|
|
151
|
-
const { slug } = await params
|
|
152
|
-
const post = await cms.posts.findBySlug(slug)
|
|
153
|
-
|
|
154
|
-
if (!post || post.status !== 'published') notFound()
|
|
155
|
-
|
|
156
|
-
return (
|
|
157
|
-
<article>
|
|
158
|
-
<h1>{post.title}</h1>
|
|
159
|
-
<div dangerouslySetInnerHTML={{ __html: renderMarkdown(post.markdown) }} />
|
|
160
|
-
</article>
|
|
161
|
-
)
|
|
162
|
-
}
|
|
58
|
+
```bash
|
|
59
|
+
npm install autoblogger
|
|
60
|
+
npx autoblogger init
|
|
163
61
|
```
|
|
164
62
|
|
|
165
|
-
|
|
63
|
+
Add your AI key to `.env`:
|
|
166
64
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
Publish once, sync everywhere:
|
|
170
|
-
|
|
171
|
-
```typescript
|
|
172
|
-
export const cms = createAutoblogger({
|
|
173
|
-
// Built-in Prismic support
|
|
174
|
-
prismic: {
|
|
175
|
-
repository: 'your-repo',
|
|
176
|
-
writeToken: process.env.PRISMIC_WRITE_TOKEN,
|
|
177
|
-
},
|
|
178
|
-
|
|
179
|
-
// Or custom destinations
|
|
180
|
-
destinations: [myContentfulAdapter, mySanityAdapter],
|
|
181
|
-
|
|
182
|
-
// Or webhooks
|
|
183
|
-
webhooks: ['https://api.example.com/cms-webhook'],
|
|
184
|
-
})
|
|
65
|
+
```env
|
|
66
|
+
ANTHROPIC_API_KEY="sk-ant-..."
|
|
185
67
|
```
|
|
186
68
|
|
|
187
|
-
|
|
69
|
+
Start your app and visit `/writer`. That's it.
|
|
70
|
+
|
|
71
|
+
📖 **[Full Setup Guide →](docs/GUIDE.md)**
|
|
188
72
|
|
|
189
73
|
---
|
|
190
74
|
|
|
@@ -196,18 +80,6 @@ export const cms = createAutoblogger({
|
|
|
196
80
|
|
|
197
81
|
---
|
|
198
82
|
|
|
199
|
-
## Keyboard Shortcuts
|
|
200
|
-
|
|
201
|
-
| Shortcut | Action |
|
|
202
|
-
|----------|--------|
|
|
203
|
-
| `⌘K` | Open chat |
|
|
204
|
-
| `⌘⇧A` | Toggle Ask/Agent mode |
|
|
205
|
-
| `⌘S` | Save |
|
|
206
|
-
| `⌘.` | Toggle theme |
|
|
207
|
-
| `Esc` | Go back / Stop generation |
|
|
208
|
-
|
|
209
|
-
---
|
|
210
|
-
|
|
211
83
|
## Documentation
|
|
212
84
|
|
|
213
85
|
- 📖 **[Full Setup Guide](docs/GUIDE.md)** — Complete installation and configuration
|