-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.py
More file actions
44 lines (31 loc) · 1.56 KB
/
cli.py
File metadata and controls
44 lines (31 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import argparse
parser = argparse.ArgumentParser(description="🔐 Simple Encrypted Password Manager")
def parse_args():
subparsers = parser.add_subparsers(dest="command")
# Add command
add_parser = subparsers.add_parser("add", help="Add or update a service credential")
add_parser.add_argument("service", help="Service name")
add_parser.add_argument("username", help="Username for the service")
# Remove command
remove_parser = subparsers.add_parser("remove", help="Remove a service credential")
remove_parser.add_argument("service", help="Service name")
# Get command
get_parser = subparsers.add_parser("get", help="Retrieve credentials for a service")
get_parser.add_argument("service", help="Service name")
# List command
subparsers.add_parser("list", help="List all stored services")
# Search command
search_parser = subparsers.add_parser("search", help="Search through available services")
search_parser.add_argument("query", help="What to search for")
#Lock command
subparsers.add_parser("lock", help="Manually clear the unlocked session (like sudo -k)")
# Setup command
subparsers.add_parser("setup", help="Initialize the password manager vault")
# Help command
subparsers.add_parser("help", help="Show this help message")
# Config command
config_parser = subparsers.add_parser("config", help="Manage configuration")
config_parser.add_argument("--set-dir", help="Set custom data storage directory")
return parser.parse_args()
def print_help():
parser.print_help()