|
| 1 | +TMC-CLI 1 2016-06-30 "Helsinki Univ. Dep. of CS" "TMC-CLI Manual" |
| 2 | +================================================================= |
| 3 | + |
| 4 | +NAME |
| 5 | +---- |
| 6 | + |
| 7 | +tmc - Command-line client for TestMyCode |
| 8 | + |
| 9 | +SYNOPSIS |
| 10 | +-------- |
| 11 | + |
| 12 | +`tmc` [`-h|--help`] [`-v|--version`] |
| 13 | + <`COMMAND`> [`-h|--help`] |
| 14 | + <`COMMAND`> [`arguments`] ... |
| 15 | + |
| 16 | +DESCRIPTION |
| 17 | +----------- |
| 18 | + |
| 19 | +`tmc` is an exercise testing and submission utility for students participating |
| 20 | +on online courses utilising the free and open TestMyCode-framework. TMC-CLI is |
| 21 | +a command-line interface for TMC-CORE, the TestMyCode client backend. TMC-CLI's |
| 22 | +primary features include downloading exercises, running tests, viewing progress |
| 23 | +and submitting completed exercises. |
| 24 | + |
| 25 | +All functionality is divided between different commands. To use `tmc` for any |
| 26 | +meaningful task, you must issue a command after `tmc`. Commands each have their own |
| 27 | +options. For more information on commands and their options, see the `COMMAND` |
| 28 | +sections below. |
| 29 | + |
| 30 | +OPTIONS |
| 31 | +------- |
| 32 | + |
| 33 | +`-v` `--version` |
| 34 | + Display the version of this build. |
| 35 | + |
| 36 | +`-h` `--help` |
| 37 | + Display a concise help message. Shows all commonly used commands. If issued |
| 38 | + with a command, display a help message for that command. |
| 39 | + |
| 40 | +--- |
| 41 | +COMMANDS |
| 42 | +--- |
| 43 | + |
| 44 | +--- |
| 45 | + |
| 46 | +COMMAND: LOGIN |
| 47 | +----- |
| 48 | + |
| 49 | +`tmc` `login` [`-s` *server address*] [`-u` *username*] [`-p` *password*] |
| 50 | + |
| 51 | +Login to TMC server. If credentials are not given as options, the user will |
| 52 | +be asked to input any missing credentials. You will have to be logged in |
| 53 | +in order to use certain commands. |
| 54 | + |
| 55 | +`-s` `--server` |
| 56 | + Specify which server to connect to. |
| 57 | + |
| 58 | +`-u` `--user` |
| 59 | + Specify username. |
| 60 | + |
| 61 | +`-p` `--password` |
| 62 | + Specify password. |
| 63 | + |
| 64 | +COMMAND: LOGOUT |
| 65 | +--------------- |
| 66 | + |
| 67 | +`tmc` `logout` |
| 68 | + |
| 69 | +Delete login credentials from configurations. |
| 70 | + |
| 71 | +COMMAND: COURSES |
| 72 | +---------------- |
| 73 | + |
| 74 | +`tmc` `courses` |
| 75 | + |
| 76 | +List all available courses on the server. |
| 77 | + |
| 78 | +COMMAND: DOWNLOAD |
| 79 | +----------------- |
| 80 | + |
| 81 | +`tmc` `download` [`-a`] *course* |
| 82 | + |
| 83 | +Download a course from the server. |
| 84 | + |
| 85 | +`-a` `--all` |
| 86 | + Download all exercises, including completed ones. |
| 87 | + |
| 88 | +COMMAND: EXERCISES |
| 89 | +------------------ |
| 90 | + |
| 91 | +`tmc` `exercises` [`-n`] [`-i`] |
| 92 | + |
| 93 | +List the status of all of the course's exercises. Exercises are grouped by |
| 94 | +their deadlines. On Unix, the list is displayed on a pager. |
| 95 | + |
| 96 | +`-n` `--no-pager` |
| 97 | + Print the list directly to the terminal. |
| 98 | + |
| 99 | +`-i` `--internet` |
| 100 | + Fetch exercises' statuses from the server, as opposed to reading from the |
| 101 | + local cache. |
| 102 | + |
| 103 | +COMMAND: UPDATE |
| 104 | +--------------- |
| 105 | + |
| 106 | +`tmc` `update` |
| 107 | + |
| 108 | +Update the course cache and download newly available exercises. |
| 109 | + |
| 110 | +COMMAND: TEST |
| 111 | +------------- |
| 112 | + |
| 113 | +`tmc` `test` [`-a`] [`-d`] [*path*] ... |
| 114 | + |
| 115 | +Run tests for the specified exercise. If no *path* is given, tests will be |
| 116 | +run in the current working directory. Several exercises can be tested at once. |
| 117 | +If the current work directory is the course root directory or the course root |
| 118 | +directory was given as a *path*, then all exercises will be tested. |
| 119 | + |
| 120 | +`-a` `--all` |
| 121 | + Display all test results, instead of only the failed tests. |
| 122 | + |
| 123 | +`-d` `--details` |
| 124 | + Display more detailed error messages. |
| 125 | + |
| 126 | +COMMAND: SUBMIT |
| 127 | +--------------- |
| 128 | + |
| 129 | +`tmc` `submit` [`-a`] [`-d`] [`-c`] [*path*] ... |
| 130 | + |
| 131 | +Submit exercises to the server. If no *path* is given, the exercise in the |
| 132 | +current working directory will be submitted. Several exercises can be submitted |
| 133 | +at once. If the current work directory is the course root directory or the |
| 134 | +course root directory was given as a *path*, then all exercises will be submitted. |
| 135 | + |
| 136 | +For every successful submission, you'll be prompted to send feedback for the |
| 137 | +exercise if the course has enabledfeedback questions. Sending feedback is |
| 138 | +always optional. |
| 139 | + |
| 140 | +`-a` `--all` |
| 141 | + Display all test results, instead of only the failed tests. |
| 142 | + |
| 143 | +`-d` `--details` |
| 144 | + Display more detailed error messages. |
| 145 | + |
| 146 | +`-c` `--completed` |
| 147 | + Submit all exercises in the current course which have passed local tests. |
| 148 | + |
| 149 | +COMMAND: INFO |
| 150 | +------------- |
| 151 | + |
| 152 | +`tmc` `info` [`-a`] [`-i`] [*course or exercise*] |
| 153 | + |
| 154 | +Display the current status of a course or an exercise. If used for a course, |
| 155 | +shows the total amount of available, completed and locked exercises. If used |
| 156 | +for an exercise, shows the exercise's status and deadline. |
| 157 | + |
| 158 | +`-a` `--all` |
| 159 | + Displays all information for given course and exercises. |
| 160 | + |
| 161 | +`-i` `--internet` |
| 162 | + Fetches information from the server, as opposed to reading from local cache. |
| 163 | + |
| 164 | +COMMAND: PASTE |
| 165 | +-------------- |
| 166 | + |
| 167 | +`tmc` `paste` [`-o`] [`-n`] [`-m` *message*] [*exercise*] |
| 168 | + |
| 169 | +Submit an exercise to the tmc-pastebin. You can attach a message to your paste. |
| 170 | +Once submission is successful, a shareable link will be printed. |
| 171 | + |
| 172 | +`-o` `--open` |
| 173 | + Open the link to the paste in the default internet browser after submission. |
| 174 | + |
| 175 | +`-n` `--no-message` |
| 176 | + Do not send a message alongside the paste. |
| 177 | + |
| 178 | +`-m` `--message` |
| 179 | + Give the paste as an argument instead of opening a text editor. |
| 180 | + |
| 181 | +COMMAND: PROP |
| 182 | +------------- |
| 183 | + |
| 184 | +`tmc` `prop` [*KEY*] [*VALUE*] ... |
| 185 | + `prop` `-u` *KEY* ... |
| 186 | + |
| 187 | +Set or unset TMC-CLI properties. Invoke without any arguments to display all |
| 188 | +current properties. If more than a single property is added or removed, the user |
| 189 | +will be asked to confirm the changes. |
| 190 | + |
| 191 | +`-u` `--unset` |
| 192 | + Unset given properties. |
| 193 | + |
| 194 | +List of properties: |
| 195 | + |
| 196 | +* *update-date* |
| 197 | + Scheduled time for the next version check. |
| 198 | +* *testresults-left* *testresults-right* *progressbar-left* *progressbar-right* |
| 199 | + Change progress bar colours. Recognised values: black, red, green, yellow, |
| 200 | + blue, purple, cyan, white, none. |
| 201 | + |
| 202 | +--- |
| 203 | + |
| 204 | +FILES |
| 205 | +----- |
| 206 | + |
| 207 | +`[course directory]/.tmc.json` |
| 208 | + Course configuration and cache file. Saves the status of the username, server |
| 209 | + address and course's exercises. Manually editing this file may have adverse |
| 210 | + effects. |
| 211 | + |
| 212 | + |
| 213 | +`~/.config/tmc-cli/properties.json` |
| 214 | + User configuration file. Use `tmc prop` to edit properties. |
| 215 | + |
| 216 | +`~/.config/tmc-cli/accounts.json` |
| 217 | + User login credentials. Use `tmc logout` to safely delete. |
| 218 | + |
| 219 | +`~/.config/tmc-cli/logs/tmc-cli.log` |
| 220 | + Debug logging. |
| 221 | + |
| 222 | +For more on config locations, see `ENVIRONMENT` -> `XDG_CONFIG_HOME` and `APPDATA`. |
| 223 | + |
| 224 | +ENVIRONMENT |
| 225 | +----------- |
| 226 | + |
| 227 | +`EDITOR` |
| 228 | + Text editor for editing messages for pastebin and feedback. If unset, defaults |
| 229 | + to `nano` on Unix and `notepad` on Windows. |
| 230 | + |
| 231 | +`PAGER` |
| 232 | + Pager for displaying text files. If unset, defaults to `less -R` on Unix. |
| 233 | + This functionality is broken on Windows, but defaults to `more`. |
| 234 | + |
| 235 | +`XDG_CONFIG_HOME` |
| 236 | + If set on Unix, *~/.config/* in config file paths is replaced with its value. |
| 237 | + |
| 238 | +`APPDATA` |
| 239 | + On Windows, *~/.config/* is replaced with the value of `%APPDATA%`, usually |
| 240 | + *C:\\Users\\Username\\AppData\\Roaming\\.* If `%APPDATA%` is unset, user's home |
| 241 | + directory will be used instead. |
| 242 | + |
| 243 | +BUGS |
| 244 | +---- |
| 245 | + |
| 246 | +Most likely. Please submit bug reports, spelling and grammar corrections and |
| 247 | +other issues to [the tmc-cli issue tracker](https://github.com/tmc-cli/tmc-cli/issues). |
| 248 | + |
| 249 | +AUTHORS |
| 250 | +------- |
| 251 | + |
| 252 | + Johannes L. [jclc](https://github.com/jclc) |
| 253 | + Matti L. [matike](https://github.com/matike) |
| 254 | + Mikko M. [mikkomaa](https://github.com/mikkomaa) |
| 255 | + Aleksi S. [salmela](https://github.com/salmela) |
| 256 | + Juha V. [juvester](https://github.com/juvester) |
0 commit comments