Skip to content

feat(cli): add studio connect command#8

Merged
ABB65 merged 5 commits intomainfrom
feat/studio-connect
Apr 13, 2026
Merged

feat(cli): add studio connect command#8
ABB65 merged 5 commits intomainfrom
feat/studio-connect

Conversation

@ABB65
Copy link
Copy Markdown
Member

@ABB65 ABB65 commented Apr 13, 2026

Summary

  • contentrain studio connect — new interactive command that links a local repo to a Contentrain Studio project in one flow: workspace selection → GitHub App installation → git remote detection → .contentrain/ scan → project creation
  • 5 new StudioApiClient methodscreateProject, listGitHubInstallations, getGitHubSetupUrl, listGitHubRepos, scanRepository
  • 5 new typesGitHubInstallation, GitHubRepo, ScanResult, CreateProjectPayload, GitHubSetupUrl
  • openBrowser refactor — extracted from login.ts to src/utils/browser.ts for reuse
  • Validate test fix — replaced 80 sequential git branch spawns with single git update-ref --stdin call (30s timeout → ~4s)
  • Documentationstudio connect added to root README, CLI README, docs/packages/cli.md, docs/studio.md, docs/getting-started.md

Commits

  1. refactor(cli) — extract openBrowser to shared utility
  2. feat(cli) — add studio connect command + types + client methods + tests
  3. fix(cli) — batch branch creation in validate integration test
  4. docs — add studio connect documentation across all doc layers
  5. chore — add changeset for cli minor

Test plan

  • npx tsc --noEmit — 0 errors
  • npx oxlint src/ tests/ — 0 warnings, 0 errors
  • npx vitest run — 117/117 tests pass (23 files, including 14 new tests)
  • Validate integration test (80 branches) completes in ~4s instead of timing out
  • Merge PR → changesets/action opens release PR → merge release PR → npm publish

🤖 Generated with Claude Code

Contentrain and others added 5 commits April 13, 2026 15:57
Move the platform-aware browser-open helper from login.ts to
src/utils/browser.ts so it can be reused by the new connect command.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New interactive command that links a local repository to a Contentrain
Studio project in a single flow:

1. Authenticate (resolveStudioClient)
2. Select or auto-detect workspace
3. Check GitHub App installation, open browser setup if missing
4. Detect git remote and match against accessible repos
5. Scan repository for .contentrain/ configuration
6. Create project and save workspace/project defaults

Additions:
- 5 new types: GitHubInstallation, GitHubRepo, ScanResult,
  CreateProjectPayload, GitHubSetupUrl
- 5 new StudioApiClient methods: createProject, listGitHubInstallations,
  getGitHubSetupUrl, listGitHubRepos, scanRepository
- connect.ts command with --workspace and --json flags
- parseGitHubRepoFromUrl helper (SSH + HTTPS)
- 14 new tests (5 client + 9 command/parser)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace 80 sequential git-branch process spawns with a single
git update-ref --stdin call via spawnSync. The test was timing out
at 30s and consuming excessive resources; it now completes in ~4s.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Root README: add studio login/connect to quick reference
- CLI README: add connect to commands table and Studio Integration
- docs/packages/cli.md: add Connecting a Repository section with
  5-step flow, flags, and tip box
- docs/studio.md: add Connecting from the CLI section
- docs/getting-started.md: add connect to Team Workflows section

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 13, 2026

Deploy Preview for contentrain-ai ready!

Name Link
🔨 Latest commit 8c3e659
🔍 Latest deploy log https://app.netlify.com/projects/contentrain-ai/deploys/69dce8e41e72b70008dfa0f8
😎 Deploy Preview https://deploy-preview-8--contentrain-ai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ABB65 ABB65 merged commit 86ee240 into main Apr 13, 2026
5 checks passed
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