Skip to content

feat(pai.ts): passthrough unknown CLI flags to claude#986

Closed
HyggeHacker wants to merge 1 commit into
danielmiessler:mainfrom
HyggeHacker:feat/passthrough-flags
Closed

feat(pai.ts): passthrough unknown CLI flags to claude#986
HyggeHacker wants to merge 1 commit into
danielmiessler:mainfrom
HyggeHacker:feat/passthrough-flags

Conversation

@HyggeHacker

Copy link
Copy Markdown

Summary

PAI's arg parser silently dropped unrecognized flags (e.g., --plugin-dir, --mcp-config), preventing users from combining PAI with Claude Code's native flags. Unknown flags are now collected and forwarded to the underlying claude command, enabling use cases like:

pai -l --plugin-dir ~/Projects/boxie --mcp-config ~/.claude/mcp-profiles/boxie.json

Changes

  • Unknown flags (args starting with -) are collected into a passthrough array instead of being silently ignored
  • If the next arg after an unknown flag doesn't start with -, it's treated as that flag's value
  • Non-flag unknown args still produce the existing error message
  • The passthrough array is forwarded to cmdLaunch() and spread into the claude command args

Known limitation

Flags that accept multiple space-separated values (e.g., --add-dir dir1 dir2, --allowedTools Bash Edit Read) will only capture the first value. This covers the vast majority of Claude Code flags which take a single value. Multi-value flags can use repeated invocations (--add-dir dir1 --add-dir dir2) or = syntax as a workaround.

Test plan

  • pai -l --plugin-dir ~/Projects/boxie — plugin-dir passed through correctly
  • pai --mcp-config ~/.claude/mcp-profiles/boxie.json — mcp-config passed through
  • pai unknowncmd — still errors with "Unknown command"
  • pai --model opus — passed through correctly
  • Existing flags (-r, -m, -l, --safe) still work as before

PAI's arg parser silently dropped unrecognized flags (e.g., --plugin-dir,
--mcp-config), preventing users from combining PAI with Claude Code's
native flags. Unknown flags are now collected and forwarded to the
underlying claude command, enabling use cases like:
  pai -l --plugin-dir ~/Projects/boxie --mcp-config ~/.claude/mcp-profiles/boxie.json

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@danielmiessler

Copy link
Copy Markdown
Owner

Hey @HyggeHacker, thank you for the PR and the work that went into it.

We're changing how LifeOS ships: from a full ~/.claude directory you run as-is, to a skill installed by an agentic installer that has your own AI integrate the pieces into your setup. That reworks the parts of the codebase this change touches, so it won't apply cleanly to where we're headed.

We're closing it for that reason, not because the idea was wrong. If the need still stands against the new model, we'd love a fresh PR once it lands. Thanks again for contributing.

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