CTFd / ctfcli

ctfcli is a tool to manage Capture The Flag events and challenges
https://ctfd.io/
Apache License 2.0
165 stars 67 forks source link

add directory option to ctfcli add #123

Closed MilyMilo closed 1 year ago

MilyMilo commented 1 year ago

This adds --directory argument to ctfcli add - useful for grouping challenges into separate directories like: web/challenge1.

Challenges can be always moved, but that breaks ctfcli update (and I imagine others too) - because git will fail to find a subtree that has been manually moved.

ColdHeat commented 1 year ago

I roughly think this is a good idea. I am just not sure if the interface is right.

I think you are proposing this:

ctf challenge add --directory folder-name git@github.com:whatever

Can we perhaps do this:

ctf challenge add git@github.com:whatever folder-name

which is closer to git:

git clone git@github.com:whatever folder-name

Generally I try to follow some of the ideas in the git CLI when trying to do ctfcli things.

MilyMilo commented 1 year ago

It already works like this (optional arguments can apparently be provided with the positional syntax):

ctf challenge add git@github.com:whatever.git folder-name

it works - I checked

I don't know if it's possible to make it a positional argument directly, without making it required.