Commit graph

71 commits

Author SHA1 Message Date
A
d1ecbaf88c
feat: Add cloud info command (spawn <cloud>) for cloud-first discovery (#192)
Users who know their preferred cloud but not which agents are available
had no way to find out. Now `spawn hetzner` shows all agents available
on Hetzner, mirroring how `spawn claude` shows all clouds for Claude.

- Add cmdCloudInfo() showing cloud details + available agents
- handleDefaultCommand detects cloud names and routes to cloud info
- Update help text and clouds list footer to document the new command
- Bump CLI version to 0.2.15

Agent: ux-engineer

Co-authored-by: A <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 08:54:24 -08:00
A
86dfbacab0
fix: Detect swapped agent/cloud arguments and fix count pluralization (#178)
When users type "spawn sprite claude" instead of "spawn claude sprite",
the CLI now detects the swap and suggests the correct order instead of
showing a confusing "Unknown agent" error. Also fixes grammar in
"spawn agents" and "spawn clouds" output (1 cloud vs 1 clouds).

Agent: ux-engineer

Co-authored-by: A <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 07:42:25 -08:00
A
4133813879
fix: Add typo suggestions and --help flag handling for better CLI UX (#168)
- Add "Did you mean?" suggestions when agent/cloud names have typos
  (using Levenshtein distance, max 3 edits)
- Handle "spawn <agent> --help" to show agent info instead of failing
  with "invalid characters" error on the --help flag
- Handle "--help" after subcommands (spawn list --help, spawn agents --help)
  to show general help instead of silently ignoring the flag
- Bump CLI version to 0.2.13
- Add 15 tests for levenshtein and findClosestMatch functions

Agent: ux-engineer

Co-authored-by: A <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 07:17:11 -08:00
Sprite
18b5aa4a32 fix: Remove curl|bash script validation that blocks spawn scripts
The spawn scripts themselves use curl|bash to install agents (e.g.
Claude Code). The validateScriptContent check was blocking our own
legitimate scripts. Removed curl|bash and wget|bash from the
dangerous patterns list since the scripts are already fetched from
our trusted GitHub repo.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-10 09:40:16 +00:00
Sprite
7c43b901a6 fix: Switch build target from node to bun to fix UTF-8 mojibake
Root cause: Bun has a known bug (oven-sh/bun#25767) where --target=node
causes UTF-8 string literals to be double-encoded as Latin-1, producing
mojibake (â instead of ◆/│/✔). Switching to --target=bun avoids this
encoding path entirely.

Also removes the ineffective stdout.write monkey-patch that was
attempting to work around this issue.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-10 09:36:28 +00:00
A
7100948136
test: Add unicode-detect tests and bump version to 0.2.11 (#164)
Add 16 tests for unicode-detect.ts which had zero coverage.
Tests verify ASCII/Unicode detection based on TERM, SSH,
and SPAWN_UNICODE/SPAWN_ASCII/SPAWN_NO_UNICODE env vars.
Also tests LANG setting and debug output behavior.

Agent: test-engineer

Co-authored-by: A <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
2026-02-10 01:34:54 -08:00
Sprite
67051bfc48 fix: Monkey-patch stdout.write to force UTF-8 Buffer encoding
Explicitly convert string chunks to Buffer.from(chunk, 'utf8') before
writing to process.stdout. This fixes UTF-8 mojibake (â instead of ◆/│)
seen in some Bun + terminal combinations (e.g. Ghostty on macOS) where
process.stdout.write(string) doesn't encode as UTF-8 by default.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-10 09:25:58 +00:00
Sprite
553626e902 feat: Force UTF-8 encoding for Unicode output
Added explicit LANG=en_US.UTF-8 and stdout.setEncoding('utf8')
when Unicode mode is enabled. This should prevent UTF-8 mojibake
(â appearing instead of ◆) in terminals like Ghostty.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-10 09:17:53 +00:00
Sprite
ac1a197dfe debug: Add SPAWN_DEBUG flag to diagnose Unicode detection
Adds debug logging to unicode-detect.ts to help troubleshoot why
Unicode rendering isn't working in Ghostty terminal. When SPAWN_DEBUG=1
is set, the CLI will show:

- Current TERM value (e.g., xterm-ghostty)
- SSH environment variables (SSH_CONNECTION, SSH_CLIENT, SSH_TTY)
- Whether ASCII mode is being forced

This will help identify if SSH detection is incorrectly triggering
ASCII fallback for local Ghostty sessions.

Usage: SPAWN_DEBUG=1 spawn list

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 07:47:43 +00:00
Sprite
4f23fae38f feat: Enable Unicode rendering by default on local terminals
Reverses the overly conservative ASCII-only approach. Now defaults to
Unicode (beautiful spinners, checkmarks, symbols) on local macOS
Terminal, iTerm2, and modern Linux terminals, while still forcing
ASCII fallback for problematic environments:

- SSH sessions (encoding mismatches)
- Dumb terminals (TERM=dumb)
- Users can override with SPAWN_UNICODE=1 or SPAWN_NO_UNICODE=1

This fixes rendering issues while maintaining compatibility across
all environments.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 07:41:24 +00:00
Sprite
dff70afb4b fix: Force CI mode for complete Unicode disabling in CLI
- Set both TERM=linux and CI=true in unicode-detect.ts
- CI env var provides additional Unicode disabling for @clack/prompts
- Fix test imports to use package.json instead of deleted version.ts
- Bump to 0.2.6

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 07:35:20 +00:00
Sprite
875e9adb6b chore: Bump version to 0.2.5 and add version bump policy
- Bumped CLI version from 0.2.4 to 0.2.5
- Added rule to CLAUDE.md: ANY change to cli/ requires a version bump
- Uses semantic versioning (patch for fixes, minor for features, major for breaking)
- Auto-update ensures users get latest version immediately

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 07:24:28 +00:00
Sprite
935d1f5fe9 chore: Bump version to 0.2.4
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 07:15:11 +00:00
Sprite
5962a00c15 chore: Bump version to 0.2.3
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 06:56:47 +00:00
Sprite
13b601239d chore: Bump version to 0.2.2
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 06:53:20 +00:00
Sprite
01042fab5a chore: Bump version to 0.2.1
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 06:49:49 +00:00
Sprite
c4d99daaab feat: Bump version to 0.2.0 and implement auto-update on run
Changes:
- Bumped version from 0.1.0 to 0.2.0
- Changed update-check mechanism to auto-install updates instead of just notifying
- checkForUpdates() now blocks and runs install.sh automatically when update is available
- Added executor wrapper for testability of execSync calls
- Updated all tests to mock executor.execSync instead of child_process.execSync
- Auto-update runs on every spawn invocation (24-hour cache prevents excessive checks)
- On update failure, shows error message but continues with original command

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 06:48:19 +00:00
Sprite
76c427f71e chore: Update dependencies to latest versions
- Update @clack/prompts from ^0.10.0 to ^1.0.0
- Update @types/bun from ^1.2.0 to ^1.3.8
- All tests pass with updated dependencies
2026-02-08 04:41:24 +00:00
Sprite
272812233e refactor: Remove vitest completely, use bun test exclusively
- Remove vitest and @vitest/ui from devDependencies
- Update test scripts to use 'bun test'
- Delete vitest.config.ts (no longer needed)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 04:29:54 +00:00
Sprite
073251362f test: add unit tests for CLI TypeScript implementation
Added comprehensive test suite for cli/ TypeScript code:
- 37 tests covering manifest.ts, commands.ts, and integration scenarios
- Tests for manifest loading, caching, network fallback, and validation
- Tests for all CLI commands (list, agents, clouds, run, help, etc.)
- Integration tests for end-to-end workflows
- ~900 lines of test code covering ~635 lines of source

Test infrastructure:
- Added vitest as test runner for fast execution
- Created isolated test environment with mocked cache directories
- Mocked network calls to avoid external dependencies
- Test coverage for critical paths: caching, offline mode, error handling

All tests passing with proper isolation and cleanup.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 00:52:12 +00:00
L
4087deb14e
Drop nounset (set -u) flag — incompatible with env var checks (#27)
The autonomous refactoring added `set -euo pipefail` but the scripts
check optional env vars with `[[ -n "$VAR" ]]` which is a fatal error
under nounset when the var isn't set (e.g. SPRITE_NAME, OPENROUTER_API_KEY).

Fix: downgrade to `set -eo pipefail` across all 42 affected files.

Co-authored-by: Sprite <noreply@sprite.dev>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-07 16:22:04 -08:00