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

# Inworld Runtime CLI

> Toolkit for graph development, deployment, and experimentation

The [Inworld Runtime CLI](https://www.npmjs.com/package/@inworld/runtime) is a comprehensive command-line toolkit that streamlines the entire lifecycle of Runtime graph development - from initial prototyping to production deployment and continuous optimization.

To download and install Inworld Runtime CLI, run the following command:

```bash npm theme={"system"}
npm install -g @inworld/runtime
```

## Commands

The CLI follows a logical command hierarchy that matches developer workflows:

```
inworld-runtime
├── auth          # Authentication
│   ├── login     # User authentication (alias: inworld-runtime login)
│   ├── logout    # Sign out (alias: inworld-runtime logout)
│   ├── print-access-token  # Display access token
│   ├── print-api-key       # Display API key
│   └── status    # Show authentication status (alias: inworld-runtime status)
├── init          # Project creation with templates  
├── graph         # Graph management and deployment
│   ├── run       # Local testing and development (alias: inworld-runtime run)
│   ├── serve     # Local HTTP/gRPC servers (alias: inworld-runtime serve)
│   ├── deploy    # Cloud deployment (alias: inworld-runtime deploy)
│   ├── visualize # Generate architectural diagrams
│   └── variant   # A/B testing and experimentation
├── tts           # Text-to-speech synthesis
└── workspace     # Workspace management
```

## Project Initialization

The `inworld-runtime init` command downloads the `llm-to-tts-node` template—a production-ready LLM to TTS pipeline.

<Note>Currently, only the `llm-to-tts-node` template is available via CLI. CLI support for fetching additional templates is coming soon. To view all available templates, visit the [templates repository](https://github.com/inworld-ai/inworld-runtime-templates-node).</Note>

For graph-only examples that demonstrate specific Runtime features, clone the [templates repository](https://github.com/inworld-ai/inworld-runtime-templates-node) directly.

```bash theme={"system"}
# Initialize with the llm-to-tts-node template
inworld-runtime init --template llm-to-tts-node --name my-ai-app

# Skip dependency installation prompt
inworld-runtime init --template llm-to-tts-node --name my-ai-app --skip-install

# Force refresh template cache (download fresh copy even if cached)
inworld-runtime init --template llm-to-tts-node --name my-ai-app --force
```

**Init Command Options:**

* `-n, --name <name>` - Name of the project directory
* `-t, --template <template>` - Template to use (currently only `llm-to-tts-node`)
* `--skip-install` - Skip dependency installation prompt
* `--force` - Force refresh template cache (download fresh copy even if cached)

## Working with Graphs

Once you have a `graph.ts` file (either from a template project or created manually), you can use the following commands to work with your graph:

### Local Testing

Test your graph locally with instant feedback:

```bash theme={"system"}
# Test locally with instant feedback
inworld-runtime run ./graph.ts '{"input": {"user_input": "test message"}}'
```

### Visualization

Generate architectural diagrams of your graph:

```bash theme={"system"}
# Visualize complex graph architectures  
inworld-runtime graph visualize ./graph.ts --output ./docs/architecture.png
```

<Note>Graph visualization requires [Graphviz](https://graphviz.org/) to be installed on your system.</Note>

### Local Server

Serve your graph locally with support for both HTTP (with optional Swagger UI) and gRPC:

```bash theme={"system"}
# Serve on HTTP Server with Swagger
inworld-runtime serve ./graph.ts --swagger  

# Serve on custom port
inworld-runtime serve ./graph.ts --port 8080

# Serve on custom host
inworld-runtime serve ./graph.ts --host 0.0.0.0 --port 3000

# Combine options
inworld-runtime serve ./graph.ts --host 0.0.0.0 --port 8080 --swagger

# gRPC server for high-performance applications
inworld-runtime serve ./graph.ts --transport grpc 
```

## Cloud Deployment

Once you’ve successfully built your graph, you can deploy it to Inworld Cloud to create a persistent, production-ready endpoint. See [Cloud Deployment](/node/cli/deploy) for more details.

```bash theme={"system"}
# Deploy to cloud with persistent endpoint
inworld-runtime deploy ./graph.ts
```

## A/B Testing & Experimentation

You can use the CLI to create and manage graph variants, such as model or prompt changes, for [A/B testing and experimentation](/portal/graph-registry). Your clients will automatically use the latest variants—no client-side updates required.

```bash theme={"system"}
# Register different variants for testing
inworld-runtime graph variant register -d baseline ./graph-v1.ts
inworld-runtime graph variant register -d experiment ./graph-v2.ts

# Configure traffic splits in Portal, monitor results
```

## TTS

Use the CLI to quickly get started with [Inworld TTS](/tts/tts). Generate speech content with direct TTS commands:

```bash theme={"system"}
# Direct TTS synthesis for immediate use
inworld-runtime tts synthesize "Hello world" --voice Dennis --output audio.mp3
```

To create graphs that use TTS, initialize a template project with `inworld-runtime init --template llm-to-tts-node` (see [Project Initialization](#project-initialization) above).

## Telemetry

The Inworld Runtime CLI collects general usage data to help us improve the tool.
Information such as the following are tracked:

* Command execution time
* CLI version
* Command name

**Managing Telemetry**

Inworld takes privacy and security seriously.

You can opt-out if you prefer not to share any telemetry information.

```bash theme={"system"}
# Disable telemetry collection
inworld-runtime auth disable_telemetry

# Enable telemetry collection
inworld-runtime auth enable_telemetry
```

## Next Steps

Ready to start building with the Inworld Runtime CLI?

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/node/quickstart">
    Guide to installation, authentication, and first project setup
  </Card>

  <Card title="Deployment Guide" icon="cloud" href="/node/cli/deploy">
    Deploy your graphs to production with persistent endpoints
  </Card>
</CardGroup>

## Need Help?

* **[Troubleshooting Guide](/node/cli/troubleshooting)** - Common issues and solutions
* **CLI Help**: Run `inworld-runtime help` or `inworld-runtime [command] --help` for detailed command information
