Skip to content

Port mesa-cli to TypeScript with new workflow commands#14

Open
itsdarrylnorris wants to merge 7 commits intomasterfrom
typescript-port
Open

Port mesa-cli to TypeScript with new workflow commands#14
itsdarrylnorris wants to merge 7 commits intomasterfrom
typescript-port

Conversation

@itsdarrylnorris
Copy link
Copy Markdown
Contributor

Summary

This PR is a complete rewrite of mesa-cli from JavaScript to TypeScript, adding comprehensive workflow management commands and improving the overall developer experience.

Major Changes

  • TypeScript Port: Complete rewrite from JavaScript to TypeScript with full type definitions
  • New Workflow Commands: Added suite of workflow management commands for testing, debugging, and managing workflows
  • Interactive UI: Added interactive pickers for workflow and payload selection
  • Improved Testing: Added unit tests for core modules
  • Documentation: Comprehensive CLAUDE.md reference guide and updated README

New Commands

Command Description
mesa workflow list List all workflows with filtering, sorting, and pagination
mesa workflow enable Enable a workflow (interactive or by ID)
mesa workflow disable Disable a workflow with confirmation
mesa workflow test Run full workflow test with payload selection
mesa workflow step test Run step-level tests
mesa workflow activity View recent workflow executions
mesa workflow debug enable/disable/status Manage debug logging
mesa workflow time-travel Check status or start backfill operations
mesa workflow create Interactive workflow creation wizard
mesa logs View logs with interactive automation selector
mesa cache clear/status Cache management

New Features

  • Interactive Workflow Picker: Searchable list with status indicators
  • Test Payload Picker: Select from fixture payloads or use custom JSON files
  • Test Runner: Polls for test completion with progress display and detailed results
  • Table Formatting: Consistent table output using cli-table3
  • Spinner Support: Progress indicators using ora
  • JSON Output Mode: All commands support --json for CI/scripting
  • Non-Interactive Mode: All commands work in CI environments

Technical Improvements

  • Full TypeScript with strict type checking
  • Modular command structure under src/commands/
  • Shared utilities in src/lib/ (client, config, table, pickers)
  • Comprehensive type definitions in src/types/index.ts
  • Unit tests using Node.js built-in test runner

New Dependencies

  • cli-table3 - Table formatting
  • ora - Spinner/progress indicators
  • @inquirer/prompts - Interactive prompts

Files Changed

  • 39 files changed
  • ~12,500 lines added
  • Complete TypeScript source in src/
  • New test files (*.test.ts)
  • Updated documentation (README.md, CLAUDE.md)

Test plan

  • Run npm run build - verify TypeScript compiles
  • Run npm test - verify all tests pass
  • Run npm run typecheck - verify no type errors
  • Test mesa auth login - verify OAuth flow works
  • Test mesa workflow list - verify workflows are listed
  • Test mesa workflow test <id> - verify test execution works
  • Test mesa workflow debug enable <id> - verify debug toggle works
  • Test commands with --json flag for CI compatibility
  • Test commands in non-interactive mode

🤖 Generated with Claude Code

itsdarrylnorris and others added 7 commits January 26, 2026 15:50
- Add tsconfig.json with strict mode and noUnusedLocals/Parameters
- Convert cli.js to TypeScript with full type definitions
- Convert generate-fields.js to TypeScript
- Add type definitions for all API responses, config, and CLI options
- Update package.json with modern dependencies (axios 1.x, commander 12.x)
- Add yaml package for config parsing (replaces config-yml)
- Add open package for browser launching
- Create modular structure: src/types, src/lib, src/commands
- Add docs/auth-investigation.md with findings on current auth

The CLI now builds with zero TypeScript errors under strict mode.
All existing commands preserved: push, pull, watch, export, install,
test, replay, logs. New auth command structure added for upcoming
browser-based authentication flow.
- Add smoke tests for config module (loadConfig, ConfigError, etc)
- Add tests for type guards (isObject, isArray, isMesaConfig, etc)
- Fix auth endpoint URLs to use .json suffix
- Update README with comprehensive documentation:
  - Installation instructions
  - Quick start guide
  - All commands with examples
  - Configuration options
  - Development instructions
  - Troubleshooting section
- Add interactive searchable list when running `mesa logs` without arguments
- Show automation name, status (enabled/disabled), last run time, and ID
- Type to filter automations by name or ID
- Add "All automations" option to view all logs
- Fix automation_id filtering in MESA API (read from GET params)
- Add @inquirer/prompts dependency for interactive prompts
- Remove investigation docs
- Add workflow list, enable, disable, test, step-test, activity,
  and time-travel commands
- Add interactive workflow picker and test payload picker
- Add test runner with polling and result formatting
- Add table formatting utility with cli-table3
- Extend client with Admin API operations for workflow management
- Add ora spinner for better UX during async operations
- Add CLAUDE.md project documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add documentation for:
- workflow list - list all workflows
- workflow enable/disable - manage workflow state
- workflow test - run full workflow tests
- workflow step test - run step tests
- workflow activity - view recent executions
- workflow debug - manage debug logging
- workflow time-travel - backfill operations

Update project structure to reflect new files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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