A small robot silhouette climbing stone steps toward a lit open door, holding a coral key, under a teal dusk sky

Run Lessly from an agent that uses the shell

2 min read

Revised September 7, 2026. Product details reflect this revision.

An agent can run commands in a terminal and still have no MCP client. If a platform is available only through MCP, that agent needs another integration before it can do useful work there.

We encountered this when a teammate moved to Pi-agent. At the time, that setup could not connect to Lessly over MCP. The agent could work on our code but could not use the platform in the way our MCP-connected agents did.

The Lessly CLI gives those workflows a command-line interface to the same operation catalog.

Use the interface the workflow already has

Imagine a CI job checking which products an account can access. A shell command fits naturally into that job: run it, read the output, and use the exit code to decide what happens next.

With the CLI installed and authenticated, a read-only example is:

lessly organization product list --json

The command asks the platform for the list and returns JSON. A person at a terminal can omit --json to use the default table output.

Commands come from the platform's operation catalog. The CLI builds its command tree for the current identity and product, so a workflow still needs access to the operation it calls. Using a terminal does not bypass the permission check.

Choose authentication for the workflow

A person can run lessly auth login and approve the request in a browser. An unattended workflow supplies a token instead.

These are not interchangeable security assumptions. Check which identity the credential represents and which products it can reach. In particular, a personal API key inherits its creator's access; the product attached to that key is not a ceiling on its reach.

The CLI guide covers installation and sign-in. Installation currently requires configuring the Lessly package registry for the @lessly scope. The API-key guide explains the key's access behavior.

Make scripts handle the result

A command's output tells you what happened. Its exit code lets a script branch on success or failure. The CLI distinguishes validation errors, authentication problems, and missing or forbidden resources.

Operations that change something ask for confirmation. In a non-interactive shell, a command that needs confirmation fails immediately unless you explicitly pass the documented confirmation flag. Decide which changes the workflow is allowed to make before enabling that behavior.

That leaves the choice of interface with the workflow. An agent with an MCP client can use MCP. A shell-based agent or CI job can use the CLI. Both still need valid credentials and permission for the work they request.

Related posts

Building Lessly in the open

Follow along, and get early access to the private beta.

Join the waitlist