Command Line Interface (CLI)
Relevant source files
The following files were used as context for generating this wiki page:
The Speakeasy CLI allows users to interact with Speakeasy services directly from their terminal. It serves as a control plane for managing Model Context Protocol (MCP) servers, functions, and deployments. Users employ the CLI to authenticate, scaffold new projects, and manage the lifecycle of their AI tools.
Sources: GEMINI.md:37-38, README.md:105-111
CLI Development and Architecture
The CLI is written in Go and resides within the cli/ directory of the main monorepo. Developers can run and test the CLI locally using standard Go commands or the mise task runner.
Sources: CONTRIBUTING.md:270-275, REVIEW.md:5-13
Development Workflow
- Navigate to the
cli/directory. - Run
go run . --helpto view available commands. - Use
misetasks for building and linting.
The diagram shows the standard flow from local development to execution against the Speakeasy API.
Sources: CONTRIBUTING.md:270-275, GEMINI.md:120-130
Key Features and Commands
The CLI provides several sub-commands for managing different aspects of the Speakeasy platform.
| Command Group | Purpose | Primary Actions |
|---|---|---|
auth | Identity Management | Authenticates the CLI with the Speakeasy platform. |
functions | Tool Scaffolding | Initializes and manages Speakeasy Functions. |
mcp | Server Management | Interacts with MCP servers and deployments. |
Sources: ts-framework/create-function/src/main.ts:245-255, GEMINI.md:37-38
Function Initialization
The speakeasy functions init command replaces legacy scaffolders. It creates project structures for Speakeasy Functions or Model Context Protocol (MCP) SDK projects.
- You install the CLI via
brewornpm. - You run
speakeasy functions init. - The CLI prompts for a framework (functions or mcp).
- The CLI creates the directory and initializes dependencies.
Sources: ts-framework/create-function/src/main.ts:60-75
Release and Versioning Process
CLI releases use GoReleaser and follow a strict automated versioning process based on git commit prefixes.
| Prefix | Version Bump | Example |
|---|---|---|
feat!: | Major | feat!: breaking change to deployments |
feat: | Minor | feat: new status fields |
fix: | Patch | patch: update help docs |
All updates to the CLI must follow the defined changeset process to ensure proper documentation of changes.
Sources: CONTRIBUTING.md:295-310, REVIEW.md:145-150
Integration with Mise
The Speakeasy project relies on mise for environment and task management. The CLI interacts with these tasks during setup and local development.
The diagram illustrates how the mise toolchain coordinates CLI builds and environment seeding.
Sources: CONTRIBUTING.md:5-15, README.md:105-115
Summary
The Speakeasy CLI provides an essential interface for developers to manage AI control plane resources. It integrates with the broader Speakeasy ecosystem, including the monorepo's Go-based backend and TypeScript-based functions framework, ensuring a consistent workflow for deploying and observing AI tool usage.