File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4040 exec kiro-cli login --use-device-flow
4141fi
4242
43- # Parse args: ACTION [--flags...] "prompt"
43+ # Parse args: ACTION "prompt"
44+ # Note: Extra flags are sourced from KIRO_EXTRA_FLAGS env var (operator-controlled)
45+ # rather than from argv, to prevent argument injection from untrusted prompts.
4446ACTION=" ${1:- interactive} "
4547shift 2> /dev/null || true
46-
47- EXTRA_FLAGS=()
48- PROMPT_PARTS=()
49- for arg in " $@ " ; do
50- if [[ " $arg " == --* ]]; then
51- EXTRA_FLAGS+=(" $arg " )
52- else
53- PROMPT_PARTS+=(" $arg " )
54- fi
55- done
56- PROMPT=" ${PROMPT_PARTS[*]} "
48+ PROMPT=" $* "
5749
5850cd " $HOME "
5951
6052case " $ACTION " in
6153 interactive) exec kiro-cli ;;
62- chat) exec kiro-cli chat --no-interactive --trust-all-tools " ${EXTRA_FLAGS[@]} " " $PROMPT " ;;
63- * ) exec kiro-cli " $ACTION " " ${EXTRA_FLAGS[@]} " " $PROMPT " ;;
54+ chat) exec kiro-cli chat --no-interactive --trust-all-tools ${KIRO_EXTRA_FLAGS :- } -- " $PROMPT " ;;
55+ * ) exec kiro-cli " $ACTION " ${KIRO_EXTRA_FLAGS :- } -- " $PROMPT " ;;
6456esac
You can’t perform that action at this time.
0 commit comments