Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ repli simplifies working with Replicate into three steps:
```
4. Run the model:
```console
repli get
repli go
```

Local file references are handled automatically, and all output files are saved
Expand All @@ -51,7 +51,7 @@ directly to your working directory.
Process overview:

```
template → edit YAML → repli get → output files
template → edit YAML → repli go → output files
```

## Installation
Expand Down Expand Up @@ -101,7 +101,7 @@ repli edit
### 4. Run the model

```
repli get
repli go
```

### 5. Check your working directory
Expand Down
28 changes: 14 additions & 14 deletions repli
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repli_usage() {
# :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 Call Replicate using a configuration file and save the result\n" "$(green "go") "
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") "
Expand Down Expand Up @@ -147,14 +147,14 @@ repli_new_usage() {
}

# :command.usage
repli_get_usage() {
printf "repli get - Call Replicate using a configuration file and save the result\n\n"
repli_go_usage() {
printf "repli go - Call Replicate using a configuration file and save the result\n\n"
printf "Alias: g\n"
echo

printf "%s\n" "$(bold "Usage:")"
printf " repli get [PREFIX] [OPTIONS]\n"
printf " repli get --help | -h\n"
printf " repli go [PREFIX] [OPTIONS]\n"
printf " repli go --help | -h\n"
echo

# :command.long_usage
Expand Down Expand Up @@ -1320,9 +1320,9 @@ repli_new_command() {
}

# :command.function
repli_get_command() {
repli_go_command() {

# src/commands/get.sh
# src/commands/go.sh
config="${args[--use]}"
prefix="${args[prefix]:-$(get_unique_filename "$(basename "$config" ".yaml")")}"

Expand Down Expand Up @@ -1661,10 +1661,10 @@ parse_requirements() {
shift $#
;;

get | g)
action="get"
go | g)
action="go"
shift
repli_get_parse_requirements "$@"
repli_go_parse_requirements "$@"
shift $#
;;

Expand Down Expand Up @@ -1839,7 +1839,7 @@ repli_new_parse_requirements() {
}

# :command.parse_requirements
repli_get_parse_requirements() {
repli_go_parse_requirements() {
local key

# :command.fixed_flags_filter
Expand All @@ -1848,7 +1848,7 @@ repli_get_parse_requirements() {
case "$key" in
--help | -h)
long_usage=yes
repli_get_usage
repli_go_usage
exit
;;

Expand All @@ -1860,7 +1860,7 @@ repli_get_parse_requirements() {
done

# :command.command_filter
action="get"
action="go"

# :command.parse_requirements_while
while [[ $# -gt 0 ]]; do
Expand Down Expand Up @@ -2990,7 +2990,7 @@ run() {

case "$action" in
"new") repli_new_command ;;
"get") repli_get_command ;;
"go") repli_go_command ;;
"edit") repli_edit_command ;;
"show") repli_show_command ;;
"env") repli_env_command ;;
Expand Down
2 changes: 1 addition & 1 deletion src/bashly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ commands:
- repli new flux
- repli new flux-schnell -e

- name: get
- name: go
alias: g
help: Call Replicate using a configuration file and save the result

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test/approvals/repli
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repli - Replicate AI Workspace Tool

Commands:
new Create a new configuration file from a tmeplate
get Call Replicate using a configuration file and save the result
go 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
Expand Down
13 changes: 0 additions & 13 deletions test/approvals/repli_get@error

This file was deleted.

6 changes: 0 additions & 6 deletions test/approvals/repli_get_x

This file was deleted.

5 changes: 0 additions & 5 deletions test/approvals/repli_get_x@again

This file was deleted.

13 changes: 13 additions & 0 deletions test/approvals/repli_go@error
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
• debug • repli_go_command → config: tmp/repli.yaml
• debug • repli_go_command → prefix: repli-1
• debug • repli_go_command → outfile: tmp/repli-1.json
• info • repli_go_command → calling API and saving tmp/repli-1.json
• error • json_verify_success_file → 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'
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
repli get - Call Replicate using a configuration file and save the result
repli go - Call Replicate using a configuration file and save the result

Alias: g

Usage:
repli get [PREFIX] [OPTIONS]
repli get --help | -h
repli go [PREFIX] [OPTIONS]
repli go --help | -h

Options:
--use, -u PATH
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
• debug • repli_get_command → config: fixtures/templates/files.yaml
• debug • repli_get_command → prefix: files-1
• debug • repli_get_command → outfile: tmp/files-1.json
• info • repli_get_command → calling API and saving tmp/files-1.json
• debug • repli_go_command → config: fixtures/templates/files.yaml
• debug • repli_go_command → prefix: files-1
• debug • repli_go_command → outfile: tmp/files-1.json
• info • repli_go_command → calling API and saving tmp/files-1.json
• debug • replace_file_placeholders → replacing upload file marker fixtures/images/sample.jpg
• info • get_file_url → uploading file: fixtures/images/sample.jpg
• debug • get_file_url → file url: https://api.replicate.com/v1/files/some-hash
Expand Down
6 changes: 6 additions & 0 deletions test/approvals/repli_go_x
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
• debug • repli_go_command → config: tmp/repli.yaml
• debug • repli_go_command → prefix: x
• debug • repli_go_command → outfile: tmp/x.json
• info • repli_go_command → calling API and saving tmp/x.json
• debug • download_outputs → downloading from: http://localhost:3000/assets/out-0.jpg
• info • download_outputs → downloading to tmp/x_out-0.jpg
5 changes: 5 additions & 0 deletions test/approvals/repli_go_x@again
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
• debug • repli_go_command → config: tmp/repli.yaml
• debug • repli_go_command → prefix: x
• debug • repli_go_command → outfile: tmp/x.json
• info • repli_go_command → skipping API call, file exists: tmp/x.json
• info • download_outputs → skipping download, file exists: tmp/x_out-0.jpg
2 changes: 1 addition & 1 deletion test/approvals/repli_help
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repli - Replicate AI Workspace Tool

Commands:
new Create a new configuration file from a tmeplate
get Call Replicate using a configuration file and save the result
go 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
Expand Down
14 changes: 7 additions & 7 deletions test/spec/get.sh → test/spec/go.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#!/usr/bin/env bash
describe "get"
describe "go"
reset_state
approve "repli get --help"
approve "repli get" "repli get@no_repli_yaml"
approve "repli go --help"
approve "repli go" "repli go@no_repli_yaml"
add_repli_yaml
approve "repli get x"
approve "repli go x"

# ensure the downloaded file matches the source file
[[ "$(stat -c%s $output_dir/x_out-0.jpg)" -eq "$(stat -c%s mockserver/mocks/assets/out-0.jpg)" ]] ||
fail "downloaded file does not match the source file"

approve "repli get x" "repli_get_x@again"
approve "repli go x" "repli_go_x@again"

context "error condition"
cp 'fixtures/templates/error.yaml' "$output_dir/repli.yaml"
approve "repli get" "repli_get@error"
approve "repli go" "repli_go@error"

context "embed and upload files"
reset_state
approve "repli get -u fixtures/templates/files.yaml"
approve "repli go -u fixtures/templates/files.yaml"