Skip to content

speakeasy-api/cli

Repository files navigation

Speakeasy AI Control Plane

Speakeasy AI Control Plane


Learn more »

Built by Speakeasy
Speakeasy Functions · CLI · Support · Contributing


Speakeasy CLI

Public function tooling for the Speakeasy AI Control Plane.

This repository contains the TypeScript framework for authoring hosted MCP tools, the scaffolding package for new function projects, and the Go CLI used to authenticate, stage, push, and inspect deployments.

Layout

  • go/cli: Go CLI entrypoint. This depends on the generated Go SDK in go/sdk, not on server packages.
  • go/sdk: Generated Go SDK for the Speakeasy Control Plane API.
  • ts/create-function: Project scaffolding for new function projects.
  • ts/functions: TypeScript functions framework package.

Speakeasy Functions

Create agentic tools from simple TypeScript code using Speakeasy Functions, the functions framework for the Speakeasy AI Control Plane. Functions can be deployed to hosted MCP servers or run locally during development.

The fastest way to get started is with the Speakeasy function scaffolder, which creates a complete TypeScript project with a working function.

# Scaffold a new function project and follow the prompts
npm create @gram-ai/function@latest

# Move into your newly created function directory
cd my_function

# Build and deploy
npm run build
npm run push

A default function is created for you.

import { Gram } from "@gram-ai/functions";
import * as z from "zod/mini";

const functions = new Gram().tool({
  name: "add",
  description: "Add two numbers together",
  inputSchema: { a: z.number(), b: z.number() },
  async execute(ctx, input) {
    return ctx.json({ sum: input.a + input.b });
  },
});

export default functions;

The generated project also includes a local MCP server entrypoint so you can test tools with MCP Inspector using pnpm run dev.

Common function use cases include:

  • Powering in-application chat by exposing context from internal APIs or third-party APIs through tools.
  • Adding data and actions to AI workflows in platforms such as Zapier and n8n.
  • Creating higher-order tools that compose lower-level API calls.
  • Managing and securing MCP servers for an organization through a unified control plane.

See the TypeScript functions README for framework details.

CLI

The Speakeasy CLI provides scripted access to the Speakeasy AI Control Plane. Use it to authenticate, stage function artifacts, push deployments, and check deployment status.

Install the CLI on macOS or Linux:

curl -fsSL https://raw.githubusercontent.com/speakeasy-api/cli/main/install-cli.sh | bash

Install the CLI on Windows:

iwr -useb https://raw.githubusercontent.com/speakeasy-api/cli/main/install-cli.ps1 | iex

Authenticate before pushing deployments:

gram auth

Stage and push a function artifact:

gram stage function --slug my-function --location ./dist/function.zip
gram push

See the CLI README for local development and testing.

Support

  • Slack: Join our Slack for support and discussions.
  • In-app: When using the Speakeasy application, you can engage with the core maintainers of the product.
  • GitHub: Contribute or report issues on this repository.
  • Documentation: View the Speakeasy docs for function framework guidance.

Contributing

Contributions are welcome. Please open an issue or discussion for questions or suggestions before starting significant work.

For package-specific development notes, see the README files in ts/functions, go/cli, and go/sdk.

About

Track the state of your API and orchestrate your API lifecycle from code to artifacts to infra. Manage your APIs with ease !

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors