Coherent CLI

The Coherent Command Line Interface (CLI) is a tool designed to help you manage your Coherent agents and variables across different environments.

Installation

To install the Coherent CLI, navigate to the prompts repository and run the following command:

pip install -e .

This command installs the necessary dependencies and allows you to execute the coherent command from your terminal.


Usage

Once installed, you can use the coherent command to interact with your Coherent environments.

Command Overview

Run coherent --help to see the available options and usage information.

Command Output

CLI
coherent --help
Usage: coherent [OPTIONS] [ENVIRONMENT]

  Update agents/variables for a given environment.

  Arguments:
    environment  The environment to use. Valid options are: local, qa, prod.

  Expected file structure:

        ./Organization/Team/@Agent.md

        ./Organization/{VARIABLE}.md

Options:
  --create  Create new agents/variables if they don't exist.
  --watch   Watch for file changes and update automatically
  --sync    Pulls changes and non-default attributes for all agents/variables
            in all organizations that the user is a member of.
  --help    Show this message and exit.

Environments

The Coherent CLI supports different environments to help you manage and deploy agents and variables appropriately.

Supported Environments

Specify the environment when running the coherent command. If not specified, it defaults to local.

local: For local development and testing. qa: For quality assurance and staging. prod: For production use.

Examples

CLI
Environments
coherent qa

Commands

Below are the primary commands and options you can use with the Coherent CLI.

coherent

Updates agents and variables for the specified environment.

Usage

coherent [OPTIONS] [ENVIRONMENT]

Arguments

ENVIRONMENT: (Optional) The environment to use. Valid options are local, qa, and prod. Defaults to local if not specified.

Update Agents and Variables

coherent qa

--create

Option to create new agents and variables if they don't exist in the specified environment.

Usage

coherent --create [ENVIRONMENT]

Using --create ensures that any agents or variables defined in your file structure are created in the environment if they are missing.

Example

coherent --create qa

--watch

Option to watch for file changes and update agents and variables automatically.

Usage

coherent --watch [ENVIRONMENT]

When you use --watch, the CLI monitors your local files for changes and updates the agents and variables in real-time.

Example

coherent --watch qa

--help

Displays usage information and a summary of available commands and options.

Usage

coherent --help

Command Output

Usage: coherent [OPTIONS] [ENVIRONMENT]

  Update agents/variables for a given environment.

  Arguments:
    environment  The environment to use. Valid options are: local, qa, prod.

  Expected file structure:

        ./Organization/Team/@Agent.md

        ./Organization/{VARIABLE}.md

Options:
  --create  Create new agents/variables if they don't exist.
  --watch   Watch for file changes and update automatically
  --sync    Pulls changes and non-default attributes for all agents/variables
            in all organizations that the user is a member of.
  --help    Show this message and exit.

File Structure

The CLI expects agents and variables to be defined in a specific file structure:

./Organization/Team/@Agent.md
./Organization/{VARIABLE}.md

Example Structure

./MyCompany/Engineering/@Agent.md
./MyCompany/Engineering/PROJECT_NAME.md
./MyCompany/Marketing/@MarketingAgent.md
./MyCompany/SALES_TARGET.md

Place your agent definitions and variables in markdown files following this structure. This allows the CLI to locate and update them correctly.

Was this page helpful?