{"id":26784727,"url":"https://github.com/theflash2k/ctfd-cli","last_synced_at":"2025-03-29T10:29:27.777Z","repository":{"id":204352797,"uuid":"711611004","full_name":"TheFlash2k/CTFd-CLI","owner":"TheFlash2k","description":"A Command Line Utility to perform actions with a CTFd Instance using the CTFd REST API","archived":false,"fork":false,"pushed_at":"2023-12-20T22:42:18.000Z","size":36,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-12-21T01:15:21.679Z","etag":null,"topics":["ctfd"],"latest_commit_sha":null,"homepage":"","language":"Python","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/TheFlash2k.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-29T19:33:50.000Z","updated_at":"2023-10-31T15:37:34.000Z","dependencies_parsed_at":"2023-12-21T01:15:06.838Z","dependency_job_id":null,"html_url":"https://github.com/TheFlash2k/CTFd-CLI","commit_stats":null,"previous_names":["theflash2k/ctfd-cli"],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheFlash2k%2FCTFd-CLI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheFlash2k%2FCTFd-CLI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheFlash2k%2FCTFd-CLI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheFlash2k%2FCTFd-CLI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheFlash2k","download_url":"https://codeload.github.com/TheFlash2k/CTFd-CLI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246171926,"owners_count":20735092,"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":["ctfd"],"created_at":"2025-03-29T10:29:27.255Z","updated_at":"2025-03-29T10:29:27.766Z","avatar_url":"https://github.com/TheFlash2k.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CTFd-CLI\n\nA Command Line Utility to perform actions with a CTFd Instance using the CTFd REST API.\n\n---\n\nIn order to interact with the CTFd API, you need to have an API key and the IP/Hostname of the CTFd instance. These can be configured inside the `.env` file.\nFor starters, you can copy the `.env.example` file and rename it to `.env` and fill in the values.\n\n## Usage\n\n```bash\nusage: ctfd-cli.py [-h] [--ctfd-instance CTFD_INSTANCE] [--ctfd-token CTFD_TOKEN] {user,team} ...\n\nCTFd CLI\n\npositional arguments:\n  {user,team}\n    user                User mode\n    team                Team mode\n\noptions:\n  -h, --help            show this help message and exit\n  --ctfd-instance CTFD_INSTANCE\n                        CTFd instance URL\n  --ctfd-token CTFD_TOKEN\n                        CTFd admin token\n```\n\n### User mode\n\n```bash\nusage: ctfd-cli.py user [-h] {create,delete,update,get,list}\n\npositional arguments:\n  {create,delete,update,get,list}\n    create              Create user\n    delete              Delete user\n    update              Update user\n    get                 Get user\n    list                List users\n\noptions:\n  -h, --help            show this help message and exit\n```\n\n- Create user:\n\n```bash\nusage: ctfd-cli.py user create [-h] --name NAME --password PASSWORD [--email EMAIL] [--team-id TEAM_ID] [--role ROLE]\n                               [--verified VERIFIED] [--banned BANNED] [--hidden HIDDEN]\n\noptions:\n  -h, --help           show this help message and exit\n  --name NAME          Username [required]\n  --password PASSWORD  Password [required]\n  --email EMAIL        Email\n  --team-id TEAM_ID    Team ID\n  --role ROLE          Role\n  --verified VERIFIED  Verified\n  --banned BANNED      Banned\n  --hidden HIDDEN      Hidden\n```\n\n- Delete user:\n\n```bash\nusage: ctfd-cli.py user delete [-h] --user-id USER_ID\n\noptions:\n  -h, --help         show this help message and exit\n  --user-id USER_ID  User ID\n```\n\n- Update user:\n\n```bash\nusage: ctfd-cli.py user update [-h] --user-id USER_ID [--attributes ATTRIBUTES] [--attributes-json ATTRIBUTES_JSON]\n\noptions:\n  -h, --help            show this help message and exit\n  --user-id USER_ID     User ID\n  --attributes ATTRIBUTES\n                        Attributes (passed as a json object)\n  --attributes-json ATTRIBUTES_JSON\n                        Attributes json file\n```\n\nThe update attributes can be plain json object passed from the command-line as follows:\n\n```bash\npython3 ctfdcli.py user update --attributes '{\"banned\": true, \"hidden\": false}'\n```\n\nOr you can pass a json file containing the attributes:\n\n```json: attributes.json\n{\n    \"banned\": true,\n    \"hidden\": false\n}\n```\n\n```bash\npython3 ctfdcli.py user update --attributes-json attributes.json\n```\n\n- Get user:\n\n```bash\nusage: ctfd-cli.py user get [-h] --user-id USER_ID\n```\n\n- List users:\n\nGet a list of all users (Only those that have 'hidden=false' and 'banned=false')\n\n```bash\nusage: ctfd-cli.py user list\n```\n\n### Team mode\n\n\u003e I haven't written the documentation for this but it is complete.\n\n---\n\n### Bulk Add\n\nFor bulk add, you need to run `parse` first, and then just validate. Then running bulk add will automatically add the users and teams to CTFd.\n\n\u003e By design, I've allowed only 3 users per team. You can modify it in `bulker.py:12`\n\n---\n\n## NOTE:\n\nIf someone can help me in writing a full documentation, please make a pull request, I'll review and merge, really busy these days to write a full documentation.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheflash2k%2Fctfd-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheflash2k%2Fctfd-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheflash2k%2Fctfd-cli/lists"}