krz/yoshi-cli

Archived

A password manager for the command line. cli password-manager terminal

Commit 6dde4dd0bc

6dde4dd0bc5e5f91f89587c75a30c9ef7a24494c

parent: b5a5fadff8

Verified · cmc

cmc <hello@cleberg.net> · 2024-11-07 05:23 UTC

package as a cli app

Layout: unified · split

.gitignore +1
@@ -1,6 +1,7 @@
1.DS_Store 1.DS_Store
2.idea/ 2.idea/
3.pypirc 3.pypirc
4build/
4dist/ 5dist/
5venv/ 6venv/
6__pycache__/ 7__pycache__/
README.md +2 −3
@@ -34,8 +34,7 @@ To run the script locally, run the following commands:
34```bash 34```bash
35git clone REPO_URL 35git clone REPO_URL
36cd yoshi 36cd yoshi
37pip3 install -r requirements.txt 37pip install .
38python3 main.py --help
39``` 38```
40 39
41# Usage 40# Usage
@@ -43,7 +42,7 @@ python3 main.py --help
43[(Back to top)](#table-of-contents) 42[(Back to top)](#table-of-contents)
44 43
45All commands can be passed to the program with the following template: 44All commands can be passed to the program with the following template:
46`python3 main.py <COMMAND> <FLAG> <PARAMETER>` 45`python3 src/yoshi/cli.py <COMMAND> <FLAG> <PARAMETER>`
47 46
48![Yoshi CLI Help](./examples/yoshi-help.png) 47![Yoshi CLI Help](./examples/yoshi-help.png)
49 48
pyproject.toml +4 −1
@@ -1,6 +1,6 @@
1[project] 1[project]
2name = "yoshi-cli" 2name = "yoshi-cli"
3version = "0.1.0" 3version = "0.1.1"
4authors = [ 4authors = [
5 { name="Christian Cleberg", email="hello@cleberg.net" }, 5 { name="Christian Cleberg", email="hello@cleberg.net" },
6] 6]
@@ -16,3 +16,6 @@ classifiers = [
16[project.urls] 16[project.urls]
17Homepage = "https://github.com/ccleberg/yoshi" 17Homepage = "https://github.com/ccleberg/yoshi"
18Issues = "https://github.com/ccleberg/yoshi/issues" 18Issues = "https://github.com/ccleberg/yoshi/issues"
19
20[project.scripts]
21yoshi = "yoshi.cli:yoshi"
requirements.txt +1 −1
@@ -1,2 +1,2 @@
1prettytable~=2.2.0 1prettytable~=2.2.0
2cryptography~=3.4.8\ No newline at end of file 2cryptography
src/yoshi_cli.egg-info/SOURCES.txt deleted −11
@@ -1,11 +0,0 @@
1LICENSE
2README.md
3pyproject.toml
4src/account.py
5src/crypto.py
6src/database.py
7src/process.py
8src/yoshi_cli.egg-info/PKG-INFO
9src/yoshi_cli.egg-info/SOURCES.txt
10src/yoshi_cli.egg-info/dependency_links.txt
11src/yoshi_cli.egg-info/top_level.txt\ No newline at end of file
src/yoshi_cli.egg-info/top_level.txt deleted −4
@@ -1,4 +0,0 @@
1account
2crypto
3database
4process
yoshi/__init__.py added
yoshi/__main__.py added +3
@@ -0,0 +1,3 @@
1if __name__ == "__main__":
2 from yoshi.cli import yoshi
3 yoshi()
src/account.py → yoshi/account.py renamed +1 −1
@@ -5,7 +5,7 @@ Modules imported:
5 - database: A custom module providing database functionality. 5 - database: A custom module providing database functionality.
6""" 6"""
7 7
8import database 8import yoshi.database as database
9 9
10 10
11class Account: 11class Account:
main.py → yoshi/cli.py renamed +7 −4
@@ -5,11 +5,11 @@ It imports the required modules and sets up a parser with basic options for demo
5""" 5"""
6 6
7import argparse 7import argparse
8import crypto 8import yoshi.crypto as crypto
9import database 9import yoshi.database as database
10import process 10import yoshi.process as process
11 11
12if __name__ == '__main__': 12def yoshi():
13 parser = argparse.ArgumentParser( 13 parser = argparse.ArgumentParser(
14 description='Manage your username and passwords via a convenient CLI vault.' 14 description='Manage your username and passwords via a convenient CLI vault.'
15 ) 15 )
@@ -131,3 +131,6 @@ if __name__ == '__main__':
131 raise TypeError( 131 raise TypeError(
132 'Please specify a command or use the --help flag for more information.' 132 'Please specify a command or use the --help flag for more information.'
133 ) 133 )
134
135if __name__ == "__main__":
136 yoshi()
src/crypto.py → yoshi/crypto.py renamed
src/database.py → yoshi/database.py renamed
src/process.py → yoshi/process.py renamed +4 −3
@@ -27,8 +27,8 @@ from string import ascii_letters, punctuation, digits
27import random 27import random
28import uuid 28import uuid
29from prettytable import PrettyTable 29from prettytable import PrettyTable
30from account import Account 30from yoshi.account import Account
31import database 31import yoshi.database as database
32 32
33 33
34def generate_characters(n: int) -> list: 34def generate_characters(n: int) -> list:
@@ -176,7 +176,8 @@ def create_account() -> None:
176 if password_length < 8: 176 if password_length < 8:
177 print('Error: Your password length must be at least 8 characters.') 177 print('Error: Your password length must be at least 8 characters.')
178 return 178 return
179 password_string = generate_password(password_length) # pylint: disable=undefined-variable 179 password_characters = generate_characters(password_length)
180 password_string = shuffle_characters(password_characters)
180 else: 181 else:
181 password_string = input('Please enter your desired password: ') 182 password_string = input('Please enter your desired password: ')
182 183
src/yoshi_cli.egg-info/PKG-INFO → yoshi_cli.egg-info/PKG-INFO renamed +10 −11
@@ -1,6 +1,6 @@
1Metadata-Version: 2.1 1Metadata-Version: 2.1
2Name: yoshi-cli 2Name: yoshi-cli
3Version: 0.1.0 3Version: 0.1.1
4Summary: A password manager for the command line. 4Summary: A password manager for the command line.
5Author-email: Christian Cleberg <hello@cleberg.net> 5Author-email: Christian Cleberg <hello@cleberg.net>
6Project-URL: Homepage, https://github.com/ccleberg/yoshi 6Project-URL: Homepage, https://github.com/ccleberg/yoshi
@@ -35,22 +35,21 @@ information.
35 35
36[(Back to top)](#table-of-contents) 36[(Back to top)](#table-of-contents)
37 37
38To run the script locally, run the following commands: 38## PyPi
39 39
40```bash 40```bash
41git clone REPO_URL 41pip install yoshi-cli
42``` 42```
43 43
44```bash 44## Manual
45cd yoshi
46```
47 45
48```bash 46To run the script locally, run the following commands:
49pip3 install -r requirements.txt
50```
51 47
52```bash 48```bash
53python3 main.py --help 49git clone REPO_URL
50cd yoshi
51pip3 install -r requirements.txt
52python3 src/yoshi/cli.py --help
54``` 53```
55 54
56# Usage 55# Usage
@@ -58,7 +57,7 @@ python3 main.py --help
58[(Back to top)](#table-of-contents) 57[(Back to top)](#table-of-contents)
59 58
60All commands can be passed to the program with the following template: 59All commands can be passed to the program with the following template:
61`python3 main.py <COMMAND> <FLAG> <PARAMETER>` 60`python3 src/yoshi/cli.py <COMMAND> <FLAG> <PARAMETER>`
62 61
63![Yoshi CLI Help](./examples/yoshi-help.png) 62![Yoshi CLI Help](./examples/yoshi-help.png)
64 63
yoshi_cli.egg-info/SOURCES.txt added +15
@@ -0,0 +1,15 @@
1LICENSE
2README.md
3pyproject.toml
4yoshi/__init__.py
5yoshi/__main__.py
6yoshi/account.py
7yoshi/cli.py
8yoshi/crypto.py
9yoshi/database.py
10yoshi/process.py
11yoshi_cli.egg-info/PKG-INFO
12yoshi_cli.egg-info/SOURCES.txt
13yoshi_cli.egg-info/dependency_links.txt
14yoshi_cli.egg-info/entry_points.txt
15yoshi_cli.egg-info/top_level.txt\ No newline at end of file
src/yoshi_cli.egg-info/dependency_links.txt → yoshi_cli.egg-info/dependency_links.txt renamed
yoshi_cli.egg-info/entry_points.txt added +2
@@ -0,0 +1,2 @@
1[console_scripts]
2yoshi = yoshi.cli:yoshi
yoshi_cli.egg-info/top_level.txt added +1
@@ -0,0 +1 @@
1yoshi