Skip to main content

CLI Packages Overview

Overview

Token Ring provides two primary CLI packages for different use cases:

@tokenring-ai/cli - Current Terminal Interface

Purpose: Provides a basic terminal interface for interacting with Token Ring AI agents and services.

Key Features:

  • Simple terminal-based interface
  • Agent selection and management
  • Basic human interface request handling
  • Command history and auto-completion
  • Support for commands like /edit and /multi

Use Case: Simple terminal interactions with minimal UI features.

@tokenring-ai/cli-ink - Ink-based Enhanced Interactive CLI

Purpose: Provides an enhanced, interactive terminal interface using the Ink framework for rich terminal applications.

Key Features:

  • Interactive terminal interface with Ink framework
  • Real-time event processing with color-coded output
  • Comprehensive command support (/help, /markdown, /quit, /exit)
  • Dynamic screen management
  • Code block syntax highlighting
  • Responsive layout that adapts to terminal size
  • Web application integration
  • Workflow agent spawning

Use Case: Feature-rich terminal experience with advanced UI capabilities.

Comparison

Feature@tokenring-ai/cli@tokenring-ai/cli-ink
UI FrameworkBasic terminal UIInk framework
Output FormattingBasic textColor-coded, syntax highlighting
Commands/edit, /multi/help, /markdown, /quit, /exit
Screen ManagementBasic screensDynamic screen switching
Human InterfaceBasic handlingComprehensive handling with multiple request types
Web IntegrationLimitedFull SPA and web application support
Workflow SupportBasicAdvanced workflow agent spawning

Usage

For Basic Terminal Interface

import { TokenRingApp } from '@tokenring-ai/app';
import cliPlugin from '@tokenring-ai/cli';

const app = new TokenRingApp();
app.use(cliPlugin);
await app.start();

For Enhanced Ink-based Interface

import { TokenRingApp } from '@tokenring-ai/app';
import cliInkPlugin from '@tokenring-ai/cli-ink';

const app = new TokenRingApp();
app.install(cliInkPlugin);
await app.start();

@tokenring-ai/cli Dependencies

  • @tokenring-ai/agent: Core agent framework
  • @tokenring-ai/app: Application framework
  • @tokenring-ai/chat: Chat service
  • @inquirer/prompts: Interactive prompts
  • chalk: Terminal color styling
  • execa: Process execution

@tokenring-ai/cli-ink Dependencies

  • @tokenring-ai/agent: Core agent framework
  • @tokenring-ai/app: Application framework
  • @tokenring-ai/utility: Shared utilities
  • @tokenring-ai/web-host: Web resource hosting
  • ink: Terminal UI framework
  • ink-syntax-highlight: Code syntax highlighting
  • @inquirer/prompts: Interactive prompts
  • chalk: Terminal color styling
  • execa: Process execution
  • open: URL opening

Development Status

  • @tokenring-ai/cli: Active development, recommended for new projects
  • @tokenring-ai/cli-ink: Stalled due to the horrible performance and UI glitching problems in the ink package