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
48 49 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 |
|
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
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
go_back()
¶
Change the current working directory to the previous location.
Source code in sereto/cli/commands.py
75 76 77 |
|
_get_repl_prompt()
¶
Get the prompt for the Read-Eval-Print Loop (REPL).
Source code in sereto/cli/commands.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
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
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
|
repl_exit()
¶
Exit from the Read-Eval-Print Loop (REPL).
Source code in sereto/cli/commands.py
138 139 140 141 |
|
repl_toggle_debug()
¶
Toggle the debug mode.
Source code in sereto/cli/commands.py
144 145 146 147 148 149 150 |
|
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
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
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
153 154 155 156 157 158 159 160 161 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 |
|