cnippet-stack 0.0.0 → 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 cnippet
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 OF ANY OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,64 @@
1
+ # cnippet-stack
2
+
3
+ Install full integrations — auth, database, payments, email, storage — into your **existing** Next.js app in minutes.
4
+
5
+ ```bash
6
+ npx cnippet-stack init better-auth
7
+ ```
8
+
9
+ Unlike boilerplates you fork or greenfield generators, cnippet-stack injects working integrations into the project you already have. It detects your setup (App Router, `src/` dir, package manager, ORM, path aliases), asks only the questions it can't answer itself, and writes production-quality code with safe merge strategies — never blindly overwriting your files.
10
+
11
+ ## How it works
12
+
13
+ 1. **Detects** your project: Next.js version, router, TypeScript, package manager, Prisma, aliases — all read statically, nothing executed.
14
+ 2. **Asks** a few questions (e.g. which OAuth providers) — everything detectable is never prompted.
15
+ 3. **Plans** the install and shows you a full diff preview before touching anything.
16
+ 4. **Applies** files with per-file strategies: `create` (fails if the file exists), `append` (idempotent, markered blocks — e.g. Prisma schema models), and AST-based injection (e.g. wrapping a provider in your `layout.tsx`).
17
+ 5. **Finishes** the plumbing: appends env placeholders (auto-generating secrets), installs dependencies with your package manager, runs post-install commands, and lists the manual steps no CLI can do for you (like OAuth console setup).
18
+
19
+ Backups of every modified file are kept in `.cnippet/backup/<timestamp>/`.
20
+
21
+ ## Commands
22
+
23
+ | Command | Description |
24
+ |---|---|
25
+ | `npx cnippet-stack init <recipe>` | Install a recipe into the current project |
26
+ | `npx cnippet-stack list` | List available recipes |
27
+ | `npx cnippet-stack login` | Log in (required for pro recipes) |
28
+ | `npx cnippet-stack logout` | Log out and revoke this device's token |
29
+ | `npx cnippet-stack whoami` | Show the logged-in user |
30
+
31
+ ### Useful flags for `init`
32
+
33
+ | Flag | Effect |
34
+ |---|---|
35
+ | `--dry-run` | Show the full install plan without writing anything |
36
+ | `--yes` | Skip prompts and confirmation, use recipe defaults |
37
+ | `--overwrite` | Allow overwriting files that already exist |
38
+ | `--cwd <path>` | Install into a different directory |
39
+ | `--json` | Machine-readable output (for scripts and AI agents), answers via `--answers '<json>'` |
40
+
41
+ ## Recipes
42
+
43
+ Recipes are versioned, Zod-validated manifests rendered server-side by the registry — browse them at [stack.cnippet.dev/recipes](https://stack.cnippet.dev/recipes). Free recipes need no account; pro recipes require `cnippet-stack login` and a license.
44
+
45
+ Current lineup includes `better-auth` (email/password + OAuth, Prisma models, middleware, starter UI), `prisma`, `biome`, and more shipping continuously — no CLI update needed when recipes are added or improved.
46
+
47
+ ## Requirements
48
+
49
+ - Node.js 18+
50
+ - A Next.js project using the App Router
51
+
52
+ ## Telemetry
53
+
54
+ The CLI sends anonymous install events (recipe name, version, success, duration). Opt out with `CNIPPET_TELEMETRY=0`.
55
+
56
+ ## Ecosystem
57
+
58
+ - [stack.cnippet.dev](https://stack.cnippet.dev) — recipe browser, dashboard, licensing
59
+ - [next.cnippet.dev](https://next.cnippet.dev) — in-depth written integration guides
60
+ - [ui.cnippet.dev](https://ui.cnippet.dev) — component library
61
+
62
+ ## License
63
+
64
+ MIT — see [LICENSE](https://github.com/cnippet-dev/cnippet-stack/blob/main/packages/cli/LICENSE). Recipe templates are rendered by the registry service and are subject to their own tiers/terms.
package/dist/index.js CHANGED
@@ -11729,7 +11729,7 @@ ${pc7.bold("Manual steps:")}`);
11729
11729
  }
11730
11730
  function createProgram() {
11731
11731
  const program = new Command();
11732
- program.name("cnippet-stack").description("Integration installer for Next.js apps.").version("0.0.0");
11732
+ program.name("cnippet-stack").description("Integration installer for Next.js apps.").version(cliVersion());
11733
11733
  program.command("init <recipe>").description("Install a recipe into the current project.").option("--cwd <path>", "Project directory to install into.", process.cwd()).option(
11734
11734
  "--dry-run",
11735
11735
  "Show the install plan without writing anything.",
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
+ "author": "cnippet <cnippet.dev@gmail.com>",
2
3
  "bin": {
3
4
  "cnippet-stack": "./dist/index.js"
4
5
  },
6
+ "bugs": "https://github.com/cnippet-dev/cnippet-stack/issues",
7
+ "description": "CLI that installs full integrations (auth, payments, email, storage) into your existing Next.js app — detection, prompts, safe file injection, env setup.",
5
8
  "dependencies": {
6
9
  "@clack/prompts": "^0.10.0",
7
10
  "commander": "^13.1.0",
@@ -28,12 +31,28 @@
28
31
  "files": [
29
32
  "dist"
30
33
  ],
34
+ "homepage": "https://stack.cnippet.dev",
35
+ "keywords": [
36
+ "nextjs",
37
+ "cli",
38
+ "integrations",
39
+ "installer",
40
+ "scaffold",
41
+ "better-auth",
42
+ "prisma",
43
+ "cnippet"
44
+ ],
31
45
  "license": "MIT",
32
46
  "main": "./dist/index.js",
33
47
  "name": "cnippet-stack",
34
48
  "publishConfig": {
35
49
  "access": "public"
36
50
  },
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "git+https://github.com/cnippet-dev/cnippet-stack.git",
54
+ "directory": "packages/cli"
55
+ },
37
56
  "scripts": {
38
57
  "build": "tsup",
39
58
  "check-types": "tsc --noEmit",
@@ -43,5 +62,5 @@
43
62
  },
44
63
  "type": "module",
45
64
  "types": "./dist/index.d.ts",
46
- "version": "0.0.0"
65
+ "version": "0.1.0"
47
66
  }