> ## Documentation Index
> Fetch the complete documentation index at: https://webcmd.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create and Maintain CLIs

> Ask an agent to turn a useful workflow into a stable Webcmd command, extend it, or repair it when the target changes.

# Create and Maintain CLIs

Describe the workflow you want. The agent can turn it into a command, keep its output compatible, and verify the result.

## Start With a Workflow

Use a command when a workflow is useful enough to repeat. A private plugin is the default for personal workflows; Webcmd core does not bundle site adapters.

```text theme={null}
Create a private Webcmd adapter for the Acme supplier portal.
Command: webcmd acme part <part_number>
Output: part_number, title, price, currency, stock, moq, lead_time, product_url
Use my `work` profile if login is needed. Read-only only. Verify with two part numbers and return JSON examples.
```

## What to Put in the Prompt

Specify the target, command name, inputs, login needs, safety limits, and verification expectations. Name the JSON fields you need: stable JSON fields are the contract for people and other agents that consume the command.

```text theme={null}
Return JSON rows with stable keys. Use null for missing optional fields. Do not rename existing fields in future updates unless I explicitly ask for a breaking change.
```

## What the Agent Should Do

The agent should check the existing registry first, reuse or extend a matching adapter, explore only when needed, implement the simplest reliable command, and validate it. When updating or healing a command, it preserves compatible inputs and output fields unless you request a breaking change.

## What a Good Handoff Includes

A finished command should include:

* Command usage and output schema.
* Adapter location and strategy used.
* Verification result and JSON examples.
* Known limitations and any required authentication.
* Clear next steps if authentication or site access blocked the work.

## Extend an Existing Command

```text theme={null}
Extend the existing PubMed adapter with a command that returns related articles for a PMID. Match the style of existing PubMed commands and preserve existing command compatibility.
```

## Repair Instead of Duplicating

When a command breaks, repair the existing command instead of creating a near-duplicate.

```text theme={null}
Heal `webcmd acme part ABC-123`. It used to return price and stock, but now stock is null. Preserve the output schema, repair the adapter, and explain the root cause.
```

Only add a new command when the workflow itself has changed.

## Private, Plugin, or Upstream

Keep personal or company workflows in private plugins. The legacy `~/.webcmd/clis/` path remains supported, but new portable work should use plugins. Prepare a plugin for upstream only when it is broadly useful and ready for repository review.
