feat(function): add a --resume flag to the agy function
The agy tool uses -c and --continue natively. It does not recognize -r or --resume. This commit allows -r and --resume to be used by translating them to -c and --continue respectively.
This commit is contained in:
+17
-5
@@ -15,23 +15,25 @@
|
|||||||
# sub-repository is initialized and any agent-made changes are committed
|
# sub-repository is initialized and any agent-made changes are committed
|
||||||
# before launch. Delegates all scaffold and commit logic to agents-init
|
# before launch. Delegates all scaffold and commit logic to agents-init
|
||||||
# --quiet (full setup), which ensures AGENTS/ is scaffolded and CLAUDE.md
|
# --quiet (full setup), which ensures AGENTS/ is scaffolded and CLAUDE.md
|
||||||
# is symlinked to AGENTS/AGENTS.md in the current project. All arguments
|
# is symlinked to AGENTS/AGENTS.md in the current project. Arguments are
|
||||||
# are forwarded verbatim to the real agy binary.
|
# forwarded verbatim to the real agy binary, except for -r/--resume which
|
||||||
|
# are translated to -c/--continue.
|
||||||
#
|
#
|
||||||
# Opinionated component (C1): when disabled via __fish_config_op_aliases
|
# Opinionated component (C1): when disabled via __fish_config_op_aliases
|
||||||
# (or the __fish_config_opinionated master), the command is passed through
|
# (or the __fish_config_opinionated master), the command is passed through
|
||||||
# to the real agy binary unchanged.
|
# to the real agy binary unchanged.
|
||||||
#
|
#
|
||||||
# ARGUMENTS
|
# ARGUMENTS
|
||||||
# ARGS Any arguments forwarded verbatim to the underlying agy binary
|
# ARGS Arguments forwarded to the underlying agy binary (-r translates to -c)
|
||||||
#
|
#
|
||||||
# EXIT STATUS
|
# EXIT STATUS
|
||||||
# Exit status of the underlying agy binary
|
# Exit status of the underlying agy binary
|
||||||
#
|
#
|
||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# agy
|
# agy
|
||||||
# agy chat
|
# agy --resume
|
||||||
# agy resume
|
# agy -i "initial prompt"
|
||||||
|
# agy models
|
||||||
function agy --wraps=agy --description 'agy wrapper: auto-initializes AGENTS/ sub-repo before launch'
|
function agy --wraps=agy --description 'agy wrapper: auto-initializes AGENTS/ sub-repo before launch'
|
||||||
if not __fish_config_op_enabled __fish_config_op_aliases
|
if not __fish_config_op_enabled __fish_config_op_aliases
|
||||||
command agy $argv
|
command agy $argv
|
||||||
@@ -40,5 +42,15 @@ function agy --wraps=agy --description 'agy wrapper: auto-initializes AGENTS/ su
|
|||||||
|
|
||||||
agents-init --quiet
|
agents-init --quiet
|
||||||
|
|
||||||
|
for i in (seq (count $argv))
|
||||||
|
if test "$argv[$i]" = "-r"
|
||||||
|
set argv[$i] "-c"
|
||||||
|
else if test "$argv[$i]" = "--resume"
|
||||||
|
set argv[$i] "--continue"
|
||||||
|
else if string match -q -- "--resume=*" "$argv[$i]"
|
||||||
|
set argv[$i] (string replace -- "--resume=" "--continue=" "$argv[$i]")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
command agy $argv
|
command agy $argv
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user