From dc15d84953297a9741fca518ccaaba05bb5f9410 Mon Sep 17 00:00:00 2001 From: Danny Ben Shitrit Date: Tue, 9 Dec 2025 12:21:32 +0000 Subject: [PATCH 1/2] - Rename commands: templates > template, files > file --- repli | 226 +++++++++--------- src/bashly.yml | 4 +- src/commands/{files => file}/list.sh | 0 src/commands/{files => file}/upload.sh | 0 .../{templates => template}/delete.sh | 0 src/commands/{templates => template}/edit.sh | 0 src/commands/{templates => template}/list.sh | 0 src/commands/{templates => template}/new.sh | 0 src/commands/{templates => template}/show.sh | 0 test/approvals/repli | 16 +- test/approvals/repli_edit_u_custom_yaml | 1 - test/approvals/{repli_files => repli_file} | 6 +- .../{repli_files_help => repli_file_help} | 6 +- .../{repli_files_list => repli_file_list} | 0 ...i_files_list_help => repli_file_list_help} | 6 +- ...pli_file_upload_fixtures_images_sample_jpg | 3 + ...les_upload_help => repli_file_upload_help} | 6 +- ...li_files_upload_fixtures_images_sample_jpg | 3 - ...pli_files_upload_fixtures_sample_jpg@again | 6 +- test/approvals/repli_get_error | 13 - test/approvals/repli_get_get | 6 - test/approvals/repli_get_myfiles | 6 - test/approvals/repli_get_tmp_get | 6 - test/approvals/repli_get_tmp_get@again | 5 - test/approvals/repli_get_x_get@again | 5 - test/approvals/repli_help | 16 +- .../{repli_templates => repli_template} | 6 +- test/approvals/repli_template_delete | 2 + ...delete_help => repli_template_delete_help} | 6 +- ...=> repli_template_delete_missing_template} | 0 test/approvals/repli_template_delete_model1 | 1 + test/approvals/repli_template_edit | 2 + ...tes_edit_help => repli_template_edit_help} | 6 +- ...e => repli_template_edit_missing_template} | 0 ...edit_model1 => repli_template_edit_model1} | 0 ...pli_templates_help => repli_template_help} | 6 +- ...pli_templates_list => repli_template_list} | 0 ...tes_list_help => repli_template_list_help} | 6 +- ...s_list_model => repli_template_list_model} | 0 ...hmodel => repli_template_list_nosuchmodel} | 0 ...repli_templates_new => repli_template_new} | 2 +- .../repli_template_new_google_nano_banana | 3 + ...epli_template_new_google_nano_banana_force | 3 + ...emplate_new_google_nano_banana_name_banana | 3 + ...lates_new_help => repli_template_new_help} | 6 +- ...not_found => repli_template_new_not_found} | 2 +- test/approvals/repli_template_show | 2 + ...tes_show_help => repli_template_show_help} | 6 +- ...e => repli_template_show_missing_template} | 0 ..._repli_yaml => repli_template_show_model1} | 0 test/approvals/repli_templates_delete | 2 - test/approvals/repli_templates_delete_model1 | 1 - test/approvals/repli_templates_edit | 2 - .../repli_templates_new_google_nano_banana | 3 - ...pli_templates_new_google_nano_banana@exist | 6 +- ...pli_templates_new_google_nano_banana_force | 3 - ...mplates_new_google_nano_banana_name_banana | 3 - test/approvals/repli_templates_show | 2 - test/approvals/repli_templates_show_model1 | 4 - test/spec/file/list.sh | 4 + test/spec/file/upload.sh | 7 + test/spec/file/usage.sh | 4 + test/spec/files/list.sh | 4 - test/spec/files/upload.sh | 7 - test/spec/files/usage.sh | 4 - test/spec/template/delete.sh | 8 + test/spec/template/edit.sh | 8 + test/spec/template/list.sh | 9 + test/spec/template/new.sh | 12 + test/spec/template/show.sh | 8 + test/spec/template/usage.sh | 4 + test/spec/templates/delete.sh | 8 - test/spec/templates/edit.sh | 8 - test/spec/templates/list.sh | 9 - test/spec/templates/new.sh | 12 - test/spec/templates/show.sh | 8 - test/spec/templates/usage.sh | 4 - 77 files changed, 255 insertions(+), 301 deletions(-) rename src/commands/{files => file}/list.sh (100%) rename src/commands/{files => file}/upload.sh (100%) rename src/commands/{templates => template}/delete.sh (100%) rename src/commands/{templates => template}/edit.sh (100%) rename src/commands/{templates => template}/list.sh (100%) rename src/commands/{templates => template}/new.sh (100%) rename src/commands/{templates => template}/show.sh (100%) delete mode 100644 test/approvals/repli_edit_u_custom_yaml rename test/approvals/{repli_files => repli_file} (59%) rename test/approvals/{repli_files_help => repli_file_help} (67%) rename test/approvals/{repli_files_list => repli_file_list} (100%) rename test/approvals/{repli_files_list_help => repli_file_list_help} (64%) create mode 100644 test/approvals/repli_file_upload_fixtures_images_sample_jpg rename test/approvals/{repli_files_upload_help => repli_file_upload_help} (79%) delete mode 100644 test/approvals/repli_files_upload_fixtures_images_sample_jpg delete mode 100644 test/approvals/repli_get_error delete mode 100644 test/approvals/repli_get_get delete mode 100644 test/approvals/repli_get_myfiles delete mode 100644 test/approvals/repli_get_tmp_get delete mode 100644 test/approvals/repli_get_tmp_get@again delete mode 100644 test/approvals/repli_get_x_get@again rename test/approvals/{repli_templates => repli_template} (73%) create mode 100644 test/approvals/repli_template_delete rename test/approvals/{repli_templates_delete_help => repli_template_delete_help} (56%) rename test/approvals/{repli_templates_delete_missing_template => repli_template_delete_missing_template} (100%) create mode 100644 test/approvals/repli_template_delete_model1 create mode 100644 test/approvals/repli_template_edit rename test/approvals/{repli_templates_edit_help => repli_template_edit_help} (66%) rename test/approvals/{repli_templates_edit_missing_template => repli_template_edit_missing_template} (100%) rename test/approvals/{repli_templates_edit_model1 => repli_template_edit_model1} (100%) rename test/approvals/{repli_templates_help => repli_template_help} (77%) rename test/approvals/{repli_templates_list => repli_template_list} (100%) rename test/approvals/{repli_templates_list_help => repli_template_list_help} (57%) rename test/approvals/{repli_templates_list_model => repli_template_list_model} (100%) rename test/approvals/{repli_templates_list_nosuchmodel => repli_template_list_nosuchmodel} (100%) rename test/approvals/{repli_templates_new => repli_template_new} (65%) create mode 100644 test/approvals/repli_template_new_google_nano_banana create mode 100644 test/approvals/repli_template_new_google_nano_banana_force create mode 100644 test/approvals/repli_template_new_google_nano_banana_name_banana rename test/approvals/{repli_templates_new_help => repli_template_new_help} (69%) rename test/approvals/{repli_templates_new_not_found => repli_template_new_not_found} (70%) create mode 100644 test/approvals/repli_template_show rename test/approvals/{repli_templates_show_help => repli_template_show_help} (57%) rename test/approvals/{repli_templates_show_missing_template => repli_template_show_missing_template} (100%) rename test/approvals/{cat_repli_yaml => repli_template_show_model1} (100%) delete mode 100644 test/approvals/repli_templates_delete delete mode 100644 test/approvals/repli_templates_delete_model1 delete mode 100644 test/approvals/repli_templates_edit delete mode 100644 test/approvals/repli_templates_new_google_nano_banana delete mode 100644 test/approvals/repli_templates_new_google_nano_banana_force delete mode 100644 test/approvals/repli_templates_new_google_nano_banana_name_banana delete mode 100644 test/approvals/repli_templates_show delete mode 100644 test/approvals/repli_templates_show_model1 create mode 100644 test/spec/file/list.sh create mode 100644 test/spec/file/upload.sh create mode 100644 test/spec/file/usage.sh delete mode 100644 test/spec/files/list.sh delete mode 100644 test/spec/files/upload.sh delete mode 100644 test/spec/files/usage.sh create mode 100644 test/spec/template/delete.sh create mode 100644 test/spec/template/edit.sh create mode 100644 test/spec/template/list.sh create mode 100644 test/spec/template/new.sh create mode 100644 test/spec/template/show.sh create mode 100644 test/spec/template/usage.sh delete mode 100644 test/spec/templates/delete.sh delete mode 100644 test/spec/templates/edit.sh delete mode 100644 test/spec/templates/list.sh delete mode 100644 test/spec/templates/new.sh delete mode 100644 test/spec/templates/show.sh delete mode 100644 test/spec/templates/usage.sh diff --git a/repli b/repli index 14de956..c0c3b2d 100755 --- a/repli +++ b/repli @@ -26,14 +26,14 @@ repli_usage() { echo # :command.usage_commands printf "%s\n" "$(bold "Commands:")" - printf " %s Create a new configuration file from a tmeplate\n" "$(green "new") " - printf " %s Call Replicate using a configuration file and save the result\n" "$(green "get") " - printf " %s Edit the repli file\n" "$(green "edit") " - printf " %s Show the repli file\n" "$(green "show") " - printf " %s Show repli environment information\n" "$(green "env") " - printf " %s Get information on a model\n" "$(green "info") " - printf " %s Manage templates\n" "$(green "templates")" - printf " %s Manage uploaded files\n" "$(green "files") " + printf " %s Create a new configuration file from a tmeplate\n" "$(green "new") " + printf " %s Call Replicate using a configuration file and save the result\n" "$(green "get") " + printf " %s Edit the repli file\n" "$(green "edit") " + printf " %s Show the repli file\n" "$(green "show") " + printf " %s Show repli environment information\n" "$(green "env") " + printf " %s Get information on a model\n" "$(green "info") " + printf " %s Manage templates\n" "$(green "template")" + printf " %s Manage uploaded files\n" "$(green "file") " echo # :command.long_usage @@ -331,14 +331,14 @@ repli_info_usage() { } # :command.usage -repli_templates_usage() { - printf "repli templates - Manage templates\n\n" +repli_template_usage() { + printf "repli template - Manage templates\n\n" printf "Alias: t\n" echo printf "%s\n" "$(bold "Usage:")" - printf " repli templates COMMAND\n" - printf " repli templates [COMMAND] --help | -h\n" + printf " repli template COMMAND\n" + printf " repli template [COMMAND] --help | -h\n" echo # :command.usage_commands printf "%s\n" "$(bold "Commands:")" @@ -363,14 +363,14 @@ repli_templates_usage() { } # :command.usage -repli_templates_new_usage() { - printf "repli templates new - Add a new template from a remote Replicate model example\n\n" +repli_template_new_usage() { + printf "repli template new - Add a new template from a remote Replicate model example\n\n" printf "Alias: n, add\n" echo printf "%s\n" "$(bold "Usage:")" - printf " repli templates new MODEL [OPTIONS]\n" - printf " repli templates new --help | -h\n" + printf " repli template new MODEL [OPTIONS]\n" + printf " repli template new --help | -h\n" echo # :command.long_usage @@ -412,14 +412,14 @@ repli_templates_new_usage() { } # :command.usage -repli_templates_list_usage() { - printf "repli templates list - Show list of templates\n\n" +repli_template_list_usage() { + printf "repli template list - Show list of templates\n\n" printf "Alias: ls\n" echo printf "%s\n" "$(bold "Usage:")" - printf " repli templates list [SEARCH]\n" - printf " repli templates list --help | -h\n" + printf " repli template list [SEARCH]\n" + printf " repli template list --help | -h\n" echo # :command.long_usage @@ -444,14 +444,14 @@ repli_templates_list_usage() { } # :command.usage -repli_templates_show_usage() { - printf "repli templates show - Show template\n\n" +repli_template_show_usage() { + printf "repli template show - Show template\n\n" printf "Alias: s\n" echo printf "%s\n" "$(bold "Usage:")" - printf " repli templates show TEMPLATE\n" - printf " repli templates show --help | -h\n" + printf " repli template show TEMPLATE\n" + printf " repli template show --help | -h\n" echo # :command.long_usage @@ -476,14 +476,14 @@ repli_templates_show_usage() { } # :command.usage -repli_templates_edit_usage() { - printf "repli templates edit - Open template in editor\n\n" +repli_template_edit_usage() { + printf "repli template edit - Open template in editor\n\n" printf "Alias: e\n" echo printf "%s\n" "$(bold "Usage:")" - printf " repli templates edit TEMPLATE\n" - printf " repli templates edit --help | -h\n" + printf " repli template edit TEMPLATE\n" + printf " repli template edit --help | -h\n" echo # :command.long_usage @@ -517,14 +517,14 @@ repli_templates_edit_usage() { } # :command.usage -repli_templates_delete_usage() { - printf "repli templates delete - Delete template file\n\n" +repli_template_delete_usage() { + printf "repli template delete - Delete template file\n\n" printf "Alias: d, del, rm\n" echo printf "%s\n" "$(bold "Usage:")" - printf " repli templates delete TEMPLATE\n" - printf " repli templates delete --help | -h\n" + printf " repli template delete TEMPLATE\n" + printf " repli template delete --help | -h\n" echo # :command.long_usage @@ -549,14 +549,14 @@ repli_templates_delete_usage() { } # :command.usage -repli_files_usage() { - printf "repli files - Manage uploaded files\n\n" +repli_file_usage() { + printf "repli file - Manage uploaded files\n\n" printf "Alias: f\n" echo printf "%s\n" "$(bold "Usage:")" - printf " repli files COMMAND\n" - printf " repli files [COMMAND] --help | -h\n" + printf " repli file COMMAND\n" + printf " repli file [COMMAND] --help | -h\n" echo # :command.usage_commands printf "%s\n" "$(bold "Commands:")" @@ -578,14 +578,14 @@ repli_files_usage() { } # :command.usage -repli_files_list_usage() { - printf "repli files list - Show list of uploaded files\n\n" +repli_file_list_usage() { + printf "repli file list - Show list of uploaded files\n\n" printf "Alias: ls\n" echo printf "%s\n" "$(bold "Usage:")" - printf " repli files list [OPTIONS]\n" - printf " repli files list --help | -h\n" + printf " repli file list [OPTIONS]\n" + printf " repli file list --help | -h\n" echo # :command.long_usage @@ -613,19 +613,19 @@ repli_files_list_usage() { } # :command.usage -repli_files_upload_usage() { +repli_file_upload_usage() { if [[ -n $long_usage ]]; then - printf "repli files upload\n\n" + printf "repli file upload\n\n" printf " Upload a file to Replicate\n Note that under normal conditions, there should be no reason for you to use\n this directly. Files will be uploaded automatically as needed.\n\n" else - printf "repli files upload - Upload a file to Replicate\n\n" + printf "repli file upload - Upload a file to Replicate\n\n" fi printf "Alias: u\n" echo printf "%s\n" "$(bold "Usage:")" - printf " repli files upload FILE\n" - printf " repli files upload --help | -h\n" + printf " repli file upload FILE\n" + printf " repli file upload --help | -h\n" echo # :command.long_usage @@ -1324,9 +1324,9 @@ repli_info_command() { } # :command.function -repli_templates_new_command() { +repli_template_new_command() { - # src/commands/templates/new.sh + # src/commands/template/new.sh model="${args[model]}" name="${args[--name]}" force="${args[--force]}" @@ -1352,18 +1352,18 @@ repli_templates_new_command() { } # :command.function -repli_templates_list_command() { +repli_template_list_command() { - # src/commands/templates/list.sh + # src/commands/template/list.sh search="${args[search]}" show_templates_list "$search" } # :command.function -repli_templates_show_command() { +repli_template_show_command() { - # src/commands/templates/show.sh + # src/commands/template/show.sh template="${args[template]}" file="$templates_dir/$template.yaml" yq -P -oy "$file" @@ -1371,9 +1371,9 @@ repli_templates_show_command() { } # :command.function -repli_templates_edit_command() { +repli_template_edit_command() { - # src/commands/templates/edit.sh + # src/commands/template/edit.sh template="${args[template]}" file="$templates_dir/$template.yaml" "${EDITOR}" "$file" @@ -1381,9 +1381,9 @@ repli_templates_edit_command() { } # :command.function -repli_templates_delete_command() { +repli_template_delete_command() { - # src/commands/templates/delete.sh + # src/commands/template/delete.sh template="${args[template]}" file="$templates_dir/$template.yaml" log info "deleting $file" @@ -1392,9 +1392,9 @@ repli_templates_delete_command() { } # :command.function -repli_files_list_command() { +repli_file_list_command() { - # src/commands/files/list.sh + # src/commands/file/list.sh plain="${args[--plain]}" json="${args[--json]}" @@ -1412,9 +1412,9 @@ repli_files_list_command() { } # :command.function -repli_files_upload_command() { +repli_file_upload_command() { - # src/commands/files/upload.sh + # src/commands/file/upload.sh file="${args[file]}" files_list="$output_dir/files.ini" @@ -1574,17 +1574,17 @@ parse_requirements() { shift $# ;; - templates | t) - action="templates" + template | t) + action="template" shift - repli_templates_parse_requirements "$@" + repli_template_parse_requirements "$@" shift $# ;; - files | f) - action="files" + file | f) + action="file" shift - repli_files_parse_requirements "$@" + repli_file_parse_requirements "$@" shift $# ;; @@ -2104,7 +2104,7 @@ repli_info_parse_requirements() { } # :command.parse_requirements -repli_templates_parse_requirements() { +repli_template_parse_requirements() { local key # :command.fixed_flags_filter @@ -2113,7 +2113,7 @@ repli_templates_parse_requirements() { case "$key" in --help | -h) long_usage=yes - repli_templates_usage + repli_template_usage exit ;; @@ -2133,41 +2133,41 @@ repli_templates_parse_requirements() { new | n | add) action="new" shift - repli_templates_new_parse_requirements "$@" + repli_template_new_parse_requirements "$@" shift $# ;; list | ls) action="list" shift - repli_templates_list_parse_requirements "$@" + repli_template_list_parse_requirements "$@" shift $# ;; show | s) action="show" shift - repli_templates_show_parse_requirements "$@" + repli_template_show_parse_requirements "$@" shift $# ;; edit | e) action="edit" shift - repli_templates_edit_parse_requirements "$@" + repli_template_edit_parse_requirements "$@" shift $# ;; delete | d | del | rm) action="delete" shift - repli_templates_delete_parse_requirements "$@" + repli_template_delete_parse_requirements "$@" shift $# ;; # :command.command_fallback "") - repli_templates_usage >&2 + repli_template_usage >&2 exit 1 ;; @@ -2202,7 +2202,7 @@ repli_templates_parse_requirements() { } # :command.parse_requirements -repli_templates_new_parse_requirements() { +repli_template_new_parse_requirements() { local key # :command.fixed_flags_filter @@ -2211,7 +2211,7 @@ repli_templates_new_parse_requirements() { case "$key" in --help | -h) long_usage=yes - repli_templates_new_usage + repli_template_new_usage exit ;; @@ -2223,7 +2223,7 @@ repli_templates_new_parse_requirements() { done # :command.command_filter - action="templates new" + action="template new" # :command.parse_requirements_while while [[ $# -gt 0 ]]; do @@ -2275,7 +2275,7 @@ repli_templates_new_parse_requirements() { # :command.required_args_filter if [[ -z ${args['model']+x} ]]; then - printf "missing required argument: MODEL\nusage: repli templates new MODEL [OPTIONS]\n" >&2 + printf "missing required argument: MODEL\nusage: repli template new MODEL [OPTIONS]\n" >&2 # :command.examples_on_error printf "examples:\n" >&2 printf " repli add google/nano-banana banana\n" >&2 @@ -2299,7 +2299,7 @@ repli_templates_new_parse_requirements() { } # :command.parse_requirements -repli_templates_list_parse_requirements() { +repli_template_list_parse_requirements() { local key # :command.fixed_flags_filter @@ -2308,7 +2308,7 @@ repli_templates_list_parse_requirements() { case "$key" in --help | -h) long_usage=yes - repli_templates_list_usage + repli_template_list_usage exit ;; @@ -2320,7 +2320,7 @@ repli_templates_list_parse_requirements() { done # :command.command_filter - action="templates list" + action="template list" # :command.parse_requirements_while while [[ $# -gt 0 ]]; do @@ -2359,7 +2359,7 @@ repli_templates_list_parse_requirements() { } # :command.parse_requirements -repli_templates_show_parse_requirements() { +repli_template_show_parse_requirements() { local key # :command.fixed_flags_filter @@ -2368,7 +2368,7 @@ repli_templates_show_parse_requirements() { case "$key" in --help | -h) long_usage=yes - repli_templates_show_usage + repli_template_show_usage exit ;; @@ -2380,7 +2380,7 @@ repli_templates_show_parse_requirements() { done # :command.command_filter - action="templates show" + action="template show" # :command.parse_requirements_while while [[ $# -gt 0 ]]; do @@ -2411,7 +2411,7 @@ repli_templates_show_parse_requirements() { # :command.required_args_filter if [[ -z ${args['template']+x} ]]; then - printf "missing required argument: TEMPLATE\nusage: repli templates show TEMPLATE\n" >&2 + printf "missing required argument: TEMPLATE\nusage: repli template show TEMPLATE\n" >&2 exit 1 fi @@ -2436,7 +2436,7 @@ repli_templates_show_parse_requirements() { } # :command.parse_requirements -repli_templates_edit_parse_requirements() { +repli_template_edit_parse_requirements() { local key # :command.fixed_flags_filter @@ -2445,7 +2445,7 @@ repli_templates_edit_parse_requirements() { case "$key" in --help | -h) long_usage=yes - repli_templates_edit_usage + repli_template_edit_usage exit ;; @@ -2463,7 +2463,7 @@ repli_templates_edit_parse_requirements() { env_var_names+=("EDITOR") # :command.command_filter - action="templates edit" + action="template edit" # :command.parse_requirements_while while [[ $# -gt 0 ]]; do @@ -2494,7 +2494,7 @@ repli_templates_edit_parse_requirements() { # :command.required_args_filter if [[ -z ${args['template']+x} ]]; then - printf "missing required argument: TEMPLATE\nusage: repli templates edit TEMPLATE\n" >&2 + printf "missing required argument: TEMPLATE\nusage: repli template edit TEMPLATE\n" >&2 exit 1 fi @@ -2519,7 +2519,7 @@ repli_templates_edit_parse_requirements() { } # :command.parse_requirements -repli_templates_delete_parse_requirements() { +repli_template_delete_parse_requirements() { local key # :command.fixed_flags_filter @@ -2528,7 +2528,7 @@ repli_templates_delete_parse_requirements() { case "$key" in --help | -h) long_usage=yes - repli_templates_delete_usage + repli_template_delete_usage exit ;; @@ -2540,7 +2540,7 @@ repli_templates_delete_parse_requirements() { done # :command.command_filter - action="templates delete" + action="template delete" # :command.parse_requirements_while while [[ $# -gt 0 ]]; do @@ -2571,7 +2571,7 @@ repli_templates_delete_parse_requirements() { # :command.required_args_filter if [[ -z ${args['template']+x} ]]; then - printf "missing required argument: TEMPLATE\nusage: repli templates delete TEMPLATE\n" >&2 + printf "missing required argument: TEMPLATE\nusage: repli template delete TEMPLATE\n" >&2 exit 1 fi @@ -2596,7 +2596,7 @@ repli_templates_delete_parse_requirements() { } # :command.parse_requirements -repli_files_parse_requirements() { +repli_file_parse_requirements() { local key # :command.fixed_flags_filter @@ -2605,7 +2605,7 @@ repli_files_parse_requirements() { case "$key" in --help | -h) long_usage=yes - repli_files_usage + repli_file_usage exit ;; @@ -2625,20 +2625,20 @@ repli_files_parse_requirements() { list | ls) action="list" shift - repli_files_list_parse_requirements "$@" + repli_file_list_parse_requirements "$@" shift $# ;; upload | u) action="upload" shift - repli_files_upload_parse_requirements "$@" + repli_file_upload_parse_requirements "$@" shift $# ;; # :command.command_fallback "") - repli_files_usage >&2 + repli_file_usage >&2 exit 1 ;; @@ -2673,7 +2673,7 @@ repli_files_parse_requirements() { } # :command.parse_requirements -repli_files_list_parse_requirements() { +repli_file_list_parse_requirements() { local key # :command.fixed_flags_filter @@ -2682,7 +2682,7 @@ repli_files_list_parse_requirements() { case "$key" in --help | -h) long_usage=yes - repli_files_list_usage + repli_file_list_usage exit ;; @@ -2694,7 +2694,7 @@ repli_files_list_parse_requirements() { done # :command.command_filter - action="files list" + action="file list" # :command.parse_requirements_while while [[ $# -gt 0 ]]; do @@ -2735,7 +2735,7 @@ repli_files_list_parse_requirements() { } # :command.parse_requirements -repli_files_upload_parse_requirements() { +repli_file_upload_parse_requirements() { local key # :command.fixed_flags_filter @@ -2744,7 +2744,7 @@ repli_files_upload_parse_requirements() { case "$key" in --help | -h) long_usage=yes - repli_files_upload_usage + repli_file_upload_usage exit ;; @@ -2756,7 +2756,7 @@ repli_files_upload_parse_requirements() { done # :command.command_filter - action="files upload" + action="file upload" # :command.parse_requirements_while while [[ $# -gt 0 ]]; do @@ -2787,7 +2787,7 @@ repli_files_upload_parse_requirements() { # :command.required_args_filter if [[ -z ${args['file']+x} ]]; then - printf "missing required argument: FILE\nusage: repli files upload FILE\n" >&2 + printf "missing required argument: FILE\nusage: repli file upload FILE\n" >&2 exit 1 fi @@ -2850,15 +2850,15 @@ run() { "show") repli_show_command ;; "env") repli_env_command ;; "info") repli_info_command ;; - "templates") repli_templates_command ;; - "templates new") repli_templates_new_command ;; - "templates list") repli_templates_list_command ;; - "templates show") repli_templates_show_command ;; - "templates edit") repli_templates_edit_command ;; - "templates delete") repli_templates_delete_command ;; - "files") repli_files_command ;; - "files list") repli_files_list_command ;; - "files upload") repli_files_upload_command ;; + "template") repli_template_command ;; + "template new") repli_template_new_command ;; + "template list") repli_template_list_command ;; + "template show") repli_template_show_command ;; + "template edit") repli_template_edit_command ;; + "template delete") repli_template_delete_command ;; + "file") repli_file_command ;; + "file list") repli_file_list_command ;; + "file upload") repli_file_upload_command ;; esac } diff --git a/src/bashly.yml b/src/bashly.yml index e078d71..3c02ffc 100644 --- a/src/bashly.yml +++ b/src/bashly.yml @@ -138,7 +138,7 @@ commands: - repli info google/nano-banana - repli info google/nano-banana --example --plain --json -- name: templates +- name: template alias: t help: Manage templates commands: @@ -200,7 +200,7 @@ commands: filters: [templates_dir_exists] args: [*template] -- name: files +- name: file alias: f help: Manage uploaded files diff --git a/src/commands/files/list.sh b/src/commands/file/list.sh similarity index 100% rename from src/commands/files/list.sh rename to src/commands/file/list.sh diff --git a/src/commands/files/upload.sh b/src/commands/file/upload.sh similarity index 100% rename from src/commands/files/upload.sh rename to src/commands/file/upload.sh diff --git a/src/commands/templates/delete.sh b/src/commands/template/delete.sh similarity index 100% rename from src/commands/templates/delete.sh rename to src/commands/template/delete.sh diff --git a/src/commands/templates/edit.sh b/src/commands/template/edit.sh similarity index 100% rename from src/commands/templates/edit.sh rename to src/commands/template/edit.sh diff --git a/src/commands/templates/list.sh b/src/commands/template/list.sh similarity index 100% rename from src/commands/templates/list.sh rename to src/commands/template/list.sh diff --git a/src/commands/templates/new.sh b/src/commands/template/new.sh similarity index 100% rename from src/commands/templates/new.sh rename to src/commands/template/new.sh diff --git a/src/commands/templates/show.sh b/src/commands/template/show.sh similarity index 100% rename from src/commands/templates/show.sh rename to src/commands/template/show.sh diff --git a/test/approvals/repli b/test/approvals/repli index 85cc955..917b1b0 100644 --- a/test/approvals/repli +++ b/test/approvals/repli @@ -6,11 +6,11 @@ repli - Replicate AI Workspace Tool repli --version | -v Commands: - new Create a new configuration file from a tmeplate - get Call Replicate using a configuration file and save the result - edit Edit the repli file - show Show the repli file - env Show repli environment information - info Get information on a model - templates Manage templates - files Manage uploaded files + new Create a new configuration file from a tmeplate + get Call Replicate using a configuration file and save the result + edit Edit the repli file + show Show the repli file + env Show repli environment information + info Get information on a model + template Manage templates + file Manage uploaded files diff --git a/test/approvals/repli_edit_u_custom_yaml b/test/approvals/repli_edit_u_custom_yaml deleted file mode 100644 index 00f1454..0000000 --- a/test/approvals/repli_edit_u_custom_yaml +++ /dev/null @@ -1 +0,0 @@ -editstub custom.yaml diff --git a/test/approvals/repli_files b/test/approvals/repli_file similarity index 59% rename from test/approvals/repli_files rename to test/approvals/repli_file index 0cd2001..e637261 100644 --- a/test/approvals/repli_files +++ b/test/approvals/repli_file @@ -1,10 +1,10 @@ -repli files - Manage uploaded files +repli file - Manage uploaded files Alias: f Usage: - repli files COMMAND - repli files [COMMAND] --help | -h + repli file COMMAND + repli file [COMMAND] --help | -h Commands: list Show list of uploaded files diff --git a/test/approvals/repli_files_help b/test/approvals/repli_file_help similarity index 67% rename from test/approvals/repli_files_help rename to test/approvals/repli_file_help index b69a7ed..c00aa68 100644 --- a/test/approvals/repli_files_help +++ b/test/approvals/repli_file_help @@ -1,10 +1,10 @@ -repli files - Manage uploaded files +repli file - Manage uploaded files Alias: f Usage: - repli files COMMAND - repli files [COMMAND] --help | -h + repli file COMMAND + repli file [COMMAND] --help | -h Commands: list Show list of uploaded files diff --git a/test/approvals/repli_files_list b/test/approvals/repli_file_list similarity index 100% rename from test/approvals/repli_files_list rename to test/approvals/repli_file_list diff --git a/test/approvals/repli_files_list_help b/test/approvals/repli_file_list_help similarity index 64% rename from test/approvals/repli_files_list_help rename to test/approvals/repli_file_list_help index be15cce..8a825aa 100644 --- a/test/approvals/repli_files_list_help +++ b/test/approvals/repli_file_list_help @@ -1,10 +1,10 @@ -repli files list - Show list of uploaded files +repli file list - Show list of uploaded files Alias: ls Usage: - repli files list [OPTIONS] - repli files list --help | -h + repli file list [OPTIONS] + repli file list --help | -h Options: --plain, -p diff --git a/test/approvals/repli_file_upload_fixtures_images_sample_jpg b/test/approvals/repli_file_upload_fixtures_images_sample_jpg new file mode 100644 index 0000000..0a5bb97 --- /dev/null +++ b/test/approvals/repli_file_upload_fixtures_images_sample_jpg @@ -0,0 +1,3 @@ +• info • repli_file_upload_command → uploading fixtures/images/sample.jpg +• info • repli_file_upload_command → url: https://api.replicate.com/v1/files/some-hash +• info • repli_file_upload_command → saving URL to tmp/files.ini diff --git a/test/approvals/repli_files_upload_help b/test/approvals/repli_file_upload_help similarity index 79% rename from test/approvals/repli_files_upload_help rename to test/approvals/repli_file_upload_help index 878fa45..2501d1e 100644 --- a/test/approvals/repli_files_upload_help +++ b/test/approvals/repli_file_upload_help @@ -1,4 +1,4 @@ -repli files upload +repli file upload Upload a file to Replicate Note that under normal conditions, there should be no reason for you to use @@ -7,8 +7,8 @@ repli files upload Alias: u Usage: - repli files upload FILE - repli files upload --help | -h + repli file upload FILE + repli file upload --help | -h Options: --help, -h diff --git a/test/approvals/repli_files_upload_fixtures_images_sample_jpg b/test/approvals/repli_files_upload_fixtures_images_sample_jpg deleted file mode 100644 index 59ef7a3..0000000 --- a/test/approvals/repli_files_upload_fixtures_images_sample_jpg +++ /dev/null @@ -1,3 +0,0 @@ -• info • repli_files_upload_command → uploading fixtures/images/sample.jpg -• info • repli_files_upload_command → url: https://api.replicate.com/v1/files/some-hash -• info • repli_files_upload_command → saving URL to tmp/files.ini diff --git a/test/approvals/repli_files_upload_fixtures_sample_jpg@again b/test/approvals/repli_files_upload_fixtures_sample_jpg@again index 6fc5b60..b3cec8e 100644 --- a/test/approvals/repli_files_upload_fixtures_sample_jpg@again +++ b/test/approvals/repli_files_upload_fixtures_sample_jpg@again @@ -1,3 +1,3 @@ -• debug • repli_files_upload_command → reading files list: tmp/files.ini -• info • repli_files_upload_command → upload skipped, already registered in tmp/files.ini -• info • repli_files_upload_command → url: https://api.replicate.com/v1/files/some-hash +• debug • repli_file_upload_command → reading files list: tmp/files.ini +• info • repli_file_upload_command → upload skipped, already registered in tmp/files.ini +• info • repli_file_upload_command → url: https://api.replicate.com/v1/files/some-hash diff --git a/test/approvals/repli_get_error b/test/approvals/repli_get_error deleted file mode 100644 index 8106324..0000000 --- a/test/approvals/repli_get_error +++ /dev/null @@ -1,13 +0,0 @@ -• debug • repli_get_command → config: repli.yaml -• debug • repli_get_command → prefix: repli-1 -• debug • repli_get_command → outfile: repli-1.json -• info • repli_get_command → calling API and saving repli-1.json -• error • verify_success_json → received invalid response: -detail: | - - input.image_input.0: Invalid type. Expected: string, given: object -status: 422 -title: Input validation failed -invalid_fields: - - type: invalid_type - field: input.image_input.0 - description: 'Invalid type. Expected: string, given: object' diff --git a/test/approvals/repli_get_get b/test/approvals/repli_get_get deleted file mode 100644 index 9009a97..0000000 --- a/test/approvals/repli_get_get +++ /dev/null @@ -1,6 +0,0 @@ -• debug • repli_get_command → config: tmp/repli.yaml -• debug • repli_get_command → prefix: get -• debug • repli_get_command → outfile: tmp/get.json -• info • repli_get_command → calling API and saving tmp/get.json -• debug • download_outputs → downloading from: http://localhost:3000/assets/out-0.jpg -• info • download_outputs → downloading to tmp/get_out-0.jpg diff --git a/test/approvals/repli_get_myfiles b/test/approvals/repli_get_myfiles deleted file mode 100644 index 64d037b..0000000 --- a/test/approvals/repli_get_myfiles +++ /dev/null @@ -1,6 +0,0 @@ -• debug • repli_get_command → config: tmp/repli.yaml -• debug • repli_get_command → prefix: myfiles -• debug • repli_get_command → outfile: tmp/myfiles.json -• info • repli_get_command → calling API and saving tmp/myfiles.json -• debug • download_outputs → downloading from: http://localhost:3000/assets/out-0.jpg -• info • download_outputs → downloading to tmp/myfiles_out-0.jpg diff --git a/test/approvals/repli_get_tmp_get b/test/approvals/repli_get_tmp_get deleted file mode 100644 index 45916d6..0000000 --- a/test/approvals/repli_get_tmp_get +++ /dev/null @@ -1,6 +0,0 @@ -• debug • repli_get_command → config: tmp/repli.yaml -• debug • repli_get_command → prefix: tmp/get -• debug • repli_get_command → outfile: tmp/get.json -• info • repli_get_command → calling API and saving tmp/get.json -• debug • download_outputs → downloading from: http://localhost:3000/assets/out-0.jpg -• info • download_outputs → downloading to tmp/get_out-0.jpg diff --git a/test/approvals/repli_get_tmp_get@again b/test/approvals/repli_get_tmp_get@again deleted file mode 100644 index 375116a..0000000 --- a/test/approvals/repli_get_tmp_get@again +++ /dev/null @@ -1,5 +0,0 @@ -• debug • repli_get_command → config: tmp/repli.yaml -• debug • repli_get_command → prefix: tmp/get -• debug • repli_get_command → outfile: tmp/get.json -• info • repli_get_command → skipping API call, file exists: tmp/get.json -• info • download_outputs → skipping download, file exists: tmp/get_out-0.jpg diff --git a/test/approvals/repli_get_x_get@again b/test/approvals/repli_get_x_get@again deleted file mode 100644 index bef9d3f..0000000 --- a/test/approvals/repli_get_x_get@again +++ /dev/null @@ -1,5 +0,0 @@ -• debug • repli_get_command → config: tmp/repli.yaml -• debug • repli_get_command → prefix: x -• debug • repli_get_command → outfile: tmp/x.json -• info • repli_get_command → skipping API call, file exists: tmp/x.json -• info • download_outputs → skipping download, file exists: tmp/x_out-0.jpg diff --git a/test/approvals/repli_help b/test/approvals/repli_help index f265c91..1b78e69 100644 --- a/test/approvals/repli_help +++ b/test/approvals/repli_help @@ -6,14 +6,14 @@ repli - Replicate AI Workspace Tool repli --version | -v Commands: - new Create a new configuration file from a tmeplate - get Call Replicate using a configuration file and save the result - edit Edit the repli file - show Show the repli file - env Show repli environment information - info Get information on a model - templates Manage templates - files Manage uploaded files + new Create a new configuration file from a tmeplate + get Call Replicate using a configuration file and save the result + edit Edit the repli file + show Show the repli file + env Show repli environment information + info Get information on a model + template Manage templates + file Manage uploaded files Options: --help, -h diff --git a/test/approvals/repli_templates b/test/approvals/repli_template similarity index 73% rename from test/approvals/repli_templates rename to test/approvals/repli_template index 03755a6..5ee0a37 100644 --- a/test/approvals/repli_templates +++ b/test/approvals/repli_template @@ -1,10 +1,10 @@ -repli templates - Manage templates +repli template - Manage templates Alias: t Usage: - repli templates COMMAND - repli templates [COMMAND] --help | -h + repli template COMMAND + repli template [COMMAND] --help | -h Commands: new Add a new template from a remote Replicate model example diff --git a/test/approvals/repli_template_delete b/test/approvals/repli_template_delete new file mode 100644 index 0000000..6f3374d --- /dev/null +++ b/test/approvals/repli_template_delete @@ -0,0 +1,2 @@ +missing required argument: TEMPLATE +usage: repli template delete TEMPLATE diff --git a/test/approvals/repli_templates_delete_help b/test/approvals/repli_template_delete_help similarity index 56% rename from test/approvals/repli_templates_delete_help rename to test/approvals/repli_template_delete_help index 9631501..3484229 100644 --- a/test/approvals/repli_templates_delete_help +++ b/test/approvals/repli_template_delete_help @@ -1,10 +1,10 @@ -repli templates delete - Delete template file +repli template delete - Delete template file Alias: d, del, rm Usage: - repli templates delete TEMPLATE - repli templates delete --help | -h + repli template delete TEMPLATE + repli template delete --help | -h Options: --help, -h diff --git a/test/approvals/repli_templates_delete_missing_template b/test/approvals/repli_template_delete_missing_template similarity index 100% rename from test/approvals/repli_templates_delete_missing_template rename to test/approvals/repli_template_delete_missing_template diff --git a/test/approvals/repli_template_delete_model1 b/test/approvals/repli_template_delete_model1 new file mode 100644 index 0000000..bcfd170 --- /dev/null +++ b/test/approvals/repli_template_delete_model1 @@ -0,0 +1 @@ +• info • repli_template_delete_command → deleting tmp/templates/model1.yaml diff --git a/test/approvals/repli_template_edit b/test/approvals/repli_template_edit new file mode 100644 index 0000000..db89f29 --- /dev/null +++ b/test/approvals/repli_template_edit @@ -0,0 +1,2 @@ +missing required argument: TEMPLATE +usage: repli template edit TEMPLATE diff --git a/test/approvals/repli_templates_edit_help b/test/approvals/repli_template_edit_help similarity index 66% rename from test/approvals/repli_templates_edit_help rename to test/approvals/repli_template_edit_help index c968191..3d1c4b5 100644 --- a/test/approvals/repli_templates_edit_help +++ b/test/approvals/repli_template_edit_help @@ -1,10 +1,10 @@ -repli templates edit - Open template in editor +repli template edit - Open template in editor Alias: e Usage: - repli templates edit TEMPLATE - repli templates edit --help | -h + repli template edit TEMPLATE + repli template edit --help | -h Options: --help, -h diff --git a/test/approvals/repli_templates_edit_missing_template b/test/approvals/repli_template_edit_missing_template similarity index 100% rename from test/approvals/repli_templates_edit_missing_template rename to test/approvals/repli_template_edit_missing_template diff --git a/test/approvals/repli_templates_edit_model1 b/test/approvals/repli_template_edit_model1 similarity index 100% rename from test/approvals/repli_templates_edit_model1 rename to test/approvals/repli_template_edit_model1 diff --git a/test/approvals/repli_templates_help b/test/approvals/repli_template_help similarity index 77% rename from test/approvals/repli_templates_help rename to test/approvals/repli_template_help index 873b445..860be85 100644 --- a/test/approvals/repli_templates_help +++ b/test/approvals/repli_template_help @@ -1,10 +1,10 @@ -repli templates - Manage templates +repli template - Manage templates Alias: t Usage: - repli templates COMMAND - repli templates [COMMAND] --help | -h + repli template COMMAND + repli template [COMMAND] --help | -h Commands: new Add a new template from a remote Replicate model example diff --git a/test/approvals/repli_templates_list b/test/approvals/repli_template_list similarity index 100% rename from test/approvals/repli_templates_list rename to test/approvals/repli_template_list diff --git a/test/approvals/repli_templates_list_help b/test/approvals/repli_template_list_help similarity index 57% rename from test/approvals/repli_templates_list_help rename to test/approvals/repli_template_list_help index a4ffec1..6b7f23c 100644 --- a/test/approvals/repli_templates_list_help +++ b/test/approvals/repli_template_list_help @@ -1,10 +1,10 @@ -repli templates list - Show list of templates +repli template list - Show list of templates Alias: ls Usage: - repli templates list [SEARCH] - repli templates list --help | -h + repli template list [SEARCH] + repli template list --help | -h Options: --help, -h diff --git a/test/approvals/repli_templates_list_model b/test/approvals/repli_template_list_model similarity index 100% rename from test/approvals/repli_templates_list_model rename to test/approvals/repli_template_list_model diff --git a/test/approvals/repli_templates_list_nosuchmodel b/test/approvals/repli_template_list_nosuchmodel similarity index 100% rename from test/approvals/repli_templates_list_nosuchmodel rename to test/approvals/repli_template_list_nosuchmodel diff --git a/test/approvals/repli_templates_new b/test/approvals/repli_template_new similarity index 65% rename from test/approvals/repli_templates_new rename to test/approvals/repli_template_new index 2dbfddb..fda7d76 100644 --- a/test/approvals/repli_templates_new +++ b/test/approvals/repli_template_new @@ -1,4 +1,4 @@ missing required argument: MODEL -usage: repli templates new MODEL [OPTIONS] +usage: repli template new MODEL [OPTIONS] examples: repli add google/nano-banana banana diff --git a/test/approvals/repli_template_new_google_nano_banana b/test/approvals/repli_template_new_google_nano_banana new file mode 100644 index 0000000..d96e0f1 --- /dev/null +++ b/test/approvals/repli_template_new_google_nano_banana @@ -0,0 +1,3 @@ +• debug • repli_template_new_command → fetching example for google/nano-banana +• debug • get_model_info → calling replicate API +• info • repli_template_new_command → saving to tmp/templates/nano-banana.yaml diff --git a/test/approvals/repli_template_new_google_nano_banana_force b/test/approvals/repli_template_new_google_nano_banana_force new file mode 100644 index 0000000..d96e0f1 --- /dev/null +++ b/test/approvals/repli_template_new_google_nano_banana_force @@ -0,0 +1,3 @@ +• debug • repli_template_new_command → fetching example for google/nano-banana +• debug • get_model_info → calling replicate API +• info • repli_template_new_command → saving to tmp/templates/nano-banana.yaml diff --git a/test/approvals/repli_template_new_google_nano_banana_name_banana b/test/approvals/repli_template_new_google_nano_banana_name_banana new file mode 100644 index 0000000..42d809d --- /dev/null +++ b/test/approvals/repli_template_new_google_nano_banana_name_banana @@ -0,0 +1,3 @@ +• debug • repli_template_new_command → fetching example for google/nano-banana +• debug • get_model_info → calling replicate API +• info • repli_template_new_command → saving to tmp/templates/banana.yaml diff --git a/test/approvals/repli_templates_new_help b/test/approvals/repli_template_new_help similarity index 69% rename from test/approvals/repli_templates_new_help rename to test/approvals/repli_template_new_help index e888b9b..0c89f20 100644 --- a/test/approvals/repli_templates_new_help +++ b/test/approvals/repli_template_new_help @@ -1,10 +1,10 @@ -repli templates new - Add a new template from a remote Replicate model example +repli template new - Add a new template from a remote Replicate model example Alias: n, add Usage: - repli templates new MODEL [OPTIONS] - repli templates new --help | -h + repli template new MODEL [OPTIONS] + repli template new --help | -h Options: --force, -f diff --git a/test/approvals/repli_templates_new_not_found b/test/approvals/repli_template_new_not_found similarity index 70% rename from test/approvals/repli_templates_new_not_found rename to test/approvals/repli_template_new_not_found index c02ae75..5129a21 100644 --- a/test/approvals/repli_templates_new_not_found +++ b/test/approvals/repli_template_new_not_found @@ -1,4 +1,4 @@ -• debug • repli_templates_new_command → fetching example for not/found +• debug • repli_template_new_command → fetching example for not/found • debug • get_model_info → calling replicate API • error • get_model_info → failed getting model info for not/found • error • get_model_info → (404) diff --git a/test/approvals/repli_template_show b/test/approvals/repli_template_show new file mode 100644 index 0000000..d763822 --- /dev/null +++ b/test/approvals/repli_template_show @@ -0,0 +1,2 @@ +missing required argument: TEMPLATE +usage: repli template show TEMPLATE diff --git a/test/approvals/repli_templates_show_help b/test/approvals/repli_template_show_help similarity index 57% rename from test/approvals/repli_templates_show_help rename to test/approvals/repli_template_show_help index 375417b..776b862 100644 --- a/test/approvals/repli_templates_show_help +++ b/test/approvals/repli_template_show_help @@ -1,10 +1,10 @@ -repli templates show - Show template +repli template show - Show template Alias: s Usage: - repli templates show TEMPLATE - repli templates show --help | -h + repli template show TEMPLATE + repli template show --help | -h Options: --help, -h diff --git a/test/approvals/repli_templates_show_missing_template b/test/approvals/repli_template_show_missing_template similarity index 100% rename from test/approvals/repli_templates_show_missing_template rename to test/approvals/repli_template_show_missing_template diff --git a/test/approvals/cat_repli_yaml b/test/approvals/repli_template_show_model1 similarity index 100% rename from test/approvals/cat_repli_yaml rename to test/approvals/repli_template_show_model1 diff --git a/test/approvals/repli_templates_delete b/test/approvals/repli_templates_delete deleted file mode 100644 index cb5c097..0000000 --- a/test/approvals/repli_templates_delete +++ /dev/null @@ -1,2 +0,0 @@ -missing required argument: TEMPLATE -usage: repli templates delete TEMPLATE diff --git a/test/approvals/repli_templates_delete_model1 b/test/approvals/repli_templates_delete_model1 deleted file mode 100644 index 48cbcbb..0000000 --- a/test/approvals/repli_templates_delete_model1 +++ /dev/null @@ -1 +0,0 @@ -• info • repli_templates_delete_command → deleting tmp/templates/model1.yaml diff --git a/test/approvals/repli_templates_edit b/test/approvals/repli_templates_edit deleted file mode 100644 index adc8861..0000000 --- a/test/approvals/repli_templates_edit +++ /dev/null @@ -1,2 +0,0 @@ -missing required argument: TEMPLATE -usage: repli templates edit TEMPLATE diff --git a/test/approvals/repli_templates_new_google_nano_banana b/test/approvals/repli_templates_new_google_nano_banana deleted file mode 100644 index 5cd4406..0000000 --- a/test/approvals/repli_templates_new_google_nano_banana +++ /dev/null @@ -1,3 +0,0 @@ -• debug • repli_templates_new_command → fetching example for google/nano-banana -• debug • get_model_info → calling replicate API -• info • repli_templates_new_command → saving to tmp/templates/nano-banana.yaml diff --git a/test/approvals/repli_templates_new_google_nano_banana@exist b/test/approvals/repli_templates_new_google_nano_banana@exist index af846b2..0248f7d 100644 --- a/test/approvals/repli_templates_new_google_nano_banana@exist +++ b/test/approvals/repli_templates_new_google_nano_banana@exist @@ -1,3 +1,3 @@ -• debug • repli_templates_new_command → target: tmp/templates/nano-banana.yaml -• error • repli_templates_new_command → target already exists: nano-banana -• info • repli_templates_new_command → use --force to overwrite or --output NAME to save with another name +• debug • repli_template_new_command → target: tmp/templates/nano-banana.yaml +• error • repli_template_new_command → target already exists: nano-banana +• info • repli_template_new_command → use --force to overwrite or --output NAME to save with another name diff --git a/test/approvals/repli_templates_new_google_nano_banana_force b/test/approvals/repli_templates_new_google_nano_banana_force deleted file mode 100644 index 5cd4406..0000000 --- a/test/approvals/repli_templates_new_google_nano_banana_force +++ /dev/null @@ -1,3 +0,0 @@ -• debug • repli_templates_new_command → fetching example for google/nano-banana -• debug • get_model_info → calling replicate API -• info • repli_templates_new_command → saving to tmp/templates/nano-banana.yaml diff --git a/test/approvals/repli_templates_new_google_nano_banana_name_banana b/test/approvals/repli_templates_new_google_nano_banana_name_banana deleted file mode 100644 index 204385f..0000000 --- a/test/approvals/repli_templates_new_google_nano_banana_name_banana +++ /dev/null @@ -1,3 +0,0 @@ -• debug • repli_templates_new_command → fetching example for google/nano-banana -• debug • get_model_info → calling replicate API -• info • repli_templates_new_command → saving to tmp/templates/banana.yaml diff --git a/test/approvals/repli_templates_show b/test/approvals/repli_templates_show deleted file mode 100644 index d166990..0000000 --- a/test/approvals/repli_templates_show +++ /dev/null @@ -1,2 +0,0 @@ -missing required argument: TEMPLATE -usage: repli templates show TEMPLATE diff --git a/test/approvals/repli_templates_show_model1 b/test/approvals/repli_templates_show_model1 deleted file mode 100644 index f0296bf..0000000 --- a/test/approvals/repli_templates_show_model1 +++ /dev/null @@ -1,4 +0,0 @@ -model: google/nano-banana -input: - prompt: an image of a JSON file - output_format: jpg diff --git a/test/spec/file/list.sh b/test/spec/file/list.sh new file mode 100644 index 0000000..10c36c8 --- /dev/null +++ b/test/spec/file/list.sh @@ -0,0 +1,4 @@ +describe "files list" + approve "repli file list --help" + approve "repli file list" + diff --git a/test/spec/file/upload.sh b/test/spec/file/upload.sh new file mode 100644 index 0000000..2d6caf6 --- /dev/null +++ b/test/spec/file/upload.sh @@ -0,0 +1,7 @@ +describe "files upload" + reset_state + approve "repli file upload --help" + approve "repli file upload --help" + approve "repli file upload fixtures/images/sample.jpg" + approve "repli file upload fixtures/images/sample.jpg" "repli_files_upload_fixtures_sample_jpg@again" + rm "$output_dir/files.ini" diff --git a/test/spec/file/usage.sh b/test/spec/file/usage.sh new file mode 100644 index 0000000..7461aba --- /dev/null +++ b/test/spec/file/usage.sh @@ -0,0 +1,4 @@ +describe "files" + approve "repli file --help" + approve "repli file" + diff --git a/test/spec/files/list.sh b/test/spec/files/list.sh deleted file mode 100644 index a89b787..0000000 --- a/test/spec/files/list.sh +++ /dev/null @@ -1,4 +0,0 @@ -describe "files list" - approve "repli files list --help" - approve "repli files list" - diff --git a/test/spec/files/upload.sh b/test/spec/files/upload.sh deleted file mode 100644 index 2cf08a3..0000000 --- a/test/spec/files/upload.sh +++ /dev/null @@ -1,7 +0,0 @@ -describe "files upload" - reset_state - approve "repli files upload --help" - approve "repli files upload --help" - approve "repli files upload fixtures/images/sample.jpg" - approve "repli files upload fixtures/images/sample.jpg" "repli_files_upload_fixtures_sample_jpg@again" - rm "$output_dir/files.ini" diff --git a/test/spec/files/usage.sh b/test/spec/files/usage.sh deleted file mode 100644 index e0fbfa9..0000000 --- a/test/spec/files/usage.sh +++ /dev/null @@ -1,4 +0,0 @@ -describe "files" - approve "repli files --help" - approve "repli files" - diff --git a/test/spec/template/delete.sh b/test/spec/template/delete.sh new file mode 100644 index 0000000..36387a6 --- /dev/null +++ b/test/spec/template/delete.sh @@ -0,0 +1,8 @@ +describe "templates delete" + reset_state + approve "repli template delete --help" + approve "repli template delete" + approve "repli template delete missing-template" + add_templates + approve "repli template delete model1" + diff --git a/test/spec/template/edit.sh b/test/spec/template/edit.sh new file mode 100644 index 0000000..951ec36 --- /dev/null +++ b/test/spec/template/edit.sh @@ -0,0 +1,8 @@ +describe "templates edit" + reset_state + approve "repli template edit --help" + approve "repli template edit" + approve "repli template edit missing-template" + add_templates + approve "repli template edit model1" + diff --git a/test/spec/template/list.sh b/test/spec/template/list.sh new file mode 100644 index 0000000..336e766 --- /dev/null +++ b/test/spec/template/list.sh @@ -0,0 +1,9 @@ +describe "templates list" + reset_state + approve "repli template list --help" + approve "repli template list" "repli_templates_list@empty" + add_templates + approve "repli template list" + approve "repli template list model" + approve "repli template list nosuchmodel" + diff --git a/test/spec/template/new.sh b/test/spec/template/new.sh new file mode 100644 index 0000000..15ecc9e --- /dev/null +++ b/test/spec/template/new.sh @@ -0,0 +1,12 @@ +describe "templates new" + reset_state + approve "repli template new --help" + approve "repli template new" + approve "repli template new google/nano-banana" + approve "repli template new google/nano-banana" "repli_templates_new_google_nano_banana@exist" + approve "repli template new google/nano-banana --force" + approve "repli template new google/nano-banana --name banana" + approve "repli template new not/found" + approve "cat $REPLI_TEMPLATES_DIR/banana.yaml" "cat_banana_yaml" + approve "ls $REPLI_TEMPLATES_DIR" + diff --git a/test/spec/template/show.sh b/test/spec/template/show.sh new file mode 100644 index 0000000..ba3163b --- /dev/null +++ b/test/spec/template/show.sh @@ -0,0 +1,8 @@ +describe "templates show" + reset_state + approve "repli template show --help" + approve "repli template show" + approve "repli template show missing-template" + add_templates + approve "repli template show model1" + diff --git a/test/spec/template/usage.sh b/test/spec/template/usage.sh new file mode 100644 index 0000000..28ff085 --- /dev/null +++ b/test/spec/template/usage.sh @@ -0,0 +1,4 @@ +describe "templates" + approve "repli template --help" + approve "repli template" + diff --git a/test/spec/templates/delete.sh b/test/spec/templates/delete.sh deleted file mode 100644 index 476b9f5..0000000 --- a/test/spec/templates/delete.sh +++ /dev/null @@ -1,8 +0,0 @@ -describe "templates delete" - reset_state - approve "repli templates delete --help" - approve "repli templates delete" - approve "repli templates delete missing-template" - add_templates - approve "repli templates delete model1" - diff --git a/test/spec/templates/edit.sh b/test/spec/templates/edit.sh deleted file mode 100644 index 6719b90..0000000 --- a/test/spec/templates/edit.sh +++ /dev/null @@ -1,8 +0,0 @@ -describe "templates edit" - reset_state - approve "repli templates edit --help" - approve "repli templates edit" - approve "repli templates edit missing-template" - add_templates - approve "repli templates edit model1" - diff --git a/test/spec/templates/list.sh b/test/spec/templates/list.sh deleted file mode 100644 index fd94911..0000000 --- a/test/spec/templates/list.sh +++ /dev/null @@ -1,9 +0,0 @@ -describe "templates list" - reset_state - approve "repli templates list --help" - approve "repli templates list" "repli_templates_list@empty" - add_templates - approve "repli templates list" - approve "repli templates list model" - approve "repli templates list nosuchmodel" - diff --git a/test/spec/templates/new.sh b/test/spec/templates/new.sh deleted file mode 100644 index 56cd19d..0000000 --- a/test/spec/templates/new.sh +++ /dev/null @@ -1,12 +0,0 @@ -describe "templates new" - reset_state - approve "repli templates new --help" - approve "repli templates new" - approve "repli templates new google/nano-banana" - approve "repli templates new google/nano-banana" "repli_templates_new_google_nano_banana@exist" - approve "repli templates new google/nano-banana --force" - approve "repli templates new google/nano-banana --name banana" - approve "repli templates new not/found" - approve "cat $REPLI_TEMPLATES_DIR/banana.yaml" "cat_banana_yaml" - approve "ls $REPLI_TEMPLATES_DIR" - diff --git a/test/spec/templates/show.sh b/test/spec/templates/show.sh deleted file mode 100644 index cb15b30..0000000 --- a/test/spec/templates/show.sh +++ /dev/null @@ -1,8 +0,0 @@ -describe "templates show" - reset_state - approve "repli templates show --help" - approve "repli templates show" - approve "repli templates show missing-template" - add_templates - approve "repli templates show model1" - diff --git a/test/spec/templates/usage.sh b/test/spec/templates/usage.sh deleted file mode 100644 index 3aa0a67..0000000 --- a/test/spec/templates/usage.sh +++ /dev/null @@ -1,4 +0,0 @@ -describe "templates" - approve "repli templates --help" - approve "repli templates" - From 3d447aa80d40547a3d62e4cccf790aa00d5876af Mon Sep 17 00:00:00 2001 From: Danny Ben Shitrit Date: Tue, 9 Dec 2025 12:34:58 +0000 Subject: [PATCH 2/2] - Add interactive template select to all template commands --- README.md | 2 +- repli | 97 +++++-------------- src/bashly.yml | 16 ++- src/commands/edit.sh | 2 +- src/commands/env.sh | 5 - src/commands/template/delete.sh | 3 +- src/commands/template/edit.sh | 3 +- src/commands/template/show.sh | 3 +- .../echo_1_repli_template_delete_mod | 6 ++ test/approvals/echo_1_repli_template_edit_mod | 6 ++ test/approvals/echo_1_repli_template_show_mod | 9 ++ test/approvals/repli_template_delete | 3 +- test/approvals/repli_template_delete_help | 6 +- .../repli_template_delete_missing_template | 3 +- test/approvals/repli_template_edit | 3 +- test/approvals/repli_template_edit_help | 6 +- .../repli_template_edit_missing_template | 3 +- test/approvals/repli_template_new | 2 +- test/approvals/repli_template_new_help | 2 +- test/approvals/repli_template_show | 3 +- test/approvals/repli_template_show_help | 6 +- .../repli_template_show_missing_template | 3 +- test/spec/template/delete.sh | 3 + test/spec/template/edit.sh | 4 + test/spec/template/show.sh | 4 + 25 files changed, 87 insertions(+), 116 deletions(-) create mode 100644 test/approvals/echo_1_repli_template_delete_mod create mode 100644 test/approvals/echo_1_repli_template_edit_mod create mode 100644 test/approvals/echo_1_repli_template_show_mod diff --git a/README.md b/README.md index a2a0fa5..af30326 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ repli simplifies working with Replicate into three steps: 1. Generate a YAML template for any Replicate model (once per model): ```console - repli templates new google/nano-banana + repli template new google/nano-banana ``` 2. Copy the template to the working directory: ```console diff --git a/repli b/repli index c0c3b2d..176e259 100755 --- a/repli +++ b/repli @@ -405,7 +405,7 @@ repli_template_new_usage() { # :command.usage_examples printf "%s\n" "$(bold "Examples:")" - printf " repli add google/nano-banana banana\n" + printf " repli add google/nano-banana --name banana\n" echo fi @@ -450,7 +450,7 @@ repli_template_show_usage() { echo printf "%s\n" "$(bold "Usage:")" - printf " repli template show TEMPLATE\n" + printf " repli template show [SEARCH]\n" printf " repli template show --help | -h\n" echo @@ -468,8 +468,8 @@ repli_template_show_usage() { printf "%s\n" "$(bold "Arguments:")" # :argument.usage - printf " %s\n" "$(green "TEMPLATE")" - printf " Template name\n" + printf " %s\n" "$(green "SEARCH")" + printf " Template search string or an exact name\n" echo fi @@ -482,7 +482,7 @@ repli_template_edit_usage() { echo printf "%s\n" "$(bold "Usage:")" - printf " repli template edit TEMPLATE\n" + printf " repli template edit [SEARCH]\n" printf " repli template edit --help | -h\n" echo @@ -500,8 +500,8 @@ repli_template_edit_usage() { printf "%s\n" "$(bold "Arguments:")" # :argument.usage - printf " %s\n" "$(green "TEMPLATE")" - printf " Template name\n" + printf " %s\n" "$(green "SEARCH")" + printf " Template search string or an exact name\n" echo # :command.usage_environment_variables @@ -523,7 +523,7 @@ repli_template_delete_usage() { echo printf "%s\n" "$(bold "Usage:")" - printf " repli template delete TEMPLATE\n" + printf " repli template delete [SEARCH]\n" printf " repli template delete --help | -h\n" echo @@ -541,8 +541,8 @@ repli_template_delete_usage() { printf "%s\n" "$(bold "Arguments:")" # :argument.usage - printf " %s\n" "$(green "TEMPLATE")" - printf " Template name\n" + printf " %s\n" "$(green "SEARCH")" + printf " Template search string or an exact name\n" echo fi @@ -1258,7 +1258,7 @@ repli_get_command() { repli_edit_command() { # src/commands/edit.sh - config="${args[--use]}" + local config="${args[--use]}" "${EDITOR}" "$config" } @@ -1276,7 +1276,6 @@ repli_show_command() { repli_env_command() { # src/commands/env.sh - printf "REPLI_FILE: %s\n" "$(yellow "$REPLI_FILE")" [[ -f "$REPLI_FILE" ]] && msg=$(green found) || msg=$(red "NOT FOUND") printf "REPLI_FILE status: %s\n" "$msg" @@ -1364,7 +1363,8 @@ repli_template_list_command() { repli_template_show_command() { # src/commands/template/show.sh - template="${args[template]}" + local search="${args[search]}" + template="$(select_template "$search")" file="$templates_dir/$template.yaml" yq -P -oy "$file" @@ -1374,7 +1374,8 @@ repli_template_show_command() { repli_template_edit_command() { # src/commands/template/edit.sh - template="${args[template]}" + local search="${args[search]}" + template="$(select_template "$search")" file="$templates_dir/$template.yaml" "${EDITOR}" "$file" @@ -1384,7 +1385,8 @@ repli_template_edit_command() { repli_template_delete_command() { # src/commands/template/delete.sh - template="${args[template]}" + local search="${args[search]}" + template="$(select_template "$search")" file="$templates_dir/$template.yaml" log info "deleting $file" rm "$file" @@ -2278,7 +2280,7 @@ repli_template_new_parse_requirements() { printf "missing required argument: MODEL\nusage: repli template new MODEL [OPTIONS]\n" >&2 # :command.examples_on_error printf "examples:\n" >&2 - printf " repli add google/nano-banana banana\n" >&2 + printf " repli add google/nano-banana --name banana\n" >&2 exit 1 fi @@ -2396,8 +2398,8 @@ repli_template_show_parse_requirements() { # :command.parse_requirements_case # :command.parse_requirements_case_simple # :argument.case - if [[ -z ${args['template']+x} ]]; then - args['template']=$1 + if [[ -z ${args['search']+x} ]]; then + args['search']=$1 shift else printf "invalid argument: %s\n" "$key" >&2 @@ -2409,23 +2411,6 @@ repli_template_show_parse_requirements() { esac done - # :command.required_args_filter - if [[ -z ${args['template']+x} ]]; then - printf "missing required argument: TEMPLATE\nusage: repli template show TEMPLATE\n" >&2 - - exit 1 - fi - - # :command.validations - # :argument.validations - if [[ -v args['template'] ]]; then - validation_output="$(validate_template_exists "${args['template']:-}")" - if [[ -n "$validation_output" ]]; then - printf "validation error in %s:\n%s\n" "TEMPLATE" "$validation_output" >&2 - exit 1 - fi - fi - # :command.user_filter filter_error=$(filter_templates_dir_exists) if [[ -n $filter_error ]]; then @@ -2479,8 +2464,8 @@ repli_template_edit_parse_requirements() { # :command.parse_requirements_case # :command.parse_requirements_case_simple # :argument.case - if [[ -z ${args['template']+x} ]]; then - args['template']=$1 + if [[ -z ${args['search']+x} ]]; then + args['search']=$1 shift else printf "invalid argument: %s\n" "$key" >&2 @@ -2492,23 +2477,6 @@ repli_template_edit_parse_requirements() { esac done - # :command.required_args_filter - if [[ -z ${args['template']+x} ]]; then - printf "missing required argument: TEMPLATE\nusage: repli template edit TEMPLATE\n" >&2 - - exit 1 - fi - - # :command.validations - # :argument.validations - if [[ -v args['template'] ]]; then - validation_output="$(validate_template_exists "${args['template']:-}")" - if [[ -n "$validation_output" ]]; then - printf "validation error in %s:\n%s\n" "TEMPLATE" "$validation_output" >&2 - exit 1 - fi - fi - # :command.user_filter filter_error=$(filter_templates_dir_exists) if [[ -n $filter_error ]]; then @@ -2556,8 +2524,8 @@ repli_template_delete_parse_requirements() { # :command.parse_requirements_case # :command.parse_requirements_case_simple # :argument.case - if [[ -z ${args['template']+x} ]]; then - args['template']=$1 + if [[ -z ${args['search']+x} ]]; then + args['search']=$1 shift else printf "invalid argument: %s\n" "$key" >&2 @@ -2569,23 +2537,6 @@ repli_template_delete_parse_requirements() { esac done - # :command.required_args_filter - if [[ -z ${args['template']+x} ]]; then - printf "missing required argument: TEMPLATE\nusage: repli template delete TEMPLATE\n" >&2 - - exit 1 - fi - - # :command.validations - # :argument.validations - if [[ -v args['template'] ]]; then - validation_output="$(validate_template_exists "${args['template']:-}")" - if [[ -n "$validation_output" ]]; then - printf "validation error in %s:\n%s\n" "TEMPLATE" "$validation_output" >&2 - exit 1 - fi - fi - # :command.user_filter filter_error=$(filter_templates_dir_exists) if [[ -n $filter_error ]]; then diff --git a/src/bashly.yml b/src/bashly.yml index 3c02ffc..8c648ba 100644 --- a/src/bashly.yml +++ b/src/bashly.yml @@ -43,7 +43,8 @@ commands: filters: [templates_dir_exists] args: - - name: search + - &template_search + name: search help: Template search string or an exact name flags: @@ -163,7 +164,7 @@ commands: default: auto examples: - - repli add google/nano-banana banana + - repli add google/nano-banana --name banana - name: list alias: [ls] @@ -177,18 +178,13 @@ commands: alias: s help: Show template filters: [templates_dir_exists] - args: - - &template - name: template - help: Template name - required: true - validate: template_exists + args: [*template_search] - name: edit alias: e help: Open template in editor filters: [templates_dir_exists] - args: [*template] + args: [*template_search] environment_variables: - name: editor help: Editor to use @@ -198,7 +194,7 @@ commands: alias: [d, del, rm] help: Delete template file filters: [templates_dir_exists] - args: [*template] + args: [*template_search] - name: file alias: f diff --git a/src/commands/edit.sh b/src/commands/edit.sh index 6412e9e..400c0fa 100644 --- a/src/commands/edit.sh +++ b/src/commands/edit.sh @@ -1,2 +1,2 @@ -config="${args[--use]}" +local config="${args[--use]}" "${EDITOR}" "$config" diff --git a/src/commands/env.sh b/src/commands/env.sh index 05e967f..2988db8 100644 --- a/src/commands/env.sh +++ b/src/commands/env.sh @@ -1,8 +1,3 @@ - - - - - printf "REPLI_FILE: %s\n" "$(yellow "$REPLI_FILE")" [[ -f "$REPLI_FILE" ]] && msg=$(green found) || msg=$(red "NOT FOUND") printf "REPLI_FILE status: %s\n" "$msg" diff --git a/src/commands/template/delete.sh b/src/commands/template/delete.sh index 048f9ee..fee5d7d 100644 --- a/src/commands/template/delete.sh +++ b/src/commands/template/delete.sh @@ -1,4 +1,5 @@ -template="${args[template]}" +local search="${args[search]}" +template="$(select_template "$search")" file="$templates_dir/$template.yaml" log info "deleting $file" rm "$file" diff --git a/src/commands/template/edit.sh b/src/commands/template/edit.sh index ac01b3c..da147a4 100644 --- a/src/commands/template/edit.sh +++ b/src/commands/template/edit.sh @@ -1,3 +1,4 @@ -template="${args[template]}" +local search="${args[search]}" +template="$(select_template "$search")" file="$templates_dir/$template.yaml" "${EDITOR}" "$file" diff --git a/src/commands/template/show.sh b/src/commands/template/show.sh index f382aab..bd687eb 100644 --- a/src/commands/template/show.sh +++ b/src/commands/template/show.sh @@ -1,4 +1,5 @@ -template="${args[template]}" +local search="${args[search]}" +template="$(select_template "$search")" file="$templates_dir/$template.yaml" yq -P -oy "$file" diff --git a/test/approvals/echo_1_repli_template_delete_mod b/test/approvals/echo_1_repli_template_delete_mod new file mode 100644 index 0000000..f4a9a6f --- /dev/null +++ b/test/approvals/echo_1_repli_template_delete_mod @@ -0,0 +1,6 @@ +Templates in tmp/templates: + + 1. model1 + 2. model2 + +• info • repli_template_delete_command → deleting tmp/templates/model1.yaml diff --git a/test/approvals/echo_1_repli_template_edit_mod b/test/approvals/echo_1_repli_template_edit_mod new file mode 100644 index 0000000..0622c57 --- /dev/null +++ b/test/approvals/echo_1_repli_template_edit_mod @@ -0,0 +1,6 @@ +Templates in tmp/templates: + + 1. model1 + 2. model2 + +editstub tmp/templates/model1.yaml diff --git a/test/approvals/echo_1_repli_template_show_mod b/test/approvals/echo_1_repli_template_show_mod new file mode 100644 index 0000000..eb7dd5b --- /dev/null +++ b/test/approvals/echo_1_repli_template_show_mod @@ -0,0 +1,9 @@ +Templates in tmp/templates: + + 1. model1 + 2. model2 + +model: google/nano-banana +input: + prompt: an image of a JSON file + output_format: jpg diff --git a/test/approvals/repli_template_delete b/test/approvals/repli_template_delete index 6f3374d..b521786 100644 --- a/test/approvals/repli_template_delete +++ b/test/approvals/repli_template_delete @@ -1,2 +1 @@ -missing required argument: TEMPLATE -usage: repli template delete TEMPLATE +Templates dir not found (tmp/templates), set using REPLI_TEMPLATES_DIR diff --git a/test/approvals/repli_template_delete_help b/test/approvals/repli_template_delete_help index 3484229..22d28b3 100644 --- a/test/approvals/repli_template_delete_help +++ b/test/approvals/repli_template_delete_help @@ -3,7 +3,7 @@ repli template delete - Delete template file Alias: d, del, rm Usage: - repli template delete TEMPLATE + repli template delete [SEARCH] repli template delete --help | -h Options: @@ -11,5 +11,5 @@ Alias: d, del, rm Show this help Arguments: - TEMPLATE - Template name + SEARCH + Template search string or an exact name diff --git a/test/approvals/repli_template_delete_missing_template b/test/approvals/repli_template_delete_missing_template index dd74548..b521786 100644 --- a/test/approvals/repli_template_delete_missing_template +++ b/test/approvals/repli_template_delete_missing_template @@ -1,2 +1 @@ -validation error in TEMPLATE: -must be an existing template +Templates dir not found (tmp/templates), set using REPLI_TEMPLATES_DIR diff --git a/test/approvals/repli_template_edit b/test/approvals/repli_template_edit index db89f29..b521786 100644 --- a/test/approvals/repli_template_edit +++ b/test/approvals/repli_template_edit @@ -1,2 +1 @@ -missing required argument: TEMPLATE -usage: repli template edit TEMPLATE +Templates dir not found (tmp/templates), set using REPLI_TEMPLATES_DIR diff --git a/test/approvals/repli_template_edit_help b/test/approvals/repli_template_edit_help index 3d1c4b5..1d71dbf 100644 --- a/test/approvals/repli_template_edit_help +++ b/test/approvals/repli_template_edit_help @@ -3,7 +3,7 @@ repli template edit - Open template in editor Alias: e Usage: - repli template edit TEMPLATE + repli template edit [SEARCH] repli template edit --help | -h Options: @@ -11,8 +11,8 @@ Alias: e Show this help Arguments: - TEMPLATE - Template name + SEARCH + Template search string or an exact name Environment Variables: EDITOR diff --git a/test/approvals/repli_template_edit_missing_template b/test/approvals/repli_template_edit_missing_template index dd74548..b521786 100644 --- a/test/approvals/repli_template_edit_missing_template +++ b/test/approvals/repli_template_edit_missing_template @@ -1,2 +1 @@ -validation error in TEMPLATE: -must be an existing template +Templates dir not found (tmp/templates), set using REPLI_TEMPLATES_DIR diff --git a/test/approvals/repli_template_new b/test/approvals/repli_template_new index fda7d76..57f1aca 100644 --- a/test/approvals/repli_template_new +++ b/test/approvals/repli_template_new @@ -1,4 +1,4 @@ missing required argument: MODEL usage: repli template new MODEL [OPTIONS] examples: - repli add google/nano-banana banana + repli add google/nano-banana --name banana diff --git a/test/approvals/repli_template_new_help b/test/approvals/repli_template_new_help index 0c89f20..862676c 100644 --- a/test/approvals/repli_template_new_help +++ b/test/approvals/repli_template_new_help @@ -22,4 +22,4 @@ Alias: n, add Replicate model (author/model) Examples: - repli add google/nano-banana banana + repli add google/nano-banana --name banana diff --git a/test/approvals/repli_template_show b/test/approvals/repli_template_show index d763822..b521786 100644 --- a/test/approvals/repli_template_show +++ b/test/approvals/repli_template_show @@ -1,2 +1 @@ -missing required argument: TEMPLATE -usage: repli template show TEMPLATE +Templates dir not found (tmp/templates), set using REPLI_TEMPLATES_DIR diff --git a/test/approvals/repli_template_show_help b/test/approvals/repli_template_show_help index 776b862..50eca84 100644 --- a/test/approvals/repli_template_show_help +++ b/test/approvals/repli_template_show_help @@ -3,7 +3,7 @@ repli template show - Show template Alias: s Usage: - repli template show TEMPLATE + repli template show [SEARCH] repli template show --help | -h Options: @@ -11,5 +11,5 @@ Alias: s Show this help Arguments: - TEMPLATE - Template name + SEARCH + Template search string or an exact name diff --git a/test/approvals/repli_template_show_missing_template b/test/approvals/repli_template_show_missing_template index dd74548..b521786 100644 --- a/test/approvals/repli_template_show_missing_template +++ b/test/approvals/repli_template_show_missing_template @@ -1,2 +1 @@ -validation error in TEMPLATE: -must be an existing template +Templates dir not found (tmp/templates), set using REPLI_TEMPLATES_DIR diff --git a/test/spec/template/delete.sh b/test/spec/template/delete.sh index 36387a6..7b59e5d 100644 --- a/test/spec/template/delete.sh +++ b/test/spec/template/delete.sh @@ -6,3 +6,6 @@ describe "templates delete" add_templates approve "repli template delete model1" + context "interactive template select" + add_templates + approve "echo 1 | repli template delete mod" diff --git a/test/spec/template/edit.sh b/test/spec/template/edit.sh index 951ec36..286052a 100644 --- a/test/spec/template/edit.sh +++ b/test/spec/template/edit.sh @@ -6,3 +6,7 @@ describe "templates edit" add_templates approve "repli template edit model1" + context "interactive template select" + add_templates + approve "echo 1 | repli template edit mod" + diff --git a/test/spec/template/show.sh b/test/spec/template/show.sh index ba3163b..b218b1f 100644 --- a/test/spec/template/show.sh +++ b/test/spec/template/show.sh @@ -6,3 +6,7 @@ describe "templates show" add_templates approve "repli template show model1" + context "interactive template select" + add_templates + approve "echo 1 | repli template show mod" +