Skip to content

Commit 356b559

Browse files
committed
docs(packages): add npx installation examples to basic and research READMEs
- Update basic README with npx method - Update research README with npx method - Add comparison: CLI global vs npx - Show both methods in installation section - Pro tips for choosing best approach - Consistency across all READMEs Now all 4 main READMEs document npx workflow!
1 parent 1997607 commit 356b559

4 files changed

Lines changed: 67 additions & 24 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"@vibe-devtools/basic": patch
3+
"@vibe-devtools/research": patch
4+
---
5+
6+
Update installation documentation to include npx examples
7+
8+
- Add npx installation method alongside global CLI
9+
- Provide clear comparison: global vs npx
10+
- Show both methods in installation section
11+
- Add pro tips for choosing best method
12+
- Consistent with CLI and monorepo README updates
13+

apps/cli/src/installers/npm-installer.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export interface InstallResult {
2424

2525
function parseNpmSource(source: string): { packageName: string; version?: string } {
2626
const parts = source.split('@');
27-
27+
2828
if (source.startsWith('@')) {
2929
if (parts.length === 3) {
3030
return {
@@ -37,7 +37,7 @@ function parseNpmSource(source: string): { packageName: string; version?: string
3737
version: undefined
3838
};
3939
}
40-
40+
4141
return {
4242
packageName: parts[0],
4343
version: parts[1]
@@ -47,58 +47,58 @@ function parseNpmSource(source: string): { packageName: string; version?: string
4747
export async function installFromNpm(source: string): Promise<InstallResult> {
4848
const { packageName, version } = parseNpmSource(source);
4949
const packageSpec = version ? `${packageName}@${version}` : packageName;
50-
50+
5151
const cacheDir = path.join(getVibesHome(), 'cache', 'npm');
5252
await fs.mkdir(cacheDir, { recursive: true });
53-
53+
5454
const tempDir = path.join(cacheDir, `temp-${Date.now()}`);
5555
await fs.mkdir(tempDir, { recursive: true });
56-
56+
5757
try {
5858
const { stdout } = await execAsync(
5959
`npm pack ${packageSpec} --json`,
6060
{ cwd: tempDir }
6161
);
62-
62+
6363
const packResult = JSON.parse(stdout);
6464
const tarballFilename = packResult[0].filename;
65-
65+
6666
const extractDir = path.join(tempDir, 'extracted');
6767
await fs.mkdir(extractDir, { recursive: true });
68-
68+
6969
await execAsync(
7070
`tar -xzf ${tarballFilename} -C extracted`,
7171
{ cwd: tempDir }
7272
);
73-
73+
7474
const packageDir = path.join(extractDir, 'package');
7575
const vibeJsonPath = path.join(packageDir, 'vibe.json');
76-
76+
7777
if (!existsSync(vibeJsonPath)) {
7878
throw new Error(`Package ${packageName} is not a valid vibe (missing vibe.json)`);
7979
}
80-
80+
8181
const vibeJsonContent = await fs.readFile(vibeJsonPath, 'utf-8');
8282
const manifest = JSON.parse(vibeJsonContent) as VibeManifest;
83-
83+
8484
const installedPath = getVibePackageDir(manifest.name, manifest.version);
85-
85+
8686
if (existsSync(installedPath)) {
8787
await fs.rm(installedPath, { recursive: true, force: true });
8888
}
89-
89+
9090
await fs.mkdir(path.dirname(installedPath), { recursive: true });
9191
await fs.cp(packageDir, installedPath, { recursive: true });
92-
92+
9393
await fs.rm(tempDir, { recursive: true, force: true });
94-
94+
9595
return {
9696
manifest,
9797
installedPath
9898
};
99-
99+
100100
} catch (error) {
101-
await fs.rm(tempDir, { recursive: true, force: true }).catch(() => {});
101+
await fs.rm(tempDir, { recursive: true, force: true }).catch(() => { });
102102
throw new Error(`Failed to install from npm: ${(error as Error).message}`);
103103
}
104104
}

packages/basic/README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,18 +125,33 @@ Cursor/Copilot/Gemini
125125

126126
## 📦 Instalação
127127

128-
### Pré-requisito
128+
### Método 1: Via CLI Instalada (Recomendado)
129129

130130
```bash
131+
# 1. Instalar CLI globalmente
131132
npm install -g vibe-devtools
133+
134+
# 2. Instalar basic
135+
vdt install @vibe-devtools/basic
136+
137+
# 3. Pronto!
132138
```
133139

134-
### Instalar Basic
140+
### Método 2: Via npx (Zero Instalação) ⭐
135141

136142
```bash
137-
vdt install @vibe-devtools/basic
143+
# Instalar diretamente sem ter a CLI
144+
npx vibe-devtools install @vibe-devtools/basic
145+
146+
# Pronto! Sem pré-requisito de CLI global.
138147
```
139148

149+
### 🔥 Qual Escolher?
150+
151+
- **CLI Global**: Se vai usar vários vibes frequentemente
152+
- **npx**: Para experimentar ou instalação única
153+
- **Pro tip**: Use npx para testar, depois instale CLI se gostar
154+
140155
---
141156

142157
## ✨ O Que Você Ganha

packages/research/README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,33 @@ Este vibe foi criado usando **@vibe-devtools/basic**:
117117

118118
## 📦 Instalação
119119

120-
### Pré-requisito
120+
### Método 1: Via CLI Instalada (Recomendado)
121121

122122
```bash
123+
# 1. Instalar CLI globalmente
123124
npm install -g vibe-devtools
125+
126+
# 2. Instalar research
127+
vdt install @vibe-devtools/research
128+
129+
# 3. Pronto!
124130
```
125131

126-
### Instalar Research
132+
### Método 2: Via npx (Zero Instalação) ⭐
127133

128134
```bash
129-
vdt install @vibe-devtools/research
135+
# Instalar diretamente sem ter a CLI
136+
npx vibe-devtools install @vibe-devtools/research
137+
138+
# Pronto! Sem pré-requisito de CLI global.
130139
```
131140

141+
### 🔥 Qual Escolher?
142+
143+
- **CLI Global**: Se vai fazer várias pesquisas (recomendado)
144+
- **npx**: Para testar pipelines ou uso esporádico
145+
- **Pro tip**: Use npx para experimentar, depois instale CLI se gostar
146+
132147
---
133148

134149
## ✨ O Que Você Ganha

0 commit comments

Comments
 (0)