Composable CLI

The Composable CLI provides a set of commands to manage and interact with the Composable platform. This documentation covers all available commands, grouped by their logical functionality, and provides examples on how to use each command.

Installation

To install the Composable CLI, follow these steps:

  1. Ensure Node.js is installed: The Composable CLI requires Node.js. You can download and install it from nodejs.org. You can verify Node.js is installed by running:Composable CLI

    node --version
    
  2. Install the Composable CLI globally: Open your terminal and run the following command to install the Composable CLI globally using npm:

    npm install -g @becomposable/cli
    
  3. Verify the installation: After installation, you can verify that the Composable CLI is installed correctly by running:

    composable --version
    

This command displays the version of the Composable CLI installed on your system.

Help

To get help with the Composable CLI.

composable --help

To get help with any Composable CLI command.

composable help [command]

Option get help with any Composable CLI command.

composable <command> --help

Authentication

Commands to manage authentication, such as obtaining JWT tokens and managing API keys.

Commands

  • auth token: Get a JWT token for the API key used in the authentication.

    composable auth token
    
  • auth pk <projectId> [options]: Get or create a public API key associated with the account owning the current API key.

    composable auth pk <projectId> --name <keyName> --ttl <timeToLive>
    

Profiles

Commands to manage configuration profiles which enable using the CLI with different Composable accounts, projects, and infrastructure.

Commands

  • profiles show [name]: Show the configured profiles or the profile with the given name.

    composable profiles show [name]
    
  • profiles use [name]: Switch to another configuration profile.

    composable profiles use [name]
    
  • profiles add [name] [options]: Create a new configuration profile.

    composable profiles add [name] --target <environment>
    
  • profiles edit [name]: Edit an existing configuration profile.

    composable profiles edit [name]
    
  • profiles refresh: Refresh token for the current configuration profile.

    composable profiles refresh
    
  • profiles delete <name>: Delete an existing configuration profile.

    composable profiles delete <name>
    
  • profiles file: Print the configuration file path.

    composable profiles file
    

Projects

Command to list projects.

Command

  • projects: List the projects you have access to.

    composable projects
    

Environments

Command to list environments.

Command

  • envs [envId]: List the environments you have access to.

    composable envs [envId]
    

Interactions

Commands to list interactions, generate test data, run, and search interactions.

Commands

  • interactions: List the interactions available in the current project.

    composable interactions
    
  • interactions <interactionId>: List the details of an interaction given its ID.

    composable interactions <interactionId>
    
  • datagen <interaction> [options]: Generate test data for an interaction given its ID.

    composable datagen <interactionId> --env <envId> --model <model> --temperature <value> --output <file> --count <number>
    
  • run <interactionId> [options]: Run an interaction by ID.

    composable run <interactionId> --input <file> --output <file> --data <json> --tags <tags> --temperature <temperature> --model <model> --env <environmentId> --no-stream --count <count> --verbose --jsonl --data-only
    
  • runs <interactionId> [options]: Search the run history by interaction ID.

    composable runs <interactionId> --tags <tags> --status <status> --env <environmentId> --model <model> --query <query> --limit <limit> --page <page> --format <format> --output <file> --before <date> --after <date>
    

Content Objects

Commands to manage content objects.

Commands

  • content post <file...> [options]: Post a new object to the store. The path to the file can include wildcards by using *.

    composable content post <file...> --name <name> --type <type> --mime <mime> --path <parentPath> --recursive
    
  • content delete <objectId>: Delete an existing object given its ID.

    composable content delete <objectId>
    
  • content get <objectId>: Get an existing object given its ID.

    composable content get <objectId>
    
  • content list <folderPath> [options]: List the objects inside a folder.

    composable content list <folderPath> --limit <limit> --skip <skip>
    

Workflow

Commands to manage workflows and workflow rules.

Commands

  • workflows rules create [options]: Create a new workflow rule.

    composable workflows rules create --name <name> --on <event> --run <endpoint>
    
  • workflows rules get <workflowId> [options]: Get a workflow rule given its ID.

    composable workflows rules get <workflowId> --file <file>
    
  • workflows rules apply [options]: Apply a workflow rule.

    composable workflows rules apply --file <file>
    
  • workflows rules list: List all workflow rules.

    composable workflows rules list
    
  • workflows rules execute <workflowId> [options]: Execute a workflow rule given its ID.

    composable workflows rules execute <workflowId> --objectId <objectId>
    
  • workflows rules delete <objectId>: Delete a workflow rule given its ID.

    composable workflows rules delete <objectId>
    
  • workflows definitions transpile <files...> [options]: Transpile a TypeScript workflow definition to JSON.

    composable workflows definitions transpile <files...> --out <file>
    
  • workflows definitions create [options]: Create a new workflow definition.

    composable workflows definitions create --file <file>
    
  • workflows definitions apply [workflowId] [options]: Apply a workflow definition.

    composable workflows definitions apply [workflowId] --file <file> --skip-validation
    
  • workflows definitions list: List all workflow definitions.

    composable workflows definitions list
    
  • workflows definitions get <objectId> [options]: Get a workflow definition given its ID.

    composable workflows definitions get <objectId> --file <file>
    
  • workflows definitions delete <objectId>: Delete a workflow definition given its ID.

    composable workflows definitions delete <objectId>
    

Code Generation

Commands to generate code based on interactions.

Commands

  • codegen [interactionName]: Generate code given an interaction name or for all the interactions in the project.

    composable codegen [interactionName] --versions <versions> --all --dir <file> --export <version>
    

Package Management

Commands to manage the Composable CLI package.

This command checks if there is a newer version of the CLI available. If a new version is found, it prompts the user to confirm the upgrade. If the user confirms, the Composable CLI will update itself to the latest version. If no updates are available, it will notify the user.

Commands

  • upgrade: Upgrade to the latest version of the CLI.

    composable upgrade
    

Was this page helpful?