Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 6, 2025

Commands with complex arguments previously supported both quoted string syntax and -- separator syntax. This has been simplified to require only the -- separator, providing a cleaner and more consistent interface.

Changes

CLI Argument Parsing

  • Changed from <command> (single required string) to [args...] (variadic array)
  • Requires -- separator for all commands (legacy quoted syntax removed)
  • Improved error message with helpful example when command is missing

Shell Escaping

  • escapeShellArg(): Quotes arguments containing special characters, escapes single quotes using '\\'' technique
  • joinShellArgs(): Preserves argument boundaries when constructing shell command from array

Documentation

  • Updated all examples to use -- separator only
  • Removed references to legacy quoted string syntax

Usage

# All commands now require -- separator
awf --allow-domains github.com -- curl -H "Authorization: Bearer token" https://api.github.com

# Error when -- is missing (with helpful example)
awf --allow-domains github.com curl https://api.github.com
# Error: No command specified. Use -- to separate command from options.
# Example: awf --allow-domains github.com -- curl https://api.github.com

The -- separator ensures proper argument handling and avoids shell escaping issues with complex commands.

Original prompt

awf should support passing through arguments through -- so that commands like copilot ... or curl ... don't have to be encoded into one single string that may have strange encoding escape issues.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits November 6, 2025 20:01
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for passing arguments through '--' Support -- separator for passing command arguments without quoting Nov 6, 2025
Copilot AI requested a review from Mossaka November 6, 2025 20:15
Copilot finished work on behalf of Mossaka November 6, 2025 20:15
@Mossaka Mossaka marked this pull request as ready for review November 6, 2025 20:22
@github-actions
Copy link

github-actions bot commented Nov 6, 2025

Test Coverage Report

Metric Coverage Covered/Total
Lines 46.09% 224/486
Statements 45.98% 229/498
Functions 53.44% 31/58
Branches 33.08% 44/133
Coverage Thresholds

The project has the following coverage thresholds configured:

  • Lines: 38%
  • Statements: 38%
  • Functions: 35%
  • Branches: 30%

Coverage report generated by `npm run test:coverage`

@Mossaka
Copy link
Collaborator

Mossaka commented Nov 6, 2025

@copilot I think you could remove the legacy quoted syntax and update docs

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 6, 2025

@copilot I think you could remove the legacy quoted syntax and update docs

Done in commit 5df6182. Removed the legacy quoted syntax and updated all documentation to require -- separator.

Key changes:

  • CLI now requires -- separator for all commands
  • Updated error message to guide users: "Use -- to separate command from options"
  • Removed backward compatibility test
  • Updated all README examples to use -- separator only

The help output now clearly shows the requirement:

Arguments:
  args     Command and arguments to execute (use -- to separate from options)

And when users forget the --, they get a helpful error:

Error: No command specified. Use -- to separate command from options.
Example: awf --allow-domains github.com -- curl https://api.github.com

Copilot AI changed the title Support -- separator for passing command arguments without quoting Require -- separator for passing command arguments Nov 6, 2025
Copilot finished work on behalf of Mossaka November 6, 2025 20:34
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.

2 participants