Skip to content

fix(init): don't require SFTP account for cf init and non-SFTP commands (2.4.1)#17

Merged
jeffdi merged 1 commit intomainfrom
fix/cf-init-no-sftp-required
Apr 21, 2026
Merged

fix(init): don't require SFTP account for cf init and non-SFTP commands (2.4.1)#17
jeffdi merged 1 commit intomainfrom
fix/cf-init-no-sftp-required

Conversation

@jeffdi
Copy link
Copy Markdown
Contributor

@jeffdi jeffdi commented Apr 21, 2026

Summary

A user reported that after cf login the cf init command aborted with

No SFTP account linked to your platform account. Please run 'cf login' first.

The message is misleading: login had already succeeded, but the user's account had no SFTP account provisioned yet (SFTP accounts are auto-provisioned server-side only after a project deposit is paid/waived/sponsored and an SSH key is on the user's profile — see _auto_provision_sftp_if_eligible in chipignite-backend-services/src/user_service/routes.py). A user evaluating the tooling before committing to a shuttle had no way past init.

The sftp_username is only needed for commands that actually talk to SFTP. Everywhere else it was used only as a label in .cf/project.json that the backend stores as an opaque blob and the CLI never reads back. This PR loosens the gating so new users can onboard end-to-end without an SFTP account and only hit the gate when they actually need SFTP.

Behavior matrix after the fix

Command Works without SFTP account?
cf login, cf logout, cf whoami, cf keygen, cf config yes (already did)
cf init, cf link, cf unlink yes (changed)
cf gpio-config, cf precheck (local), cf precheck --remote, cf push --remote yes (already did)
cf status (platform half) yes — SFTP half now skipped gracefully (changed)
cf push (SFTP), cf pull, cf tapeouts, cf confirm no — gate preserved with a clearer, eligibility-aware message

Changes

  • cf init: no longer aborts when sftp_username is missing. Refreshes from /auth/cli/whoami only when an API key is present; falls back to user_email (or "unknown") for the proj['user'] metadata field. The rest of the init flow is already API-key driven.
  • cf status: the SFTP listing becomes a best-effort extra. When no SFTP account is linked, the command prints the platform status, emits a soft hint, and exits cleanly instead of aborting after already showing useful output.
  • cf push (SFTP path), cf pull, cf tapeouts, cf confirm: the four legitimate SFTP gates keep blocking, but the message now explains the auto-provisioning rules ("provisioned once a project deposit is paid/waived/sponsored and an SSH public key is on your profile") instead of telling users to contact support.
  • Patch bump to 2.4.1 in pyproject.toml. Also aligns chipfoundry_cli/__init__.py which had drifted at 2.3.2.

Test plan

  • pytest full suite: 125 passed, 1 skipped
  • Manual: run cf login with a brand-new account (no SFTP linked), then cf init in an empty project directory — expect success (previously aborted).
  • Manual: on the same account run cf status — expect platform status to print, followed by the SFTP-skipped hint, exit 0.
  • Manual: on the same account run cf push (SFTP) and cf pull — expect the new eligibility-aware error message and non-zero exit.
  • Manual: on an eligible account, verify cf init, cf push, and cf pull behave as before.
  • Manual: verify cf precheck --remote and cf push --remote continue to work for eligible users (no regressions from reorder of api_key/username in cf init).

…ds (2.4.1)

Users without an SFTP account (not yet eligible: no paid/waived/sponsored
project or no SSH key on profile) could not run cf init, because the
command aborted with "No SFTP account linked to your platform account.
Please run 'cf login' first." The SFTP account is only used as a label
in .cf/project.json, which the backend stores as an opaque blob and the
CLI never reads back, so blocking init on it was incorrect.

- cf init: fall back to user_email (or "unknown") for the proj['user']
  metadata field; only refresh sftp_username from /auth/cli/whoami when
  an api_key is present, and never abort.
- cf status: SFTP listing becomes a best-effort extra. When no SFTP
  account is linked, print the platform status, skip SFTP with a soft
  hint, and exit cleanly.
- cf push (SFTP), cf pull, cf tapeouts, cf confirm: keep the SFTP gate
  but replace the "Contact support" message with one that explains the
  eligibility path (deposit paid/waived/sponsored + SSH key on profile).
- Bump version to 2.4.1 in pyproject.toml and align __init__.py which
  had drifted at 2.3.2.

cf precheck (local), cf precheck --remote, and cf push --remote already
worked without SFTP and are unchanged.

Made-with: Cursor
@jeffdi jeffdi force-pushed the fix/cf-init-no-sftp-required branch from 2c07da7 to e9fc548 Compare April 21, 2026 02:32
@jeffdi jeffdi changed the title fix(init): don't require SFTP account for cf init and non-SFTP commands (2.5.0) fix(init): don't require SFTP account for cf init and non-SFTP commands (2.4.1) Apr 21, 2026
@jeffdi jeffdi merged commit b992529 into main Apr 21, 2026
12 checks passed
@jeffdi jeffdi deleted the fix/cf-init-no-sftp-required branch April 21, 2026 02: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