Skip to content

Remove script execute -c option#34

Merged
Niaobu merged 3 commits intomainfrom
remove-script-execute-c
Mar 11, 2026
Merged

Remove script execute -c option#34
Niaobu merged 3 commits intomainfrom
remove-script-execute-c

Conversation

@Niaobu
Copy link
Copy Markdown
Contributor

@Niaobu Niaobu commented Mar 11, 2026

Summary

  • Remove the -c/--code inline option from script execute, keeping only -f (file) and stdin
  • Update SKILL.md to recommend Write tool + script execute -f workflow, with a warning against shell heredocs
  • Rewrite README examples to showcase script eval for one-liners and file-based script execute -f with full C# example

Motivation

Log analysis of today's fire repo sessions showed:

  • 1 out of 154 script execute calls used -c — and it failed (pipe/heredoc mangled the C# content)
  • cat > /tmp/file.cs << 'EOF' heredocs failed 4 out of 62 times due to single quotes in C# breaking the delimiter
  • Agents naturally recover to Write tool + execute -f, which had 0 encoding failures
  • script eval handles one-liners (200 calls today), -f handles everything else (154 calls)

Removing -c eliminates a failure mode and aligns the CLI with how agents actually use it. Stdin piping still works for programmatic use.

Test plan

  • dotnet build — clean
  • dotnet test — 207 passed
  • ./uc script execute --help confirms -c is gone
  • Verify agents in fire repo use script eval + Write tool + script execute -f without issues

Niaobu added 3 commits March 11, 2026 13:05
Log analysis showed -c was barely used (1 attempt today out of 154 execute
calls) and that attempt failed due to pipe/heredoc mangling C# content.
Agents naturally converge on Write tool + script execute -f, which has no
encoding issues. The skill now explicitly recommends this workflow.
`unityctl script execute MyScript.cs` now works without -f flag.
If the first positional arg ends in .cs, it's treated as the file path.
The -f option still works for backwards compatibility.

Also updates all docs to use the positional form.
Extract ResolvePositionalFile into a testable static method and add
7 unit tests covering file resolution, arg splitting, case insensitivity,
explicit -f precedence, and edge cases.
@Niaobu Niaobu marked this pull request as ready for review March 11, 2026 12:24
@Niaobu Niaobu merged commit 3968df2 into main Mar 11, 2026
1 check passed
@Niaobu Niaobu deleted the remove-script-execute-c branch March 11, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant