You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tell add-ons how they were invoked, so their messages name the right command #17
Problem
rc runs a language profiler as an add-on and passes the arguments through unchanged. When the add-on fails with a usage or setup error it names its own binary. Example, from rc profile typescript generate --project . with no --name:
error: usage: --name is required
usage: runtimeconditions-typescript-profiler [profile] verify-bindings --project DIR [--json]
runtimeconditions-typescript-profiler [profile] generate --project DIR --name NAME ...
The user ran rc profile typescript generate ..., so the command they should copy is not the one printed.
Proposal (to discuss)
rc tells the add-on how it was invoked, for example through an environment variable that holds the command prefix (rc profile typescript).
Profilers use it in their usage text and in messages that suggest a command, and fall back to their own name when it is not set.
rc keeps passing the exit code through and prints no extra message of its own.
Acceptance
With and without rc, a usage error shows a command the user can copy.
A test in rc-cli runs a fake add-on and checks that it receives the variable.
The contract (spec issue) records the variable name.
Hi @itvi-1234, I'd like to take the rc-cli side of this.
From reading newLanguageCommand in internal/cli/plugins.go, the change would be small: when rc runs an add-on it appends one variable to the child's environment (inheriting os.Environ(), since process.Spec.Env == nil currently means "inherit"), holding the exact prefix the user typed, e.g. rc profile typescript. It would apply to all three add-ons from that one place and leave exit-code passthrough untouched.
Proposed details, happy to change any of them:
Variable name: RC_COMMAND_PREFIX (value like rc profile typescript). I don't have a strong view on the name, so I'll use whatever the contract issue settles on.
Set only for the real invocation, not for the --version --json probe.
Test: extend the fake runner test to assert the variable is present with the right value for typescript, java and python.
Docs: record the variable in docs/language-profilers.md.
The profilers adopting it would be separate follow-ups in their own repos. Does this match what you had in mind, and is the variable name settled yet?
I have opened PR #26 implementing the rc-cli side of this proposal:
Summary of Changes:
Dynamic prefix passing: In newLanguageCommand (internal/cli/plugins.go), we now inject RC_COMMAND_PREFIX using cmd.CommandPath() (e.g. rc profile typescript) into the add-on execution environment.
Probe isolation: The variable is passed strictly during the actual invocation (Run), leaving the --version --json discovery probe untouched.
Tests & Docs: Unit test assertions added across all three supported runtimes (TypeScript, Java, Python) in plugins_test.go, and documentation updated in docs/language-profilers.md.
Notes / Questions for Discussion:
Variable naming: Is RC_COMMAND_PREFIX good to finalize, or would you prefer another convention based on the spec/contract discussion? Happy to adjust if needed!
Issue scope: Linked the PR with Refs #17 so the issue remains open for the profiler consumption follow-ups.
Whenever you have a moment, please take a look. Feedback is welcome!
Activity
abhinavkdeval08-design commentedon Nov 22, 2026
Hi @itvi-1234, I'd like to take the rc-cli side of this.
From reading
newLanguageCommandininternal/cli/plugins.go, the change would be small: when rc runs an add-on it appends one variable to the child's environment (inheritingos.Environ(), sinceprocess.Spec.Env == nilcurrently means "inherit"), holding the exact prefix the user typed, e.g.rc profile typescript. It would apply to all three add-ons from that one place and leave exit-code passthrough untouched.Proposed details, happy to change any of them:
RC_COMMAND_PREFIX(value likerc profile typescript). I don't have a strong view on the name, so I'll use whatever the contract issue settles on.--version --jsonprobe.docs/language-profilers.md.The profilers adopting it would be separate follow-ups in their own repos. Does this match what you had in mind, and is the variable name settled yet?
abhinavkdeval08-design commentedon Nov 27, 2026
Hi @itvi-1234 👋
I have opened PR #26 implementing the
rc-cliside of this proposal:Summary of Changes:
newLanguageCommand(internal/cli/plugins.go), we now injectRC_COMMAND_PREFIXusingcmd.CommandPath()(e.g.rc profile typescript) into the add-on execution environment.Run), leaving the--version --jsondiscovery probe untouched.Stdout,Stderr) and exit code propagation remain completely unaffected.plugins_test.go, and documentation updated indocs/language-profilers.md.Notes / Questions for Discussion:
RC_COMMAND_PREFIXgood to finalize, or would you prefer another convention based on the spec/contract discussion? Happy to adjust if needed!Refs #17so the issue remains open for the profiler consumption follow-ups.Whenever you have a moment, please take a look. Feedback is welcome!
feat(cli): pass RC_COMMAND_PREFIX environment variable to add-ons (#17)
Merge pull request #26 from abhinavkdeval08-design/feat/tell-addons-i…
colinjlacy commentedon Nov 27, 2026
Closed by #26