Commands
sereto.cli.commands
¶
WorkingDir
¶
Helper class for REPL implementing the cd command.
Attributes:
| Name | Type | Description |
|---|---|---|
old_cwd |
Path
|
The previous working directory. |
Source code in sereto/cli/commands.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |
change(dst)
¶
Change the current working directory to the new location.
Also saves the previous location for future reference.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dst
|
Path
|
The new working directory |
required |
Raises:
| Type | Description |
|---|---|
SeretoPathError
|
If the provided path is not an existing directory. |
Source code in sereto/cli/commands.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
go_back()
¶
Change the current working directory to the previous location.
Source code in sereto/cli/commands.py
77 78 79 | |
repl_cd(project_id)
¶
Switch the active project in the REPL.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_id
|
TypeProjectId | Literal['-']
|
The ID of the project to switch to. Use '-' to go back to the previous working directory. |
required |
Raises:
| Type | Description |
|---|---|
SeretoValueError
|
If the project ID is invalid. |
SeretoPathError
|
If the project's path does not exist. |
Source code in sereto/cli/commands.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
repl_exit()
¶
Exit from the Read-Eval-Print Loop (REPL).
Source code in sereto/cli/commands.py
149 150 151 152 | |
repl_log(log_level)
¶
Set the logging level for current REPL session.
Source code in sereto/cli/commands.py
155 156 157 158 159 | |
sereto_ls(settings)
¶
List all projects in the user's projects directory.
Print a table with the details to the console.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
settings
|
Settings
|
The Settings object. |
required |
Source code in sereto/cli/commands.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
sereto_repl(cli)
¶
Start an interactive Read-Eval-Print Loop (REPL) session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cli
|
Group
|
The main CLI group. |
required |
Source code in sereto/cli/commands.py
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | |