From e852336d7e2ce11ee89a4af6e313a70eed019cbd Mon Sep 17 00:00:00 2001
From: akshat227
Date: Sun, 15 Jun 2025 19:07:08 +0530
Subject: [PATCH 01/34] licensing added
---
cli/license.py | 37 ++++++++++++++++++++++++++++++++++---
handlers/license/license.py | 37 ++++++++++++++++++++++++++++++++++++-
main.py | 11 ++++++-----
3 files changed, 76 insertions(+), 9 deletions(-)
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():
From 29b3edd1e79c11ca525eb6a47c5680c13e11b0ed Mon Sep 17 00:00:00 2001
From: Akshat
Date: Mon, 16 Jun 2025 15:29:03 +0530
Subject: [PATCH 02/34] Update README.md
---
README.md | 36 ++++++++++--------------------------
1 file changed, 10 insertions(+), 26 deletions(-)
diff --git a/README.md b/README.md
index c958ca8..725585b 100644
--- a/README.md
+++ b/README.md
@@ -1,30 +1,14 @@
-# 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
- ```
+
Typer, build great CLIs. Easy to code. Based on Python type hints.
-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
From fb1d89f0d98e6c8b85572d36be39f704d29f4a55 Mon Sep 17 00:00:00 2001
From: Akshat
Date: Mon, 16 Jun 2025 20:24:47 +0530
Subject: [PATCH 26/34] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 29b9e05..6463110 100644
--- a/README.md
+++ b/README.md
@@ -6,4 +6,4 @@
---
-### Cook - The All-in-One CLI for Lazy Devs
+### Cook - The All-in-One CLI for Lazy Devs.
From 7a705463533137c6d8a42b702df455718f81a1b7 Mon Sep 17 00:00:00 2001
From: Akshat
Date: Mon, 16 Jun 2025 20:25:30 +0530
Subject: [PATCH 27/34] Update README.md
---
README.md | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 6463110..3f73793 100644
--- a/README.md
+++ b/README.md
@@ -6,4 +6,6 @@
---
-### Cook - The All-in-One CLI for Lazy Devs.
+### 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.
From cf18b410ac1cda83bcce7f63ebf7cbff4c3b9381 Mon Sep 17 00:00:00 2001
From: Akshat
Date: Mon, 16 Jun 2025 20:27:54 +0530
Subject: [PATCH 28/34] Update README.md
---
README.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/README.md b/README.md
index 3f73793..b341dfd 100644
--- a/README.md
+++ b/README.md
@@ -9,3 +9,7 @@
### 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.
+
+### Key Features:
+* **Code Snippet**: Store, reuse, and share code snippets both locally and publicly. Speed up your coding with ready-made solutions.
+
From abea92f6aa864a9229de4d877033bd8decb2b7b9 Mon Sep 17 00:00:00 2001
From: Akshat
Date: Mon, 16 Jun 2025 20:37:03 +0530
Subject: [PATCH 29/34] Update README.md
---
README.md | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index b341dfd..7b191ae 100644
--- a/README.md
+++ b/README.md
@@ -10,6 +10,29 @@
**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.
-### Key Features:
+## 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!
+
From 8ad89f96f92c454270fb918adc9b6d7669849a0a Mon Sep 17 00:00:00 2001
From: Akshat
Date: Mon, 16 Jun 2025 20:40:18 +0530
Subject: [PATCH 30/34] Update README.md
---
README.md | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/README.md b/README.md
index 7b191ae..b10cffe 100644
--- a/README.md
+++ b/README.md
@@ -36,3 +36,11 @@
* **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.
From d0cfabc2a3812da9394da88ab8ea44791698a3a6 Mon Sep 17 00:00:00 2001
From: Akshat
Date: Sat, 21 Jun 2025 19:29:57 +0530
Subject: [PATCH 31/34] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index b10cffe..2ce7d61 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-
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.
From 7a7b4a75720bf1bda02e1b60262519ab7c983cf8 Mon Sep 17 00:00:00 2001
From: Akshat
Date: Sat, 21 Jun 2025 19:32:17 +0530
Subject: [PATCH 34/34] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index ab68c0e..cfcd1c6 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@
---
-### Cook - The All-in-One CLI for Lazy Devs.
+ 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.