Skip to content

plit api subcommands — CLI wrapper over generated Pipelit client #18

Description

@theuseless-ai

Goal: Add plit api subcommand tree that wraps the generated pipelit-client crate, providing CLI access to all Pipelit API endpoints.

Context: The generated client handles HTTP + serialization. This ticket adds the clap subcommand structure, argument parsing, and output formatting. Uses the token from plit auth login.

Subcommand tree:

plit api
├── workflow list [--limit N] [--offset N]
├── workflow get <slug>
├── workflow create --name <name> --slug <slug> [--description ...]
├── workflow update <slug> [--name ...] [--description ...]
├── workflow delete <slug>
├── workflow validate <slug>
├── workflow import-dsl --file <path>
├── workflow export-dsl <slug>
├── node list <workflow-slug>
├── node create <workflow-slug> --type <component_type> [--label ...] [--config ...]
├── node update <workflow-slug> <node-id> [--label ...] [--config ...]
├── node delete <workflow-slug> <node-id>
├── edge list <workflow-slug>
├── edge create <workflow-slug> --source <id> --target <id> [--type direct|conditional]
├── edge delete <workflow-slug> <edge-id>
├── execution list [--workflow <slug>] [--status ...]
├── execution get <execution-id>
├── execution cancel <execution-id>
├── credential list
├── credential create --name <name> --type <llm|gateway|git|tool>
├── credential test <id>
└── credential models <id>

Output modes (existing plit pattern):

  • TTY: human-readable tables
  • Piped: JSON
  • --json flag: force JSON

Acceptance Criteria:

  • plit api workflow list works end-to-end
  • plit api workflow get <slug> shows nodes/edges
  • plit api node create with --config JSON flag
  • plit api execution list with status filtering
  • All CRUD operations for workflow, node, edge, execution, credential
  • plit api workflow import-dsl reads DSL file and creates workflow
  • plit api workflow export-dsl outputs DSL text
  • Auth from existing plit config (no re-login)
  • --json output mode for all commands
  • Tab completion for component_type values

Dependencies: Generated API client crate (plit #12)

Priority: P0 (agents need this to interact with Pipelit)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions