id = "croc" name = "croc" homepage = "https://github.com/schollz/croc" description = "A tool that allows any two computers to simply and securely transfer files and folders." # The project's own branding asset, from its repository. icon = "https://raw.githubusercontent.com/schollz/croc/main/web/public/branding/croc-head-favicon-256.png" executables = ["croc"] [dotfiles] # src/utils/utils.go, GetConfigDir(): $CROC_CONFIG_DIR wins, then # $XDG_CONFIG_HOME/croc, then ~/.config/croc — and the last one on Windows # too, where it is built from the user's home directory rather than %APPDATA%. # src/cli/cli.go names what lands there: send.json, receive.json, # classic_enabled and best-relay. paths = ["~/.config/croc/"] # best-relay caches whichever public relay answered fastest from this # network. It is measured, not chosen. exclude = [ "~/.config/croc/best-relay", ] # No whole-file credential: send.json and receive.json are mostly transfer # preferences — curve, hash algorithm, ports, overwrite behaviour — with the # two credentials lifted out below. secret = [] # Written when the command finishes and re-read by the next invocation. side_effect = false # saveConfig() in src/cli/cli.go marshals croc.Options straight to JSON with # no struct tags, so the keys are the Go field names verbatim. SharedSecret is # the code phrase that authorises a transfer and RelayPassword the password # of a self-hosted relay; croc writes both with mode 0600 for that reason. [[dotfiles.secret_paths]] file = ["~/.config/croc/send.json", "~/.config/croc/receive.json"] match = { key_path = ["SharedSecret", "RelayPassword"] } [commands] format = 1 label = "Receive files" description = "Receive files with a croc code phrase; use the Send subcommand to send. Relay, proxy and throttle options are left out." quality = "ai-draft" base = "fig:croc" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/croc.ts" license = "MIT" [[commands.field]] id = "code" label = "Code phrase" description = "The code phrase shown by the sender." type = "string" position = 0 sources = ["fig"] [[commands.field]] id = "out" label = "Output folder" type = "path" option = ["--out"] path = { kind = "directory", role = "output", must_exist = false } sources = ["fig"] [[commands.field]] id = "yes" label = "Agree to all prompts" type = "boolean" option = ["--yes"] sources = ["fig"] [[commands.field]] id = "overwrite" label = "Overwrite without prompting" type = "boolean" option = ["--overwrite"] effect = "overwrite" sources = ["fig"] [[commands.field]] id = "local" label = "Local connections only" type = "boolean" option = ["--local"] sources = ["fig"] [[commands.field]] id = "stdout" label = "Write to stdout" type = "boolean" option = ["--stdout"] sources = ["fig"] [[commands.task]] id = "receive" label = "Receive files" fields = ["code", "out", "yes", "local"] required = ["code"] [[commands.group]] id = "basic" label = "Basic" fields = ["code", "out", "yes"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["overwrite", "local", "stdout"] [[commands.subcommand]] path = ["send"] label = "Send files" description = "Send files, a folder or text. Hash, port and multiplexing options are left out." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/croc.ts" license = "MIT" [[commands.subcommand.field]] id = "files" label = "Files or folders" type = "path" position = 0 multiple = true path = { kind = "any", role = "input", must_exist = true } sources = ["fig"] [[commands.subcommand.field]] id = "text" label = "Text to send" description = "Send some text instead of files." type = "string" option = ["--text", "-t"] sources = ["fig"] [[commands.subcommand.field]] id = "code" label = "Custom code phrase" type = "string" option = ["--code", "-c"] sources = ["fig"] [[commands.subcommand.field]] id = "local" label = "Local connections only" type = "boolean" option = ["--local"] sources = ["fig"] [[commands.subcommand.field]] id = "no_compress" label = "Disable compression" type = "boolean" option = ["--no-compress"] sources = ["fig"] [[commands.subcommand.task]] id = "send" label = "Send files" fields = ["files", "code", "local", "no_compress"] required = ["files"] [[commands.subcommand.task]] id = "send-text" label = "Send text" fields = ["text", "code"] required = ["text"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["files", "text", "code"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["local", "no_compress"]