vibe-scaffold 0.1.0__tar.gz

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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 shenald-dev
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 OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,118 @@
1
+ Metadata-Version: 2.4
2
+ Name: vibe-scaffold
3
+ Version: 0.1.0
4
+ Summary: âœĻ Scaffold projects at the speed of thought. Minimalist, zero-config starter kits.
5
+ Author-email: Shenal Diluksha <shenald@users.noreply.github.com>
6
+ Maintainer-email: shenald-dev <shenald@users.noreply.github.com>
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/shenald-dev/vibe
9
+ Project-URL: Documentation, https://github.com/shenald-dev/vibe#readme
10
+ Project-URL: Repository, https://github.com/shenald-dev/vibe
11
+ Project-URL: Issues, https://github.com/shenald-dev/vibe/issues
12
+ Project-URL: Changelog, https://github.com/shenald-dev/vibe/blob/main/CHANGELOG.md
13
+ Keywords: vibe,scaffold,starter-kit,project-generator,fastapi,react,template,cli,tui
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Topic :: Software Development :: Code Generators
24
+ Classifier: Topic :: Utilities
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: typer>=0.9.0
29
+ Requires-Dist: rich>=13.7.0
30
+ Dynamic: license-file
31
+
32
+ <div align="center">
33
+ <img src="assets/logo.png" alt="vibe Logo" width="250" />
34
+
35
+ <br/>
36
+
37
+ <h1>âœĻ vibe</h1>
38
+ <p><b>Minimalist Project Scaffolding Engine</b></p>
39
+ <i>Scaffold projects at the speed of thought. Zero-config, beautiful starter kits.</i>
40
+
41
+ <br/>
42
+
43
+ [![PyPI version](https://img.shields.io/pypi/v/vibe-scaffold.svg)](https://pypi.org/project/vibe-scaffold/)
44
+ [![Python](https://img.shields.io/badge/Python-3.10%2B-blue.svg)](https://python.org)
45
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
46
+ </div>
47
+
48
+ ---
49
+
50
+ ## 📑 Table of Contents
51
+ - [🌟 Overview](#-overview)
52
+ - [🚀 Enterprise Features](#-enterprise-features)
53
+ - [⚡ Quick Start Guide](#-quick-start-guide)
54
+ - [ðŸ’ŧ Comprehensive Usage](#-comprehensive-usage)
55
+ - [ðŸĪ Contributing](#-contributing)
56
+
57
+ ---
58
+
59
+ ## 🌟 Overview
60
+
61
+ **vibe** is a blazing-fast project scaffolding CLI tool built to safeguard your flow state. Stop spending hours wiring up complex configurations before you even start coding. Just run a single command, choose a beautiful template, and start building.
62
+
63
+ ---
64
+
65
+ ## 🚀 Enterprise Features
66
+
67
+ - **ðŸŽĻ Beautiful TUI**: Built with `Typer` and `Rich` for a stunning visual experience directly in your terminal. No ugly text prompts.
68
+ - **⚡ Zero Config**: Generates projects with zero configuration needed. Eslint, Prettier, TypeScript, and Docker are automatically configured.
69
+ - **🚀 Instant Starters**: Generates full-stack `React`, `FastAPI`, or `Node` templates perfectly tuned for modern Vibe Coders.
70
+ - **ðŸŠķ Unopinionated Defaults**: Focuses entirely on lightweight, dependency-free architecture without pushing you into restrictive frameworks.
71
+
72
+ ---
73
+
74
+ ## ⚡ Quick Start Guide
75
+
76
+ ### Installation
77
+
78
+ Install directly via `pip`:
79
+ ```bash
80
+ pip install vibe-scaffold
81
+ ```
82
+
83
+ Or install via `pipx` or `uv`:
84
+ ```bash
85
+ pipx install vibe-scaffold
86
+ # or
87
+ uv tool install vibe-scaffold
88
+ ```
89
+
90
+ ---
91
+
92
+ ## ðŸ’ŧ Comprehensive Usage
93
+
94
+ ### Scaffold a New Project
95
+
96
+ Provide your project name and let the engine scaffold everything for you:
97
+ ```bash
98
+ vibe my-new-project
99
+ ```
100
+ *By default, this will use the react template.*
101
+
102
+ ### Use a Direct Template Flag
103
+ Provide the template flag to scaffold instantly in CI/CD pipelines:
104
+ ```bash
105
+ vibe api-service --template fastapi
106
+ vibe frontend-app --template react
107
+ ```
108
+
109
+ ---
110
+
111
+ ## ðŸĪ Contributing
112
+ Want to add a new beautiful template or improve the TUI? We'd love your help! 💖
113
+ - 🐛 **Found a bug?** Open an issue to let us know.
114
+ - âœĻ **Have a template idea?** We are open to PRs! Just make sure to run tests and keep the CLI vibrant.
115
+ - ðŸŽĻ **Documentation tweaks?** Always welcome!
116
+
117
+ ---
118
+ > *Built by a Vibe Coder. Let the flow begin.*
@@ -0,0 +1,87 @@
1
+ <div align="center">
2
+ <img src="assets/logo.png" alt="vibe Logo" width="250" />
3
+
4
+ <br/>
5
+
6
+ <h1>âœĻ vibe</h1>
7
+ <p><b>Minimalist Project Scaffolding Engine</b></p>
8
+ <i>Scaffold projects at the speed of thought. Zero-config, beautiful starter kits.</i>
9
+
10
+ <br/>
11
+
12
+ [![PyPI version](https://img.shields.io/pypi/v/vibe-scaffold.svg)](https://pypi.org/project/vibe-scaffold/)
13
+ [![Python](https://img.shields.io/badge/Python-3.10%2B-blue.svg)](https://python.org)
14
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
15
+ </div>
16
+
17
+ ---
18
+
19
+ ## 📑 Table of Contents
20
+ - [🌟 Overview](#-overview)
21
+ - [🚀 Enterprise Features](#-enterprise-features)
22
+ - [⚡ Quick Start Guide](#-quick-start-guide)
23
+ - [ðŸ’ŧ Comprehensive Usage](#-comprehensive-usage)
24
+ - [ðŸĪ Contributing](#-contributing)
25
+
26
+ ---
27
+
28
+ ## 🌟 Overview
29
+
30
+ **vibe** is a blazing-fast project scaffolding CLI tool built to safeguard your flow state. Stop spending hours wiring up complex configurations before you even start coding. Just run a single command, choose a beautiful template, and start building.
31
+
32
+ ---
33
+
34
+ ## 🚀 Enterprise Features
35
+
36
+ - **ðŸŽĻ Beautiful TUI**: Built with `Typer` and `Rich` for a stunning visual experience directly in your terminal. No ugly text prompts.
37
+ - **⚡ Zero Config**: Generates projects with zero configuration needed. Eslint, Prettier, TypeScript, and Docker are automatically configured.
38
+ - **🚀 Instant Starters**: Generates full-stack `React`, `FastAPI`, or `Node` templates perfectly tuned for modern Vibe Coders.
39
+ - **ðŸŠķ Unopinionated Defaults**: Focuses entirely on lightweight, dependency-free architecture without pushing you into restrictive frameworks.
40
+
41
+ ---
42
+
43
+ ## ⚡ Quick Start Guide
44
+
45
+ ### Installation
46
+
47
+ Install directly via `pip`:
48
+ ```bash
49
+ pip install vibe-scaffold
50
+ ```
51
+
52
+ Or install via `pipx` or `uv`:
53
+ ```bash
54
+ pipx install vibe-scaffold
55
+ # or
56
+ uv tool install vibe-scaffold
57
+ ```
58
+
59
+ ---
60
+
61
+ ## ðŸ’ŧ Comprehensive Usage
62
+
63
+ ### Scaffold a New Project
64
+
65
+ Provide your project name and let the engine scaffold everything for you:
66
+ ```bash
67
+ vibe my-new-project
68
+ ```
69
+ *By default, this will use the react template.*
70
+
71
+ ### Use a Direct Template Flag
72
+ Provide the template flag to scaffold instantly in CI/CD pipelines:
73
+ ```bash
74
+ vibe api-service --template fastapi
75
+ vibe frontend-app --template react
76
+ ```
77
+
78
+ ---
79
+
80
+ ## ðŸĪ Contributing
81
+ Want to add a new beautiful template or improve the TUI? We'd love your help! 💖
82
+ - 🐛 **Found a bug?** Open an issue to let us know.
83
+ - âœĻ **Have a template idea?** We are open to PRs! Just make sure to run tests and keep the CLI vibrant.
84
+ - ðŸŽĻ **Documentation tweaks?** Always welcome!
85
+
86
+ ---
87
+ > *Built by a Vibe Coder. Let the flow begin.*
@@ -0,0 +1,55 @@
1
+ [project]
2
+ name = "vibe-scaffold"
3
+ version = "0.1.0"
4
+ description = "âœĻ Scaffold projects at the speed of thought. Minimalist, zero-config starter kits."
5
+ readme = "README.md"
6
+ license = { text = "MIT" }
7
+ authors = [
8
+ { name = "Shenal Diluksha", email = "shenald@users.noreply.github.com" }
9
+ ]
10
+ maintainers = [
11
+ { name = "shenald-dev", email = "shenald@users.noreply.github.com" }
12
+ ]
13
+ requires-python = ">=3.10"
14
+ keywords = ["vibe", "scaffold", "starter-kit", "project-generator", "fastapi", "react", "template", "cli", "tui"]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Environment :: Console",
18
+ "Intended Audience :: Developers",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Operating System :: OS Independent",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3.10",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
+ "Topic :: Software Development :: Code Generators",
26
+ "Topic :: Utilities"
27
+ ]
28
+ dependencies = [
29
+ "typer>=0.9.0",
30
+ "rich>=13.7.0"
31
+ ]
32
+
33
+ [project.scripts]
34
+ vibe = "vibe.cli:app"
35
+
36
+ [project.urls]
37
+ Homepage = "https://github.com/shenald-dev/vibe"
38
+ Documentation = "https://github.com/shenald-dev/vibe#readme"
39
+ Repository = "https://github.com/shenald-dev/vibe"
40
+ Issues = "https://github.com/shenald-dev/vibe/issues"
41
+ Changelog = "https://github.com/shenald-dev/vibe/blob/main/CHANGELOG.md"
42
+
43
+ [build-system]
44
+ requires = ["setuptools>=61.0"]
45
+ build-backend = "setuptools.build_meta"
46
+
47
+ [tool.setuptools.packages.find]
48
+ where = ["src"]
49
+
50
+ [tool.pytest.ini_options]
51
+ testpaths = ["tests"]
52
+ pythonpath = ["src"]
53
+
54
+ [tool.vulture]
55
+ ignore_names = ["fastapi", "node", "create", "mock_sleep"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1 @@
1
+ """Vibe - Scaffold projects at the speed of thought."""
@@ -0,0 +1,81 @@
1
+ import time
2
+ import shlex
3
+ import typer
4
+ from enum import Enum
5
+ from rich.console import Console
6
+ from rich.markup import escape
7
+ from rich.panel import Panel
8
+ from rich.progress import Progress, SpinnerColumn, TextColumn
9
+
10
+
11
+ class TemplateChoice(str, Enum):
12
+ react = "react"
13
+ fastapi = "fastapi"
14
+ node = "node"
15
+
16
+
17
+ app = typer.Typer(help="âœĻ Scaffold projects at the speed of thought.")
18
+ console = Console()
19
+
20
+
21
+ @app.command()
22
+ def create(
23
+ name: str,
24
+ template: TemplateChoice = typer.Option(
25
+ TemplateChoice.react,
26
+ "--template",
27
+ "-t",
28
+ help="Template to use (react, fastapi, node)",
29
+ ),
30
+ ) -> None:
31
+ """Create a new project from a vibe template."""
32
+ name = name.strip()
33
+ if not name:
34
+ raise typer.BadParameter("Project name cannot be empty.")
35
+
36
+ if any(ord(c) < 32 or 127 <= ord(c) <= 159 for c in name):
37
+ msg = "Project name cannot contain control characters."
38
+ raise typer.BadParameter(msg)
39
+
40
+ escaped_name = escape(name)
41
+ escaped_template = escape(template.value)
42
+
43
+ title = "[bold cyan]âœĻ Generating Vibe Project:[/] "
44
+ title += f"[green]{escaped_name}[/]"
45
+ console.print(
46
+ Panel.fit(
47
+ title,
48
+ border_style="cyan",
49
+ )
50
+ )
51
+
52
+ try:
53
+ with Progress(
54
+ SpinnerColumn(spinner_name="dots2"),
55
+ TextColumn("[progress.description]{task.description}"),
56
+ transient=True,
57
+ ) as progress:
58
+ task_id = progress.add_task(
59
+ description="Downloading dependencies...", total=None
60
+ )
61
+ time.sleep(1)
62
+ desc = f"Scaffolding {escaped_template} structure..."
63
+ progress.update(task_id, description=desc)
64
+ time.sleep(1.5)
65
+ progress.update(task_id, description="Applying vibe aesthetic...")
66
+ time.sleep(0.5)
67
+ except KeyboardInterrupt:
68
+ console.print("\n[red]❌ Scaffolding aborted by user.[/red]")
69
+ raise typer.Exit(code=130)
70
+
71
+ msg = f"\n[bold green]✔[/] Project [cyan]{escaped_name}[/] created "
72
+ msg += f"successfully using the [yellow]{escaped_template}[/] template."
73
+ console.print(msg)
74
+ console.print("\n[bold]Next Steps:[/]")
75
+ console.print(f" [gray]$[/] cd {escape(shlex.quote(name))}")
76
+ console.print(" [gray]$[/] code .")
77
+ console.print("\n[magenta]Happy vibe coding! âœĻ[/]\n")
78
+
79
+
80
+ if __name__ == "__main__":
81
+ app()
@@ -0,0 +1,118 @@
1
+ Metadata-Version: 2.4
2
+ Name: vibe-scaffold
3
+ Version: 0.1.0
4
+ Summary: âœĻ Scaffold projects at the speed of thought. Minimalist, zero-config starter kits.
5
+ Author-email: Shenal Diluksha <shenald@users.noreply.github.com>
6
+ Maintainer-email: shenald-dev <shenald@users.noreply.github.com>
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/shenald-dev/vibe
9
+ Project-URL: Documentation, https://github.com/shenald-dev/vibe#readme
10
+ Project-URL: Repository, https://github.com/shenald-dev/vibe
11
+ Project-URL: Issues, https://github.com/shenald-dev/vibe/issues
12
+ Project-URL: Changelog, https://github.com/shenald-dev/vibe/blob/main/CHANGELOG.md
13
+ Keywords: vibe,scaffold,starter-kit,project-generator,fastapi,react,template,cli,tui
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Topic :: Software Development :: Code Generators
24
+ Classifier: Topic :: Utilities
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: typer>=0.9.0
29
+ Requires-Dist: rich>=13.7.0
30
+ Dynamic: license-file
31
+
32
+ <div align="center">
33
+ <img src="assets/logo.png" alt="vibe Logo" width="250" />
34
+
35
+ <br/>
36
+
37
+ <h1>âœĻ vibe</h1>
38
+ <p><b>Minimalist Project Scaffolding Engine</b></p>
39
+ <i>Scaffold projects at the speed of thought. Zero-config, beautiful starter kits.</i>
40
+
41
+ <br/>
42
+
43
+ [![PyPI version](https://img.shields.io/pypi/v/vibe-scaffold.svg)](https://pypi.org/project/vibe-scaffold/)
44
+ [![Python](https://img.shields.io/badge/Python-3.10%2B-blue.svg)](https://python.org)
45
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
46
+ </div>
47
+
48
+ ---
49
+
50
+ ## 📑 Table of Contents
51
+ - [🌟 Overview](#-overview)
52
+ - [🚀 Enterprise Features](#-enterprise-features)
53
+ - [⚡ Quick Start Guide](#-quick-start-guide)
54
+ - [ðŸ’ŧ Comprehensive Usage](#-comprehensive-usage)
55
+ - [ðŸĪ Contributing](#-contributing)
56
+
57
+ ---
58
+
59
+ ## 🌟 Overview
60
+
61
+ **vibe** is a blazing-fast project scaffolding CLI tool built to safeguard your flow state. Stop spending hours wiring up complex configurations before you even start coding. Just run a single command, choose a beautiful template, and start building.
62
+
63
+ ---
64
+
65
+ ## 🚀 Enterprise Features
66
+
67
+ - **ðŸŽĻ Beautiful TUI**: Built with `Typer` and `Rich` for a stunning visual experience directly in your terminal. No ugly text prompts.
68
+ - **⚡ Zero Config**: Generates projects with zero configuration needed. Eslint, Prettier, TypeScript, and Docker are automatically configured.
69
+ - **🚀 Instant Starters**: Generates full-stack `React`, `FastAPI`, or `Node` templates perfectly tuned for modern Vibe Coders.
70
+ - **ðŸŠķ Unopinionated Defaults**: Focuses entirely on lightweight, dependency-free architecture without pushing you into restrictive frameworks.
71
+
72
+ ---
73
+
74
+ ## ⚡ Quick Start Guide
75
+
76
+ ### Installation
77
+
78
+ Install directly via `pip`:
79
+ ```bash
80
+ pip install vibe-scaffold
81
+ ```
82
+
83
+ Or install via `pipx` or `uv`:
84
+ ```bash
85
+ pipx install vibe-scaffold
86
+ # or
87
+ uv tool install vibe-scaffold
88
+ ```
89
+
90
+ ---
91
+
92
+ ## ðŸ’ŧ Comprehensive Usage
93
+
94
+ ### Scaffold a New Project
95
+
96
+ Provide your project name and let the engine scaffold everything for you:
97
+ ```bash
98
+ vibe my-new-project
99
+ ```
100
+ *By default, this will use the react template.*
101
+
102
+ ### Use a Direct Template Flag
103
+ Provide the template flag to scaffold instantly in CI/CD pipelines:
104
+ ```bash
105
+ vibe api-service --template fastapi
106
+ vibe frontend-app --template react
107
+ ```
108
+
109
+ ---
110
+
111
+ ## ðŸĪ Contributing
112
+ Want to add a new beautiful template or improve the TUI? We'd love your help! 💖
113
+ - 🐛 **Found a bug?** Open an issue to let us know.
114
+ - âœĻ **Have a template idea?** We are open to PRs! Just make sure to run tests and keep the CLI vibrant.
115
+ - ðŸŽĻ **Documentation tweaks?** Always welcome!
116
+
117
+ ---
118
+ > *Built by a Vibe Coder. Let the flow begin.*
@@ -0,0 +1,12 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/vibe/__init__.py
5
+ src/vibe/cli.py
6
+ src/vibe_scaffold.egg-info/PKG-INFO
7
+ src/vibe_scaffold.egg-info/SOURCES.txt
8
+ src/vibe_scaffold.egg-info/dependency_links.txt
9
+ src/vibe_scaffold.egg-info/entry_points.txt
10
+ src/vibe_scaffold.egg-info/requires.txt
11
+ src/vibe_scaffold.egg-info/top_level.txt
12
+ tests/test_cli.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ vibe = vibe.cli:app
@@ -0,0 +1,2 @@
1
+ typer>=0.9.0
2
+ rich>=13.7.0
@@ -0,0 +1,183 @@
1
+ import pytest
2
+ from typer.testing import CliRunner
3
+ from vibe.cli import app
4
+
5
+ runner = CliRunner()
6
+
7
+
8
+ @pytest.fixture(autouse=True)
9
+ def mock_sleep(monkeypatch):
10
+ """Mock time.sleep to make tests run instantly."""
11
+ import time
12
+
13
+ monkeypatch.setattr(time, "sleep", lambda _: None)
14
+
15
+
16
+ def test_create_default_template():
17
+ result = runner.invoke(app, ["myproject"])
18
+ assert result.exit_code == 0
19
+ assert "Generating Vibe Project:" in result.output
20
+ assert "myproject" in result.output
21
+ assert "created successfully using the react template" in result.output
22
+
23
+
24
+ def test_create_uppercase_template():
25
+ result = runner.invoke(app, ["myproject", "--template", "REACT"])
26
+ assert result.exit_code != 0
27
+ assert "Invalid value for '--template'" in result.output
28
+
29
+
30
+ def test_create_ansi_escape_injection():
31
+ result = runner.invoke(app, ["\033[2J\033[Hcleared"])
32
+ assert result.exit_code != 0
33
+ assert "Project name cannot contain control characters." in result.output
34
+
35
+
36
+ def test_create_control_characters():
37
+ result = runner.invoke(app, ["my\x07project"])
38
+ assert result.exit_code != 0
39
+ assert "Project name cannot contain control characters." in result.output
40
+
41
+
42
+ def test_create_del_control_character():
43
+ result = runner.invoke(app, ["my\x7fproject"])
44
+ assert result.exit_code != 0
45
+ assert "Project name cannot contain control characters." in result.output
46
+
47
+
48
+ def test_create_cd_command_escaping_single_quote():
49
+ result = runner.invoke(app, ["my'[red]project"])
50
+ assert result.exit_code == 0
51
+ assert "cd 'my'\"'\"'[red]project'" in result.output
52
+
53
+
54
+ def test_create_cd_command_escaping():
55
+ result = runner.invoke(app, ["my new project"])
56
+ assert result.exit_code == 0
57
+ assert "cd 'my new project'" in result.output
58
+
59
+
60
+ def test_create_name_with_spaces_in_middle():
61
+ result = runner.invoke(app, ["my new project"])
62
+ assert result.exit_code == 0
63
+ assert "Generating Vibe Project: my new project" in result.output
64
+ assert (
65
+ "Project my new project created successfully using the react template"
66
+ in result.output
67
+ )
68
+
69
+
70
+ def test_create_unexpected_extra_arguments():
71
+ result = runner.invoke(app, ["create", "my-new-project"])
72
+ assert result.exit_code != 0
73
+ assert "Got unexpected extra argument" in result.output
74
+
75
+
76
+ def test_create_name_with_whitespace():
77
+ result = runner.invoke(app, [" myproject "])
78
+ assert result.exit_code == 0
79
+ assert "Generating Vibe Project: myproject" in result.output
80
+ assert (
81
+ "Project myproject created successfully using the react template"
82
+ in result.output
83
+ )
84
+
85
+
86
+ def test_create_custom_template():
87
+ result = runner.invoke(app, ["myapi", "--template", "fastapi"])
88
+ assert result.exit_code == 0
89
+ assert "Generating Vibe Project:" in result.output
90
+ assert "myapi" in result.output
91
+ assert "created successfully using the fastapi template" in result.output
92
+
93
+
94
+ def test_create_escape_rich_markup_injection():
95
+ result = runner.invoke(app, ["[red]myproject[/red]"])
96
+ assert result.exit_code == 0
97
+ assert "Generating Vibe Project: [red]myproject[/red]" in result.output
98
+ assert (
99
+ "Project [red]myproject[/red] created successfully "
100
+ "using the react template" in result.output
101
+ )
102
+
103
+
104
+ def test_create_invalid_template():
105
+ result = runner.invoke(app, ["myapi", "--template", "invalid"])
106
+ assert result.exit_code != 0
107
+ assert "Invalid value for '--template'" in result.output
108
+
109
+
110
+ def test_create_missing_name_argument():
111
+ result = runner.invoke(app, [])
112
+ assert result.exit_code != 0
113
+ assert "Missing argument 'name'" in result.output
114
+
115
+
116
+ def test_create_node_template():
117
+ result = runner.invoke(app, ["mynodeapp", "--template", "node"])
118
+ assert result.exit_code == 0
119
+ assert "Generating Vibe Project:" in result.output
120
+ assert "mynodeapp" in result.output
121
+ assert "created successfully using the node template" in result.output
122
+
123
+
124
+ def test_help_flag():
125
+ result = runner.invoke(app, ["--help"])
126
+ assert result.exit_code == 0
127
+ assert "Create a new project from a vibe template." in result.output
128
+ assert "--template" in result.output
129
+
130
+
131
+ def test_create_empty_name_argument():
132
+ result = runner.invoke(app, [" "])
133
+ assert result.exit_code != 0
134
+ assert "Project name cannot be empty." in result.output
135
+
136
+
137
+ def test_create_exact_empty_string_name_argument():
138
+ result = runner.invoke(app, [""])
139
+ assert result.exit_code != 0
140
+ assert "Project name cannot be empty." in result.output
141
+
142
+
143
+ def test_create_name_with_newlines_and_tabs():
144
+ result = runner.invoke(app, ["\n\t \n"])
145
+ assert result.exit_code != 0
146
+ assert "Project name cannot be empty." in result.output
147
+
148
+
149
+ def test_create_short_template_flag():
150
+ result = runner.invoke(app, ["myproject", "-t", "react"])
151
+ assert result.exit_code == 0
152
+ assert "Generating Vibe Project:" in result.output
153
+ assert "myproject" in result.output
154
+ assert "created successfully using the react template" in result.output
155
+
156
+
157
+ def test_create_keyboard_interrupt(monkeypatch):
158
+ def mock_sleep_interrupt(_):
159
+ raise KeyboardInterrupt()
160
+
161
+ import time
162
+
163
+ monkeypatch.setattr(time, "sleep", mock_sleep_interrupt)
164
+
165
+ result = runner.invoke(app, ["myproject"])
166
+ assert result.exit_code == 130
167
+ assert "Scaffolding aborted by user." in result.output
168
+
169
+
170
+ def test_create_c1_control_character_injection():
171
+ result = runner.invoke(app, ["\x9b2J\x9bHcleared"])
172
+ assert result.exit_code != 0
173
+ assert "Project name cannot contain control characters." in result.output
174
+
175
+
176
+ def test_create_name_starting_with_dash():
177
+ result = runner.invoke(app, ["--", "-myproject"])
178
+ assert result.exit_code == 0
179
+ assert "Generating Vibe Project: -myproject" in result.output
180
+ assert (
181
+ "Project -myproject created successfully using the react template"
182
+ in result.output
183
+ )