mikasa-cli 1.0.4 → 1.0.5
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 +20 -0
- package/package.json +1 -1
- package/src/lib/db.js +30 -4
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Mikasa CLI 🌸
|
|
2
|
+
|
|
3
|
+
Mikasa CLI is an AI-powered command-line tool that lets you chat with AI, manage authentication via GitHub, and interact with smart agents directly from your terminal.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## ✨ Features
|
|
8
|
+
|
|
9
|
+
- 🔐 GitHub login using Device Authorization Flow
|
|
10
|
+
- 🤖 AI chat (tool / agent based)
|
|
11
|
+
- 💾 Persistent login session
|
|
12
|
+
- ⚡ Fast and interactive CLI experience
|
|
13
|
+
- 🧠 Built with Better Auth + Prisma
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 📦 Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install -g mikasa-cli
|
package/package.json
CHANGED
package/src/lib/db.js
CHANGED
|
@@ -1,9 +1,35 @@
|
|
|
1
|
-
import { PrismaClient } from '@prisma/client';
|
|
1
|
+
// import { PrismaClient } from '@prisma/client';
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
// const globalForPrisma = global;
|
|
5
|
+
// const prisma = new PrismaClient();
|
|
6
|
+
|
|
7
|
+
// if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma;
|
|
8
|
+
|
|
9
|
+
// export default prisma;
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
import { PrismaClient } from "@prisma/client";
|
|
13
|
+
|
|
14
|
+
// ⚠️ HARD-CODED DATABASE URL (NOT SAFE FOR PUBLIC NPM PACKAGES)
|
|
15
|
+
const DATABASE_URL =
|
|
16
|
+
"postgresql://USERNAME:PASSWORD@HOST:5432/DATABASE?schema=public";
|
|
17
|
+
|
|
18
|
+
// Reuse Prisma client in dev (to avoid multiple instances)
|
|
4
19
|
const globalForPrisma = global;
|
|
5
|
-
const prisma = new PrismaClient();
|
|
6
20
|
|
|
7
|
-
|
|
21
|
+
const prisma =
|
|
22
|
+
globalForPrisma.prisma ??
|
|
23
|
+
new PrismaClient({
|
|
24
|
+
datasources: {
|
|
25
|
+
db: {
|
|
26
|
+
url: DATABASE_URL, // 👈 overrides env("DATABASE_URL")
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
if (process.env.NODE_ENV !== "production") {
|
|
32
|
+
globalForPrisma.prisma = prisma;
|
|
33
|
+
}
|
|
8
34
|
|
|
9
|
-
export default prisma;
|
|
35
|
+
export default prisma;
|