ctfd-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCTFd CLI
CTFd CLI
Keep the shell in the directory that contains the target CTF's . Resolve this
skill's directory to an absolute path and invoke its ; do not change
into the skill directory. The wrapper invokes:
.envscripts/ctfd.shconsole
uvx --from git+https://github.com/p1atdev/ctfd-cli.git ctfd ...Override the source when a branch, tag, commit, fork, or local checkout is required:
console
CTFD_CLI_SOURCE='git+https://github.com/p1atdev/ctfd-cli.git@main' /path/to/skill/scripts/ctfd.sh --help
CTFD_CLI_SOURCE='/path/to/ctfd-cli' /path/to/skill/scripts/ctfd.sh --help请保持Shell处于包含目标CTF的文件的目录中。将此skill的目录解析为绝对路径并调用其;不要切换到该skill目录。该包装器会调用:
.envscripts/ctfd.shconsole
uvx --from git+https://github.com/p1atdev/ctfd-cli.git ctfd ...当需要指定分支、标签、提交记录、复刻仓库或本地检出版本时,可覆盖源地址:
console
CTFD_CLI_SOURCE='git+https://github.com/p1atdev/ctfd-cli.git@main' /path/to/skill/scripts/ctfd.sh --help
CTFD_CLI_SOURCE='/path/to/ctfd-cli' /path/to/skill/scripts/ctfd.sh --helpConfigure Access
配置访问权限
Set , , and optionally in the environment or in
the current directory's .
CTFD_URLCTFD_TOKENCTFD_TIMEOUT.envDo not print, log, or pass on the command line. Prefer environment or
configuration so the token does not appear in process listings or shell history.
CTFD_TOKEN.env在环境变量或当前目录的文件中设置、,可选设置。
.envCTFD_URLCTFD_TOKENCTFD_TIMEOUT请勿在命令行中打印、记录或传递。优先使用环境变量或文件进行配置,以免令牌出现在进程列表或Shell历史记录中。
CTFD_TOKEN.envRun Commands
运行命令
Use before the command for concise, agent-readable output:
--shortconsole
/path/to/skill/scripts/ctfd.sh --short challenges list
/path/to/skill/scripts/ctfd.sh --short challenges show 12
/path/to/skill/scripts/ctfd.sh --short scoreboard
/path/to/skill/scripts/ctfd.sh --short me
/path/to/skill/scripts/ctfd.sh --short me solves
/path/to/skill/scripts/ctfd.sh --short me submissions --challenge-id 12Use instead of when structured output is required:
--json--shortconsole
/path/to/skill/scripts/ctfd.sh challenges list --json
/path/to/skill/scripts/ctfd.sh challenges show 12 --json
/path/to/skill/scripts/ctfd.sh me submissions --jsonForward filters and global connection overrides directly to the CLI. Keep global
options such as , , and before the subcommand.
--url--timeout--short在命令前使用参数以获取简洁、适合Agent读取的输出:
--shortconsole
/path/to/skill/scripts/ctfd.sh --short challenges list
/path/to/skill/scripts/ctfd.sh --short challenges show 12
/path/to/skill/scripts/ctfd.sh --short scoreboard
/path/to/skill/scripts/ctfd.sh --short me
/path/to/skill/scripts/ctfd.sh --short me solves
/path/to/skill/scripts/ctfd.sh --short me submissions --challenge-id 12当需要结构化输出时,使用替代:
--json--shortconsole
/path/to/skill/scripts/ctfd.sh challenges list --json
/path/to/skill/scripts/ctfd.sh challenges show 12 --json
/path/to/skill/scripts/ctfd.sh me submissions --json直接将过滤器和全局连接覆盖参数传递给CLI。请将、和等全局选项放在子命令之前。
--url--timeout--shortMutating Operations
变更操作
Submit a flag only when the user intends that exact value to be submitted:
console
/path/to/skill/scripts/ctfd.sh --short challenges submit 12 'flag{example}'Unlock a paid hint only after explicit user confirmation because it can spend CTF
points:
console
/path/to/skill/scripts/ctfd.sh --short challenges unlock-hint 4Do not retry incorrect submissions automatically.
仅当用户明确要提交特定值时,才提交flag:
console
/path/to/skill/scripts/ctfd.sh --short challenges submit 12 'flag{example}'解锁付费提示前必须获得用户明确确认,因为这会消耗CTF积分:
console
/path/to/skill/scripts/ctfd.sh --short challenges unlock-hint 4请勿自动重试提交错误的内容。
Handle Results
处理结果
Interpret exit codes as follows:
- : success, including a correct or already-solved submission
0 - : operation-level failure, such as an incorrect submission
1 - : missing or invalid configuration
3 - : authentication or permission failure
4 - : network failure
5 - : CTFd API response failure
6
Preserve stdout and stderr when reporting failures, but redact credentials if an
unexpected upstream message contains them.
按以下规则解释退出码:
- :成功,包括提交正确或已解决的题目
0 - :操作级失败,例如提交错误
1 - :配置缺失或无效
3 - :认证或权限失败
4 - :网络失败
5 - :CTFd API响应失败
6
报告失败时保留标准输出和标准错误,但如果意外的上游消息包含凭据,请对其进行脱敏处理。