Skip to content

Support persisting CLI flags via apm config (e.g. allow-protocol-fallback, ssh) #1243

Closed

Description

Problem

Several apm install behaviours are controlled by environment variables (e.g. APM_ALLOW_PROTOCOL_FALLBACK=1) or CLI flags (--ssh, --allow-protocol-fallback). These cannot be persisted via apm config — today the only valid config keys are auto-integrate, temp-dir, and copilot-cowork-skills-dir.

This creates friction for users who rely on SSH-based authentication to GitHub rather than PAT tokens. Every apm install invocation requires either:

  1. Passing --allow-protocol-fallback or --ssh on every command, or
  2. Setting APM_ALLOW_PROTOCOL_FALLBACK=1 in a shell profile (.zshrc, .bashrc, etc.)

Neither option is ideal:

  • Windows users (PowerShell, cmd) have a very different mechanism for persisting environment variables, making cross-platform instructions inconsistent.
  • Users who prefer not to modify rc files have no persistent configuration path at all.
  • Teams sharing APM setups cannot standardise transport preferences without documenting shell-specific workarounds per OS.

Example scenario

A contributor authenticates to GitHub via SSH keys (no PAT configured). When they run:

apm install my-package@my-marketplace

The install fails because the default HTTPS clone cannot authenticate. The workaround is:

APM_ALLOW_PROTOCOL_FALLBACK=1 apm install my-package@my-marketplace
# or
apm install --allow-protocol-fallback my-package@my-marketplace

This must be repeated for every install, update, or marketplace operation. There is no way to persist this preference.

Proposed solution

Extend apm config set to accept keys that mirror existing environment variables and CLI flags. For example:

# Persist protocol fallback preference
apm config set allow-protocol-fallback true

# Persist SSH transport preference
apm config set ssh true

Once set, these would be read automatically by all apm commands — no environment variable or CLI flag needed.

Suggested scope

At minimum, the following should be configurable via apm config:

Config key Env var CLI flag
allow-protocol-fallback APM_ALLOW_PROTOCOL_FALLBACK --allow-protocol-fallback
ssh (none) --ssh

More broadly, any behaviour currently controlled by an environment variable should have a corresponding apm config key, so the configuration surface is unified and discoverable.

Additional context

  • Current valid config keys: auto-integrate, temp-dir, copilot-cowork-skills-dir
  • Precedence suggestion: CLI flag > env var > apm config > default

