cheat-cli 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.
File without changes
@@ -0,0 +1,33 @@
1
+ Metadata-Version: 2.4
2
+ Name: cheat-cli
3
+ Version: 0.1.0
4
+ Summary: A terminal-first cheat sheet CLI for Linux developers
5
+ Author-email: RejishJ <rejish.j.d@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/RejishJ/cheat-cli
8
+ Project-URL: Repository, https://github.com/RejishJ/cheat-cli
9
+ Requires-Python: >=3.8
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Requires-Dist: pandas
13
+ Requires-Dist: tabulate
14
+ Dynamic: license-file
15
+
16
+ # cheat-cli
17
+
18
+ A terminal-first cheat sheet for Linux developers.
19
+
20
+ ## Why
21
+ I built this to stop Googling the same commands repeatedly.
22
+ It lives in the terminal and grows with your workflow.
23
+
24
+ ## Features
25
+ - Fast search
26
+ - Interactive add
27
+ - Safe delete with confirmation
28
+ - Clean table output
29
+ - pip installable
30
+
31
+ ## Install
32
+ ```bash
33
+ pip install cheat-cli
@@ -0,0 +1,18 @@
1
+ # cheat-cli
2
+
3
+ A terminal-first cheat sheet for Linux developers.
4
+
5
+ ## Why
6
+ I built this to stop Googling the same commands repeatedly.
7
+ It lives in the terminal and grows with your workflow.
8
+
9
+ ## Features
10
+ - Fast search
11
+ - Interactive add
12
+ - Safe delete with confirmation
13
+ - Clean table output
14
+ - pip installable
15
+
16
+ ## Install
17
+ ```bash
18
+ pip install cheat-cli
File without changes
@@ -0,0 +1,87 @@
1
+ #!/usr/bin/env python3
2
+
3
+ import sys
4
+ import pandas as pd
5
+ from tabulate import tabulate
6
+ from importlib.resources import files
7
+
8
+ # ---------- Helpers ----------
9
+
10
+ def csv_path():
11
+ return files("cheat_cli").joinpath("data/commands.csv")
12
+
13
+ def load_df():
14
+ return pd.read_csv(csv_path())
15
+
16
+ def save_df(df):
17
+ df.to_csv(csv_path(), index=False)
18
+
19
+ def print_table(df):
20
+ if df.empty:
21
+ print("\033[91mNo results found.\033[0m")
22
+ return
23
+ print(tabulate(df, headers="keys", tablefmt="fancy_grid", showindex=False))
24
+
25
+ # ---------- Core Features ----------
26
+
27
+ def search(df, term):
28
+ term = term.lower()
29
+ mask = (
30
+ df["tool"].str.lower().str.contains(term) |
31
+ df["command"].str.lower().str.contains(term) |
32
+ df["description"].str.lower().str.contains(term) |
33
+ df["tags"].str.lower().str.contains(term)
34
+ )
35
+ print_table(df[mask])
36
+
37
+ def add_interactive(df):
38
+ print("\033[94mInteractive add mode\033[0m")
39
+ tool = input("Tool: ").strip()
40
+ command = input("Command: ").strip()
41
+ description = input("Description: ").strip()
42
+ tags = input("Tags: ").strip()
43
+
44
+ if not df[df["command"] == command].empty:
45
+ print("\033[91m❌ Command already exists.\033[0m")
46
+ return
47
+
48
+ df.loc[len(df)] = [tool, command, description, tags]
49
+ save_df(df)
50
+ print("\033[92m✅ Command added.\033[0m")
51
+
52
+ def delete_command(df, query):
53
+ matches = df[df["command"].str.contains(query, case=False)]
54
+ if matches.empty:
55
+ print("\033[91mNo match found.\033[0m")
56
+ return
57
+
58
+ print_table(matches)
59
+ confirm = input("Delete these entries? (yes/no): ").lower()
60
+ if confirm != "yes":
61
+ print("Cancelled.")
62
+ return
63
+
64
+ df.drop(matches.index, inplace=True)
65
+ save_df(df)
66
+ print("\033[92m✅ Deleted.\033[0m")
67
+
68
+ # ---------- Entry Point ----------
69
+
70
+ def main():
71
+ df = load_df()
72
+
73
+ if len(sys.argv) < 2:
74
+ print("Usage: cheat <search> | cheat add | cheat delete <query>")
75
+ return
76
+
77
+ cmd = sys.argv[1]
78
+
79
+ if cmd == "add":
80
+ add_interactive(df)
81
+ elif cmd == "delete":
82
+ if len(sys.argv) < 3:
83
+ print("Usage: cheat delete <query>")
84
+ return
85
+ delete_command(df, sys.argv[2])
86
+ else:
87
+ search(df, cmd)
@@ -0,0 +1,33 @@
1
+ Metadata-Version: 2.4
2
+ Name: cheat-cli
3
+ Version: 0.1.0
4
+ Summary: A terminal-first cheat sheet CLI for Linux developers
5
+ Author-email: RejishJ <rejish.j.d@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/RejishJ/cheat-cli
8
+ Project-URL: Repository, https://github.com/RejishJ/cheat-cli
9
+ Requires-Python: >=3.8
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Requires-Dist: pandas
13
+ Requires-Dist: tabulate
14
+ Dynamic: license-file
15
+
16
+ # cheat-cli
17
+
18
+ A terminal-first cheat sheet for Linux developers.
19
+
20
+ ## Why
21
+ I built this to stop Googling the same commands repeatedly.
22
+ It lives in the terminal and grows with your workflow.
23
+
24
+ ## Features
25
+ - Fast search
26
+ - Interactive add
27
+ - Safe delete with confirmation
28
+ - Clean table output
29
+ - pip installable
30
+
31
+ ## Install
32
+ ```bash
33
+ pip install cheat-cli
@@ -0,0 +1,11 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ cheat_cli/__init__.py
5
+ cheat_cli/cli.py
6
+ cheat_cli.egg-info/PKG-INFO
7
+ cheat_cli.egg-info/SOURCES.txt
8
+ cheat_cli.egg-info/dependency_links.txt
9
+ cheat_cli.egg-info/entry_points.txt
10
+ cheat_cli.egg-info/requires.txt
11
+ cheat_cli.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ cheat = cheat_cli.cli:main
@@ -0,0 +1,2 @@
1
+ pandas
2
+ tabulate
@@ -0,0 +1 @@
1
+ cheat_cli
@@ -0,0 +1,25 @@
1
+ [build-system]
2
+ requires = ["setuptools>=64", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "cheat-cli"
7
+ version = "0.1.0"
8
+ description = "A terminal-first cheat sheet CLI for Linux developers"
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = { text = "MIT" }
12
+ authors = [
13
+ { name = "RejishJ", email = "rejish.j.d@gmail.com" }
14
+ ]
15
+ dependencies = [
16
+ "pandas",
17
+ "tabulate"
18
+ ]
19
+
20
+ [project.urls]
21
+ Homepage = "https://github.com/RejishJ/cheat-cli"
22
+ Repository = "https://github.com/RejishJ/cheat-cli"
23
+
24
+ [project.scripts]
25
+ cheat = "cheat_cli.cli:main"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+