Skip to content

Flow CLI Integration - Implementation Tasks #8097

Description

@DariaSova

Flow CLI Integration - Implementation Tasks

Overview

Add Flow commands to Shopify CLI that wrap essential Sidekick tool gateway operations for AI Toolkit integration.

Current State: Nothing in production. Prototype validated approach locally.


Implementation Tasks

Shopify/cli Repository

Create Flow Commands

  • Create packages/store/src/cli/commands/flow/workflow/create.ts

    • Wrap CreateOrUpdateWorkflowFromJsonTool
    • Accept workflow JSON input
    • Mark as hidden command
  • Create packages/store/src/cli/commands/flow/workflow/update.ts

    • Wrap CreateOrUpdateWorkflowFromJsonTool
    • Accept workflow JSON input and ID
    • Mark as hidden command
  • Create packages/store/src/cli/commands/flow/workflow/lookup.ts

    • Wrap WorkflowLookupTool
    • Accept workflow ID and optional version
    • Mark as hidden command
  • Create packages/store/src/cli/commands/flow/workflow/metadata.ts

    • Wrap workflow_metadata_update tool
    • Accept name, tags, note parameters
    • Mark as hidden command
  • Create packages/store/src/cli/commands/flow/task/search.ts

    • Wrap TaskSearchTool
    • Accept natural language search query
    • Mark as hidden command
  • Create packages/store/src/cli/commands/flow/task/configuration.ts

    • Wrap TaskConfigurationTool
    • Accept task IDs and optional runtime input
    • Mark as hidden command
  • Create packages/store/src/cli/commands/flow/template/search.ts

    • Wrap TemplateSearchTool
    • Accept business goal search terms
    • Mark as hidden command
  • Create packages/store/src/cli/commands/flow/environment/paths.ts

    • Wrap EnvironmentPathsSearchTool
    • Accept search parameters for field paths
    • Mark as hidden command

Create Flow Services

  • Create packages/store/src/cli/services/flow/dispatch.ts

    • Implement tool gateway communication
    • Route to SK endpoint for tool calls
    • Handle authentication with store tokens
    • Add signed user headers for attribution
  • Create packages/store/src/cli/services/flow/auth.ts

    • Implement Flow store authentication
    • Handle token loading from store auth
  • Create packages/store/src/cli/services/flow/auth-signature.ts

    • Implement user info HMAC signature creation
    • Implement token fingerprint generation

Register Commands

  • Add Flow commands to CLI command registry
  • Ensure commands are hidden from help output

world (Flow Backend) Repository

Create Store Token Authentication

  • Create src/areas/apps/flow/app/controllers/concerns/store_token_authentication.rb

    • Implement store token validation against Admin API
    • Add user extraction from signed headers
    • Implement HMAC signature verification
    • Add timestamp validation
  • Create GraphQL operations for token validation

    • Create get_shop.graphql for basic token validation
    • Create get_store_token_info.graphql for shop metadata

Update Controllers

  • Update tool_call controller to include StoreTokenAuthentication concern
  • Add store token auth as alternative to Identity tokens
  • Ensure audit logging includes user attribution when available

Shopify-AI-Toolkit Repository

Update Flow Skill

  • Update skills/shopify-flow/SKILL.md
    • Document usage of new CLI commands
    • Add examples for each command
    • Specify store parameter requirement

Task Dependencies

1. Flow dispatch service
   ↓
2. Flow auth services
   ↓
3. Flow commands (8 essential commands)
   ↓
4. CLI command registration
   ↓
5. Flow backend store token authentication
   ↓
6. Flow backend controller updates
   ↓
7. AI Toolkit skill documentation

Command Summary

CLI Command SK Tool Purpose
flow workflow create CreateOrUpdateWorkflowFromJsonTool Create new workflow
flow workflow update CreateOrUpdateWorkflowFromJsonTool Update existing workflow
flow workflow lookup WorkflowLookupTool Read workflow definition
flow workflow metadata workflow_metadata_update Update name, tags, note
flow task search TaskSearchTool Find triggers/actions/conditions
flow task configuration TaskConfigurationTool Get task config schemas
flow template search TemplateSearchTool Search workflow templates
flow environment paths EnvironmentPathsSearchTool Discover field paths

Key Design Decisions

  • Wrap only essential SK tools (8 commands vs 17)
  • No local file management
  • Hidden commands in main CLI
  • Store tokens with signed headers for user attribution
  • Commands in store package

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions