efs-cli 1.2.0__tar.gz → 1.2.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: efs-cli
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: EepyFileServer API CLI written in Python
5
5
  Author: maxie
6
6
  License-Expression: MIT
@@ -27,7 +27,7 @@ command line interface for eepyfileserver written in python
27
27
  ## prerequisites
28
28
 
29
29
  - python 3.10 (3.12+ recommended)
30
- - [`eepyfileserver`](https://codeberg.org/maxeepy/eepyfileserver) 1.1.0-alpha or later
30
+ - [`eepyfileserver`](https://codeberg.org/maxeepy/eepyfileserver) 1.1.0-alpha (or later for some features, such as users)
31
31
 
32
32
  ## install
33
33
 
@@ -40,7 +40,7 @@ command line interface for eepyfileserver written in python
40
40
  ```bash
41
41
  #login fully (lets you upload and download files)
42
42
  #password is saved in PLAIN TEXT
43
- efs-cli auth "https://example.com" "password123"
43
+ efs-cli auth "https://example.com" "password123" --custom-api-path (optional) "/meow/v123"
44
44
 
45
45
  #login only using the url (lets you download PUBLIC files)
46
46
  efs-cli auth "https://example.com"
@@ -48,6 +48,25 @@ efs-cli auth "https://example.com"
48
48
  efs-cli login ...
49
49
  ```
50
50
 
51
+ ### see and edit your configs
52
+
53
+ cli config
54
+
55
+ ```bash
56
+ efs-cli config
57
+ efs-cli config --reset # resets your entire config
58
+
59
+ efs-cli conf
60
+ efs-cli cli-config
61
+ ```
62
+
63
+ efs config
64
+
65
+ ```bash
66
+ efs-cli efs-config
67
+ efs-cli efs-conf
68
+ ```
69
+
51
70
  ### view version
52
71
 
53
72
  ```bash
@@ -70,10 +89,30 @@ efs-cli ls
70
89
  efs-cli files
71
90
  ```
72
91
 
92
+ ### view file/directory metadata
93
+
94
+ ```bash
95
+ efs-cli metadata <path> --public (optional) # uses public url
96
+ efs-cli meta ...
97
+ ```
98
+
99
+ ### edit a file
100
+
101
+ ```bash
102
+ efs-cli edit <file_path>
103
+ ```
104
+
105
+ ### get a url for a file
106
+
107
+ ```bash
108
+ efs-cli url-for <file_path> --public (optional) --check-if-exists (optional) # --public uses public url, --check-if-exists checks if the file exists on efs
109
+ efs-cli url ...
110
+ ```
111
+
73
112
  ### download a file
74
113
 
75
114
  ```bash
76
- efs-cli download /example.txt /home/maxeepy/Downloads/example.txt
115
+ efs-cli download /example.txt /home/maxeepy/Downloads/example.txt --public (optional) # uses public url
77
116
  efs-cli get ...
78
117
  efs-cli d ...
79
118
  ```
@@ -87,6 +126,13 @@ efs-cli up ...
87
126
  efs-cli put ...
88
127
  ```
89
128
 
129
+ ### overwrite a file
130
+
131
+ ```bash
132
+ efs-cli overwrite /home/maxeepy/Downloads/example.txt /example.txt
133
+ efs-cli over ...
134
+ ```
135
+
90
136
  ### delete a file
91
137
 
92
138
  ```bash
@@ -99,5 +145,38 @@ efs-cli rm ...
99
145
 
100
146
  ```bash
101
147
  efs-cli read /example.txt
148
+ efs-cli read /example.txt --no-less # doesn't use less
102
149
  efs-cli cat ...
103
150
  ```
151
+
152
+ ### list users
153
+
154
+ ```bash
155
+ efs-cli users
156
+ efs-cli listusers
157
+ efs-cli lsu
158
+ ```
159
+
160
+ ### add a user
161
+
162
+ ```bash
163
+ efs-cli adduser dir123 "rw" # or "ro"
164
+ efs-cli auser ...
165
+ efs-cli au ...
166
+ ```
167
+
168
+ ### change a user
169
+
170
+ ```bash
171
+ efs-cli changeuser efskey_123 dir123 "rw" # or "ro"
172
+ efs-cli chuser ...
173
+ efs-cli chu ...
174
+ ```
175
+
176
+ ### remove a user
177
+
178
+ ```bash
179
+ efs-cli removeuser efskey_123 --remove-dir (optional) # removes the user directory if set
180
+ efs-cli rmuser ...
181
+ efs-cli ru ...
182
+ ```
@@ -0,0 +1,160 @@
1
+ # efs-cli (formerly eepyfileserver-cli)
2
+
3
+ command line interface for eepyfileserver written in python
4
+
5
+ ## prerequisites
6
+
7
+ - python 3.10 (3.12+ recommended)
8
+ - [`eepyfileserver`](https://codeberg.org/maxeepy/eepyfileserver) 1.1.0-alpha (or later for some features, such as users)
9
+
10
+ ## install
11
+
12
+ `pip install efs-cli`
13
+
14
+ ## usage
15
+
16
+ ### log in to an instance
17
+
18
+ ```bash
19
+ #login fully (lets you upload and download files)
20
+ #password is saved in PLAIN TEXT
21
+ efs-cli auth "https://example.com" "password123" --custom-api-path (optional) "/meow/v123"
22
+
23
+ #login only using the url (lets you download PUBLIC files)
24
+ efs-cli auth "https://example.com"
25
+
26
+ efs-cli login ...
27
+ ```
28
+
29
+ ### see and edit your configs
30
+
31
+ cli config
32
+
33
+ ```bash
34
+ efs-cli config
35
+ efs-cli config --reset # resets your entire config
36
+
37
+ efs-cli conf
38
+ efs-cli cli-config
39
+ ```
40
+
41
+ efs config
42
+
43
+ ```bash
44
+ efs-cli efs-config
45
+ efs-cli efs-conf
46
+ ```
47
+
48
+ ### view version
49
+
50
+ ```bash
51
+ efs-cli version
52
+ efs-cli ver
53
+ ```
54
+
55
+ ### view instance information
56
+
57
+ ```bash
58
+ efs-cli instance
59
+ efs-cli info
60
+ ```
61
+
62
+ ### list files
63
+
64
+ ```bash
65
+ efs-cli list
66
+ efs-cli ls
67
+ efs-cli files
68
+ ```
69
+
70
+ ### view file/directory metadata
71
+
72
+ ```bash
73
+ efs-cli metadata <path> --public (optional) # uses public url
74
+ efs-cli meta ...
75
+ ```
76
+
77
+ ### edit a file
78
+
79
+ ```bash
80
+ efs-cli edit <file_path>
81
+ ```
82
+
83
+ ### get a url for a file
84
+
85
+ ```bash
86
+ efs-cli url-for <file_path> --public (optional) --check-if-exists (optional) # --public uses public url, --check-if-exists checks if the file exists on efs
87
+ efs-cli url ...
88
+ ```
89
+
90
+ ### download a file
91
+
92
+ ```bash
93
+ efs-cli download /example.txt /home/maxeepy/Downloads/example.txt --public (optional) # uses public url
94
+ efs-cli get ...
95
+ efs-cli d ...
96
+ ```
97
+
98
+ ### upload a file
99
+
100
+ ```bash
101
+ efs-cli upload /home/maxeepy/Downloads/example.txt /example.txt
102
+ efs-cli post ...
103
+ efs-cli up ...
104
+ efs-cli put ...
105
+ ```
106
+
107
+ ### overwrite a file
108
+
109
+ ```bash
110
+ efs-cli overwrite /home/maxeepy/Downloads/example.txt /example.txt
111
+ efs-cli over ...
112
+ ```
113
+
114
+ ### delete a file
115
+
116
+ ```bash
117
+ efs-cli delete /example.txt
118
+ efs-cli remove ...
119
+ efs-cli rm ...
120
+ ```
121
+
122
+ ### read a file
123
+
124
+ ```bash
125
+ efs-cli read /example.txt
126
+ efs-cli read /example.txt --no-less # doesn't use less
127
+ efs-cli cat ...
128
+ ```
129
+
130
+ ### list users
131
+
132
+ ```bash
133
+ efs-cli users
134
+ efs-cli listusers
135
+ efs-cli lsu
136
+ ```
137
+
138
+ ### add a user
139
+
140
+ ```bash
141
+ efs-cli adduser dir123 "rw" # or "ro"
142
+ efs-cli auser ...
143
+ efs-cli au ...
144
+ ```
145
+
146
+ ### change a user
147
+
148
+ ```bash
149
+ efs-cli changeuser efskey_123 dir123 "rw" # or "ro"
150
+ efs-cli chuser ...
151
+ efs-cli chu ...
152
+ ```
153
+
154
+ ### remove a user
155
+
156
+ ```bash
157
+ efs-cli removeuser efskey_123 --remove-dir (optional) # removes the user directory if set
158
+ efs-cli rmuser ...
159
+ efs-cli ru ...
160
+ ```
@@ -0,0 +1,2 @@
1
+ __version__ = "1.2.1"
2
+
@@ -35,8 +35,17 @@ def get_conf():
35
35
  with open(CONFIG_PATH, "r") as file:
36
36
  conf = json.load(file)
37
37
 
38
+ if conf:
39
+ editor = conf.get("editor", "nano")
40
+ if "sudo" in editor or "rm" in editor or "rm -rf" in editor:
41
+ print("there cannot be 'sudo', 'rm' or 'rm -rf' in the editor command")
42
+ sys.exit(1)
43
+
38
44
  return conf
39
45
 
46
+ def format_tree(root, files, dirs,):
47
+ ...
48
+
40
49
  def init_api():
41
50
  conf = get_conf()
42
51
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: efs-cli
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: EepyFileServer API CLI written in Python
5
5
  Author: maxie
6
6
  License-Expression: MIT
@@ -27,7 +27,7 @@ command line interface for eepyfileserver written in python
27
27
  ## prerequisites
28
28
 
29
29
  - python 3.10 (3.12+ recommended)
30
- - [`eepyfileserver`](https://codeberg.org/maxeepy/eepyfileserver) 1.1.0-alpha or later
30
+ - [`eepyfileserver`](https://codeberg.org/maxeepy/eepyfileserver) 1.1.0-alpha (or later for some features, such as users)
31
31
 
32
32
  ## install
33
33
 
@@ -40,7 +40,7 @@ command line interface for eepyfileserver written in python
40
40
  ```bash
41
41
  #login fully (lets you upload and download files)
42
42
  #password is saved in PLAIN TEXT
43
- efs-cli auth "https://example.com" "password123"
43
+ efs-cli auth "https://example.com" "password123" --custom-api-path (optional) "/meow/v123"
44
44
 
45
45
  #login only using the url (lets you download PUBLIC files)
46
46
  efs-cli auth "https://example.com"
@@ -48,6 +48,25 @@ efs-cli auth "https://example.com"
48
48
  efs-cli login ...
49
49
  ```
50
50
 
51
+ ### see and edit your configs
52
+
53
+ cli config
54
+
55
+ ```bash
56
+ efs-cli config
57
+ efs-cli config --reset # resets your entire config
58
+
59
+ efs-cli conf
60
+ efs-cli cli-config
61
+ ```
62
+
63
+ efs config
64
+
65
+ ```bash
66
+ efs-cli efs-config
67
+ efs-cli efs-conf
68
+ ```
69
+
51
70
  ### view version
52
71
 
53
72
  ```bash
@@ -70,10 +89,30 @@ efs-cli ls
70
89
  efs-cli files
71
90
  ```
72
91
 
92
+ ### view file/directory metadata
93
+
94
+ ```bash
95
+ efs-cli metadata <path> --public (optional) # uses public url
96
+ efs-cli meta ...
97
+ ```
98
+
99
+ ### edit a file
100
+
101
+ ```bash
102
+ efs-cli edit <file_path>
103
+ ```
104
+
105
+ ### get a url for a file
106
+
107
+ ```bash
108
+ efs-cli url-for <file_path> --public (optional) --check-if-exists (optional) # --public uses public url, --check-if-exists checks if the file exists on efs
109
+ efs-cli url ...
110
+ ```
111
+
73
112
  ### download a file
74
113
 
75
114
  ```bash
76
- efs-cli download /example.txt /home/maxeepy/Downloads/example.txt
115
+ efs-cli download /example.txt /home/maxeepy/Downloads/example.txt --public (optional) # uses public url
77
116
  efs-cli get ...
78
117
  efs-cli d ...
79
118
  ```
@@ -87,6 +126,13 @@ efs-cli up ...
87
126
  efs-cli put ...
88
127
  ```
89
128
 
129
+ ### overwrite a file
130
+
131
+ ```bash
132
+ efs-cli overwrite /home/maxeepy/Downloads/example.txt /example.txt
133
+ efs-cli over ...
134
+ ```
135
+
90
136
  ### delete a file
91
137
 
92
138
  ```bash
@@ -99,5 +145,38 @@ efs-cli rm ...
99
145
 
100
146
  ```bash
101
147
  efs-cli read /example.txt
148
+ efs-cli read /example.txt --no-less # doesn't use less
102
149
  efs-cli cat ...
103
150
  ```
151
+
152
+ ### list users
153
+
154
+ ```bash
155
+ efs-cli users
156
+ efs-cli listusers
157
+ efs-cli lsu
158
+ ```
159
+
160
+ ### add a user
161
+
162
+ ```bash
163
+ efs-cli adduser dir123 "rw" # or "ro"
164
+ efs-cli auser ...
165
+ efs-cli au ...
166
+ ```
167
+
168
+ ### change a user
169
+
170
+ ```bash
171
+ efs-cli changeuser efskey_123 dir123 "rw" # or "ro"
172
+ efs-cli chuser ...
173
+ efs-cli chu ...
174
+ ```
175
+
176
+ ### remove a user
177
+
178
+ ```bash
179
+ efs-cli removeuser efskey_123 --remove-dir (optional) # removes the user directory if set
180
+ efs-cli rmuser ...
181
+ efs-cli ru ...
182
+ ```
efs_cli-1.2.0/README.md DELETED
@@ -1,81 +0,0 @@
1
- # efs-cli (formerly eepyfileserver-cli)
2
-
3
- command line interface for eepyfileserver written in python
4
-
5
- ## prerequisites
6
-
7
- - python 3.10 (3.12+ recommended)
8
- - [`eepyfileserver`](https://codeberg.org/maxeepy/eepyfileserver) 1.1.0-alpha or later
9
-
10
- ## install
11
-
12
- `pip install efs-cli`
13
-
14
- ## usage
15
-
16
- ### log in to an instance
17
-
18
- ```bash
19
- #login fully (lets you upload and download files)
20
- #password is saved in PLAIN TEXT
21
- efs-cli auth "https://example.com" "password123"
22
-
23
- #login only using the url (lets you download PUBLIC files)
24
- efs-cli auth "https://example.com"
25
-
26
- efs-cli login ...
27
- ```
28
-
29
- ### view version
30
-
31
- ```bash
32
- efs-cli version
33
- efs-cli ver
34
- ```
35
-
36
- ### view instance information
37
-
38
- ```bash
39
- efs-cli instance
40
- efs-cli info
41
- ```
42
-
43
- ### list files
44
-
45
- ```bash
46
- efs-cli list
47
- efs-cli ls
48
- efs-cli files
49
- ```
50
-
51
- ### download a file
52
-
53
- ```bash
54
- efs-cli download /example.txt /home/maxeepy/Downloads/example.txt
55
- efs-cli get ...
56
- efs-cli d ...
57
- ```
58
-
59
- ### upload a file
60
-
61
- ```bash
62
- efs-cli upload /home/maxeepy/Downloads/example.txt /example.txt
63
- efs-cli post ...
64
- efs-cli up ...
65
- efs-cli put ...
66
- ```
67
-
68
- ### delete a file
69
-
70
- ```bash
71
- efs-cli delete /example.txt
72
- efs-cli remove ...
73
- efs-cli rm ...
74
- ```
75
-
76
- ### read a file
77
-
78
- ```bash
79
- efs-cli read /example.txt
80
- efs-cli cat ...
81
- ```
@@ -1,2 +0,0 @@
1
- __version__ = "1.2.0"
2
-
File without changes
File without changes
File without changes