{"id":21006272,"url":"https://github.com/derlin/cybejava","last_synced_at":"2026-05-01T05:37:53.328Z","repository":{"id":6486497,"uuid":"82099831","full_name":"derlin/CybeJava","owner":"derlin","description":"A command-line tool inspired from git to sync content between a Moodle/Cyberlearn course page and a local folder.","archived":false,"fork":false,"pushed_at":"2022-09-01T22:26:22.000Z","size":231,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-20T10:31:09.226Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/derlin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-15T19:48:01.000Z","updated_at":"2024-06-22T02:43:48.000Z","dependencies_parsed_at":"2022-08-25T09:10:26.781Z","dependency_job_id":null,"html_url":"https://github.com/derlin/CybeJava","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derlin%2FCybeJava","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derlin%2FCybeJava/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derlin%2FCybeJava/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derlin%2FCybeJava/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/derlin","download_url":"https://codeload.github.com/derlin/CybeJava/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243428421,"owners_count":20289315,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T08:50:29.142Z","updated_at":"2025-12-29T05:49:07.671Z","avatar_url":"https://github.com/derlin.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CybeJava\n\nA command-line tool inspired from git to sync content between a Moodle/Cyberlearn course page and a local folder.\n\n\u003e It is currently tested on https://cyberlearn.hes-so.ch, which is a Moodle 2 platform (the only one I have access to). For Moodle 1, have a look at [CybeJava-old](https://github.com/derlin/CybeJava-old). If you want support for your platform, contact me, I would be happy to help.\n\n## Structure\n\nThis project is split between two maven projects:\n- __cybe-lib__ is a library handling moodle/cyberlearn specifics. Classes allows you to easily connect, authenticate, list courses and resources, download files;\n- __cybe-cmdline__ is the actual terminal application. It is inspired by git for commands and behavior.\n\n## Build and run\n\n1. Clone the repo\n2. Run `mvn package` in the root directory\n3. Launch the cmdline jar, using `ava -jar cybe-cmdline/target/cybe-cmdline-\u003cversion\u003e-full.jar`\n\n# Command Line App\n \nThe command-line app includes a basic interpreter and also supports commands passed as program argument.\n\n__configuration__\n\nFirst of all, you need to enter your moodle/cyberlearn credentials and select your platform:\n\n    cybe init-global\n  \nThis will create a file `.cybeconf` in your home directory with the following structure:\n```json\n{\n  \"username\": \"lucy.linder\",\n  \"password\": \"\u003cencrypted pass\u003e\",\n  \"target platform\": \"cyberlearn.hes-so\"\n}\n```\n\n__initialise a directory and pull resources__ \n\nThe system is ready to use.\nNavigate to the directory you want to sync to and use the `init` command to tell cybe which course you want this folder to be bound to. This will create a `.cybe` inside the directory with some metadata. If you won't use cybe anymore, just delete the file.\n\nOnce a directory is initialised (i.e. contains a valid `.cybe` file), you can use `pull` to download all the resources (skipping the ones you already have) from the course page.\n\nHere is an example:\n\n    java -jar cybe.jar\n    \u003e init\n    Select a course \n      [0] C-PrivLaw-A - Privacy  and Law \n      [1] GPU - Programmation parall\u0026egrave;le sur GPU\n      [2] T-Alg - Algorithmique\n      [3] T-MachLe - Machine Learning\n      [4] VI - Visualisation de l\u0026#039;Information\n\n    Your choice [0-4] 4\n    Saving LocalConfig...\n    \u003e pull\n      --\u003e SAVING InfoVis09-2c.pdf (thread: 13)\n      ...\n      --\u003e SAVING InfoVisMSE_01.pdf (thread: 12)\n      --\u003e SAVING UV_Intervention_He-Arc_v20161120.pdf (thread: 17)\n    \u003e exit\n    Saving LocalConfig...\n    Cleaning up.\n    Done.\n\nwhenever you want, rerun `pull` to check for new resources. \n\n## Other\n\n__renaming files__: you can rename files downloaded by cybe. Out-of-the box, cybe will detect the change and won't re-download the renamed resources again. If you want to move a resource in another directory, just tell cybe with `add-dir [path]`, so it can detect the resource is already present on the local machine (use `rm-dir` to undo).\n\n__changing password__: simply rerun `init-global` and enter your new credentials.\n\n__downloading other types of resources__: by default, cybe downloads resources of type \"pdf\", \"text/plain\", \"zip\" and \"doc\". If a course has different resources you want to automatically pull, run `cybe add-ctype [type]`. Note that this must be done on a folder basis.\n\n    \u003e add-ctype tar html\n    tar : added.\n    html : added.\n\n__manually downloaded resources__: if you already have some files in the directory (that cybe should not re-download/override), you can use the command `resync`: cybe will memorize the unique ids of the files present and ignore them in future `pull`. Note that it won't work if you renamed the files before the sync.\n\n__viewing the current config__: the `dump` command will display the content of the `.cybe` file in the interpreter/terminal. It is the same result if you type `cat .cybe` in a unix-terminal.\n\n## Full list of commands\n\n* __init__: bind the current directory to one of your Cyberlearn course \n* __pinit__:  same as cybe init \u0026\u0026 cybe pull \n* __init-global__: store your credentials once and for all \n* __add-origin url [urls]__: add an url to the parsing process \n* __rm-origin url [urls]__: remove an url from the parsing process \n* __add-ctype ctype [ctypes]__: add a content-type to the list of valid resources \n* __rm-ctype ctype [ctypes]__: remove a user-defined content-type. Note that this command \n* __add-dir path [paths]__: mark the directory(-ies) as containing downloaded resources \n* __rm-dir path [paths]__: remove the directory(-ies)  \n* __pull__: download the latest resources for the course bound  \n* __resync__: force a resync of the existing resources list. May be useful when the app bugged. Note that the whole list fileid \u003c--\u003e filename will be reset, so if some files were renamed, you need to manually edit the new .cybe file... \n* __oneshot url__: parse the given url and download resources in the  \n* __help__: print a brief help message \n* __man__: display the full documentation \n* __dump__: display the content of the current local configuration \n* __open__: open the course page in the default browser\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderlin%2Fcybejava","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderlin%2Fcybejava","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderlin%2Fcybejava/lists"}