CLI

Operational command-line tool for managing admin permissions, seeding demo data, and exporting archives.

Edit this page View Markdown

The rctf CLI bundles rCTF’s operational tooling: admin management, database seeding, and static exports.

Invocation

From a source checkout, run it through the root script:

Terminal window
bun rctf user list-admins

The production Docker image includes rctf on PATH, so commands can run inside the container next to the live instance:

Terminal window
docker exec rctf-rctf-1 rctf user list-admins

The CLI reads the same rctf.d/ configuration as the API, or the directory set by RCTF_CONF_PATH, and talks to the database and Redis directly.

Commands

rctf user promote

Grants permissions to the user with the given email. Without --perms, the command grants full admin access.

Terminal window
bun rctf user promote admin@example.com
bun rctf user promote author@example.com --perms challsRead,challsWrite
Flag Default Description
--perms all permissions Comma-separated permission names.

rctf user demote

Resets a user’s permissions to zero.

Terminal window
bun rctf user demote author@example.com

rctf user list-admins

Lists every user holding any permissions.

rctf seed

Wipes the database and fills it with demo data.

Terminal window
bun rctf seed
Warning

Seeding deletes all users, challenges, solves, submissions, and settings. When NODE_ENV=production, the command refuses to run unless --force is passed.

rctf export

Exports a static, read-only archive of a running instance. See Static export for the full flag reference.

Type to search.