diff --git a/README.md b/README.md index c958ca8..cfcd1c6 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,48 @@ -# Cook CLI Tool Setup Instructions - -Follow the steps below to set up and run the Cook CLI tool: - -1. **Create a virtual environment**: - ```bash - python3 -m venv env - ``` - -2. **Activate the virtual environment**: - - On Linux/macOS: - ```bash - source env/bin/activate - ``` - - On Windows: - ```bash - .\env\Scripts\activate - ``` - -3. **Install the required packages**: - ```bash - pip install -r requirements.txt - ``` - -4. **Run the main script**: - ```bash - python main.py - ``` - -You're all set to use the Cook CLI tool! +
+
+
A everyday CLI tool for you, like a swiss army knife? But for the developers.
+ +--- ++ + Cook - The All-in-One CLI for Lazy Devs. +
+ +**Cook** is a powerful, extensible CLI tool designed to streamline and automate everyday development tasks. Whether you're setting up a new project, managing boilerplate code, running repetitive commands, or tunneling a local server — Cook brings it all together in one elegant toolkit. Built for developers who prefer building over boilerplate, it helps you move faster with less setup and more shipping. + +## Features + +* **Code Snippet**: Store, reuse, and share code snippets both locally and publicly. Speed up your coding with ready-made solutions. + +* **Templates**: Save complete project structures or starting points and reuse them anytime. Great for scaffolding and standardization. + +* **Custom Commands**: Define CLI commands specific to a project or use them globally. Automate common tasks like builds, cleanup, deployments, etc. + +* **License Generator**: Instantly generate open-source licenses for your projects. + +* **API Key Manager**: Securely store, retrieve, and manage API tokens for local or cloud projects. + +* **Layers Concept**: Organize and group commands, templates, and snippets logically using layers (e.g., frontend, backend, utils). + +* **Hot Reload & Cleanup**: Reload changes and clean up project cruft from the CLI. + +* **Online Sharing**: Access and share templates, code snippets, and API keys through the platform with ease. + +* **Local UI Interface**: Manage your projects, snippets, and templates effortlessly with an intuitive local user interface. + +* **MCP Server & Integration**: Connect to MCP (Model Connect Protocol) servers for shared workflows, services, and discovery mechanisms. *(Coming soon)* + +* **Plugin System**: Extend Cook’s functionality with custom plugins for niche workflows. *(Coming soon)* + +* **More Coming Soon**: Stay tuned for more exciting features and updates in the future! + +--- + +## 👥 Who is it for? + +- **Solo developers** managing multiple side projects. +- **Teams** looking to standardize and reuse development workflows. +- **Open-source contributors** who need consistent project structure. +- **Anyone tired** of repeating the same boilerplate and setup tasks. diff --git a/assets/licenses/COOKTITLE (1).svg b/assets/licenses/COOKTITLE (1).svg new file mode 100644 index 0000000..7026f8e --- /dev/null +++ b/assets/licenses/COOKTITLE (1).svg @@ -0,0 +1,8 @@ + diff --git a/assets/licenses/COOKTITLE.png b/assets/licenses/COOKTITLE.png new file mode 100644 index 0000000..6f61a34 Binary files /dev/null and b/assets/licenses/COOKTITLE.png differ diff --git a/assets/licenses/COOKTITLE.svg b/assets/licenses/COOKTITLE.svg new file mode 100644 index 0000000..6d3072f --- /dev/null +++ b/assets/licenses/COOKTITLE.svg @@ -0,0 +1,7 @@ + diff --git a/cli/license.py b/cli/license.py index 095c09c..76e5bcf 100644 --- a/cli/license.py +++ b/cli/license.py @@ -1,12 +1,43 @@ import typer +from handlers.license.license import license_list +from handlers.license.license import listlicense from handlers.license import license +from typing_extensions import Annotated +from typing import Optional +from pathlib import Path +from handlers.pyprompt import Terminal +from handlers.utils import * + app = typer.Typer() +pyp = Terminal() + + + +@app.command ("list") +def list (): + listlicense() + + + -@app.command("make") -def license_make(): - return +@app.command("licensegen") +def licensegen( + licensename: Annotated[Optional[str], typer.Argument()] = None, + author: Annotated[Optional[str], typer.Argument()] = None, +): + + + + if licensename is None: + licensename = pyp.mcq(license_list, "Select a license") + if licensename == "none": + return +# Only reaches here if license is valid + pyp.show("Enter the name of the author.") + author = input() + diff --git a/handlers/license/license.py b/handlers/license/license.py index 2b9841f..0bf15a8 100644 --- a/handlers/license/license.py +++ b/handlers/license/license.py @@ -1,4 +1,39 @@ - +import os +from pathlib import Path +from handlers.pyprompt import Terminal +from datetime import datetime # https://github.com/itsmaxymoo/create-license # refer this repo to create the license command +pyp = Terminal + +path = Path("/home/akshat/TheAlphaOnes/Projects/COOK_Python/cook/assets/licenses") +license_list = [file.stem for file in path.glob("*.txt")] + +def listlicense(): + pyp.show_list("license", license_list) + + + +def licensegen(licensename, author): + + license_file = path / f"{licensename.lower()}.txt" + + + if not license_file.exists(): + raise FileNotFoundError(f"License '{licensename}' not found in {path}.") + + + with open(license_file, "r") as f: + content = f.read() + content = content.replace("[year]", str(datetime.now().year)).replace("[fullname]", author) + + with open(license_file, "r") as f: + content = f.read() + + with open("LICENSE", "w") as f: + f.write(content) + + print(f"{licensename.upper()} license added.") + + diff --git a/main.py b/main.py index 291f058..9bd0296 100644 --- a/main.py +++ b/main.py @@ -2,6 +2,7 @@ from typing import Optional,List from typing_extensions import Annotated +from cli import license as License from cli import cleanup as cook_cleanup from cli import stir as cook_stir from cli import ignite as cook_ignite @@ -12,7 +13,7 @@ from cli import auth as cook_auth from cli import slice as cook_slice from cli import mold -from handlers.loc import line_of_code +#from handlers.loc import line_of_code from handlers.pyprompt import Terminal from handlers import const import os @@ -28,7 +29,7 @@ app.add_typer(cook_auth.app,name="auth") app.add_typer(mold.app,name="mold") - +app.add_typer(License.app,name="license") # app.add_typer(cook_cleanup.app, name="cleanup") # app.add_typer(cook_stir.app, name= "stir") @@ -52,9 +53,9 @@ def ping(): pyp.high(const.COOK_BANNER) -@app.command("loc") -def loc(dir: Annotated[str, typer.Argument()] = ".",commands: Annotated[List[str], typer.Argument()] = None): - line_of_code(dir,commands) +# @app.command("loc") +# def loc(dir: Annotated[str, typer.Argument()] = ".",commands: Annotated[List[str], typer.Argument()] = None): +# line_of_code(dir,commands) @app.command("version") def version():