Skip to content

feat(cli): connect newly created machines in Scalar - #36

Draft
Shengming Liang (AgentWings) wants to merge 1 commit into
codex/eng-743-scalar-cli-authfrom
feat/dcs-317-machines-create-connect
Draft

feat(cli): connect newly created machines in Scalar#36
Shengming Liang (AgentWings) wants to merge 1 commit into
codex/eng-743-scalar-cli-authfrom
feat/dcs-317-machines-create-connect

Conversation

@AgentWings

@AgentWings Shengming Liang (AgentWings) commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Pull Request

Note

TL;DR: Scalar's CLI now supports dedalus machines create --connect as regeneration-safe custom code.
Authorship: AI-assisted by Codex, directed and reviewed by Shengming Liang.
Review context: Slack discussion.

Linear Issue

Ref DCS-317

Summary

What:

Adds a handwritten machines create adapter under src/custom. It sends an empty JSON object through Scalar's generated client so the API supplies the default machine shape, then --connect creates and polls an SSH session and opens the local OpenSSH client with ephemeral credentials and strict host trust.

Why:

First-run users should be able to create and enter a machine with one readable command. This keeps the onboarding command stable while Scalar owns SDK generation and release publication.

Important

Lines added MUST be under +500. Use stacked diffs for larger changes. Deletions are always welcome.

Lines added: 499

Test Plan

  • npm test (124 tests)
  • npm run typecheck
  • SCALAR_BASE_REF=upstream/scalar-next npm run scalar:check
  • node dist/esm/custom/bin.js machines create --help
  • Transport test verifies {}, Bearer auth, and a generated idempotency key
  • Command test verifies the returned machine_id is passed to the connector

Repro / Showcase

dedalus machines create --connect

Tests Added

  • Unit tests
  • Integration tests
  • E2E tests
  • N/A (no new code paths)

Documentation

  • Internal (docs/):

    • N/A - no internal documentation changed.
  • External:

    • README documents the one-command flow and its OpenSSH dependency.

Reviewers

Notes for Reviewers

This follows Scalar's custom-code branch model: the change adds separate handwritten files under src/custom and does not edit scalar-generated or the generated SDK. It is temporarily stacked on #35 because that PR establishes the Scalar custom entry point. Once #35 lands, this branch should advance to scalar-next; Scalar then carries scalar-next into its release PR for main.

The generated snapshot still calls the operation machine-lifecycle create and predates the optional machine-shape schema. This adapter provides the desired public command without modifying generated files. Server-side defaults landed in dedalus-labs/dedalus#5343.

Changelog

2026-08-24

Feedback received:

  • Retarget the implementation from Stainless to Scalar's release platform.

Changes made:

  • Replaced the Go/Stainless implementation with Scalar TypeScript custom code.
  • Added create-and-connect transport, SSH session polling, ephemeral OpenSSH credentials, tests, and README guidance.

@socket-security

socket-security Bot commented Aug 25, 2026

Copy link
Copy Markdown

@AgentWings
Shengming Liang (AgentWings) force-pushed the feat/dcs-317-machines-create-connect branch from 6b839bb to 377ef12 Compare August 25, 2026 00:06
@AgentWings Shengming Liang (AgentWings) changed the title feat(cli): connect newly created machines feat(cli): connect newly created machines in Scalar Aug 25, 2026
@AgentWings
Shengming Liang (AgentWings) changed the base branch from main to codex/eng-743-scalar-cli-auth August 25, 2026 00:07
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.

1 participant