Activity

  1. added
    status/needs-triage
    on May 10, 2026
  2. sergio-sisternes-epam commented on May 10, 2026

    @sergio-sisternes-epam
    ContributorAuthor

    This review could be extended to all environment variables APM currently supports — not just APM_ALLOW_PROTOCOL_FALLBACK. Auditing the full set of env vars and ensuring each one has a corresponding apm config key would create a consistent, smooth experience across:

    • Environment variables — for CI pipelines and shell-native users
    • CLI flags — for explicit, one-off overrides
    • apm config — for persistent, cross-platform user/project preferences

    This way, every user gets the same capability regardless of platform (macOS, Linux, Windows) or preferred configuration style, and the configuration surface becomes fully discoverable via apm config --help.

  3. github-actions commented on May 10, 2026

    @github-actions

    Triage decision

    accept

    Proposed labels

    theme/portability
    area/cli
    area/distribution
    area/docs-site
    type/feature
    status/accepted
    priority/low
    

    Milestone

    null (open milestones could not be verified -- maintainer should assign to next minor, likely v0.13.0)

    Suggested next action

    Implement apm config set allow-protocol-fallback and apm config set ssh with user-scoped persistence, wiring the precedence chain (CLI > env > config > default) into the install and marketplace commands, and update the config reference docs.

    Suggested issue comment

    Thanks for this well-structured proposal -- the friction you describe is real and the cross-platform angle (Windows vs. shell profiles) makes it a genuine portability gap.
    
    The direction is accepted. The core ask -- persisting transport preferences via `apm config set` -- aligns with APM's portability goals and follows the industry-standard layered config model (CLI flag > env var > config > default) that users coming from npm or pip expect.
    
    A few implementation notes for the contributor picking this up:
    
    - **Config scope**: `allow-protocol-fallback` should be user-scoped only (stored in the user-level config, not in project `apm.yml`), since silently enabling protocol fallback for all contributors of a shared project could weaken transport security without individual opt-in. The `ssh` key can be either user- or project-scoped at the implementor's discretion.
    - **Minimal scope first**: implement the two keys in the table (`allow-protocol-fallback`, `ssh`) as the initial PR. The broader audit of all env vars (from the follow-up comment) is a welcome extension but should land as a separate issue or a follow-up PR to keep the diff reviewable.
    - **Docs**: the `apm config` reference page and the install/auth guide will need updating. Please include a doc patch in the same PR.
    
    See the [configuration reference]((microsoft.github.io/redacted) and the existing `apm config` command surface for context on the current 3 valid keys.

    Per-lens notes (collapsed)

    DevX UX Expert -- User-Need Reviewer

    The request addresses a real and well-understood user-surface gap: package manager users expect a persistent config layer (npm config set, pip config set) and APM's current 3-key surface leaves transport preferences stranded in either one-off CLI flags or shell profile environment variables. The latter is especially painful on Windows where env var persistence differs across PowerShell and cmd. The proposed CLI > env > config > default precedence chain matches the industry convention exactly. The two proposed keys map 1:1 to existing CLI flags, minimising the cognitive surface. The author's broader suggestion (audit all env vars) is a well-motivated extension that would make apm config --help authoritative -- recommended as a follow-up issue rather than scope-creep here.

    Supply Chain Security Expert -- Risk-Surface Reviewer

    This issue touches transport-layer auth selection, which is a security-adjacent surface. The allow-protocol-fallback key is the more sensitive of the two: if it were persisted at project scope (in apm.yml), it could silently enable HTTPS fallback for all contributors of a repo, potentially downgrading transport security without per-user awareness. The recommended mitigation is to restrict allow-protocol-fallback to user-scoped config only. The ssh key carries lower risk since SSH is typically more secure. No theme/security label is required -- the feature itself does not weaken any existing integrity guarantee -- but the design must document config scope boundaries. Primary theme is theme/portability (cross-platform config surface).

    OSS Growth Hacker -- Contributor-Tone Reviewer

    Not activated -- author is a COLLABORATOR with established engagement history; first-time contributor tone-tuning is not applicable.

    Python Architect -- Architecture Reviewer

    Feasibility is high: the existing apm config machinery demonstrates the pattern. The key cross-cutting consideration is that every command using --ssh or --allow-protocol-fallback (install, update, and marketplace operations) must fall through to the config reader when the flag is absent. This is a moderate, well-scoped change -- not a rearchitecture. The minimal 2-key scope in the issue is implementable without a design doc. The broader env-var audit suggested in the follow-up comment should be a separate issue to keep scope reviewable. One design call that must be documented in the PR: whether allow-protocol-fallback is user-scoped only (recommended) or also project-scopeable.

    Doc Writer -- Documentation Reviewer

    Docs work is clearly implied. The implementing PR should update: (1) the apm config reference page to list allow-protocol-fallback and ssh as valid keys with defaults and the precedence chain explanation; (2) the install or auth guide with a section on persisting transport preferences. The area/docs-site label rides as a secondary area so the implementing PR is reminded. The suggested comment wording is precise and preserves the author's key/env-var/flag table pattern, which is good documentation hygiene.

    APM CEO -- Triage Arbiter

    Decision: accept. This is a clear portability gap aligned with APM's cross-platform mission. The 2-key minimal scope is well-specified with a concrete precedence model, no design blocker, and an obvious implementation path. The Supply Chain Security note on allow-protocol-fallback being user-scoped only is a practical constraint, not a blocker. Priority/low reflects that workarounds exist (env vars, repeated flags) and no security path is blocked. Milestone null because open milestones could not be verified in this run; maintainer should assign to the next minor release.

    {
      "decision": "accept",
      "decision_detail": "",
      "theme": "theme/portability",
      "areas": ["area/cli", "area/distribution", "area/docs-site"],
      "type": "type/feature",
      "status": "status/accepted",
      "priority": "priority/low",
      "preserved_labels": [],
      "milestone": null,
      "next_action": "Implement apm config set allow-protocol-fallback and apm config set ssh with user-scoped persistence, wiring the precedence chain into install and marketplace commands, and update the config reference docs.",
      "comment_markdown": "Thanks for this well-structured proposal -- the friction you describe is real and the cross-platform angle (Windows vs. shell profiles) makes it a genuine portability gap."
    }

    Triage status: agentic proposal pending human ratification.
    Silence is approval. Maintainers can:

    • Override any label or milestone above by editing it directly --
      human edits are authoritative and will not be reverted on
      subsequent runs.
    • Re-trigger triage by applying the status/needs-triage label, or
      by removing status/triaged to enroll the issue in the next
      daily sweep.

    Posted by the Triage Panel workflow. See .apm/skills/apm-triage-panel for the panel skill.

    Generated by Triage Panel for issue #1243 · ● 1M · ◷

  4. added
    area/cli
    area/distribution
    area/docs-site
    priority/low
    status/accepted
    status/triaged
    type/feature
    and removed
    status/needs-triage
    on May 10, 2026
  5. moved this from Todo to In Progress in APM Roadmapon May 13, 2026
  6. added 2 commits that reference this issue on May 14, 2026
    6945784
    c96ffa2
  7. added a commit that references this issue on May 24, 2026
    1cd15c0
  8. added a commit that references this issue on May 26, 2026
    2d4d97a
  9. moved this from In Progress to Done in APM Roadmapon May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cliarea/distributionarea/docs-sitepriority/lowstatus/acceptedstatus/triagedtype/feature

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions