Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 134 additions & 0 deletions agent-cli/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*


#lib
lib/
3 changes: 3 additions & 0 deletions agent-cli/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd agent-cli
npx lint-staged
git update-index --again
3 changes: 3 additions & 0 deletions agent-cli/.lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.{ts,md,json}": "npx eslint --fix"
}
3 changes: 3 additions & 0 deletions agent-cli/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore artifacts:
**/lib
package-lock.json
1 change: 1 addition & 0 deletions agent-cli/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
44 changes: 44 additions & 0 deletions agent-cli/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

This repository contains a sample CLI application that demonstrates how to use Vertesia's Agent Runner SDK. The project uses TypeScript and is set up with ESLint, Prettier for code quality.

## Environment Setup

The application requires three environment variables to be set in a `.env` file:

- `VERTESIA_ENVIRONMENT` - The URL for the Vertesia API (default: <https://api.vertesia.io>)
- `VERTESIA_API_KEY` - Your Vertesia API key

## Common Commands

### Development

- **Start the application**: `npm run start` (uses Bun to run the TypeScript directly)
- **Build the application**: `npm run build` (compiles TypeScript to JavaScript in the `lib` directory)
- **Clean build artifacts**: `npm run clean`

### Code Quality

- **Lint the code**: `npm run lint`
- **Format the code**: `npm run format`

## Project Structure

- `src/index.ts` - Main entry point
- `lib/` - Output directory for compiled JavaScript
- `.env` - Environment configuration file (not committed to the repository)

## Architecture

The application uses the `@vertesia/client` SDK to interact with Vertesia's API. The main workflow:

1. Load environment variables from `.env`
2. Initialize the Vertesia client with configuration
3. Execute an asynchronous interaction (conversation)
4. Stream and display the messages from the interaction

When extending this application, follow the pattern of using the Vertesia client's methods to create and manage interactions through their API.
85 changes: 85 additions & 0 deletions agent-cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Vertesia Agent CLI

A command-line interface for interacting with Vertesia's AI agents. This CLI allows you to run conversations with Vertesia agents directly from your terminal.

## Installation

### From Source

1. Clone the repository
2. Install dependencies:

```bash
npm install
```

3. Build the project:

```bash
npm run build
```

4. Link the CLI to make it available globally:

```bash
npm link
```

## Configuration

Create a `.env` file in the project root with the following variables:

```env
VERTESIA_API_KEY=<your_vertesia_api_key>
```

## Usage

### Getting Help

```bash
agent --help
```

### Running a Simple Agent Conversation

```bash
agent run "Generate 5 creative business ideas for a tech startup and store those as individual content objects in a collection"
```

### Running an Interactive Conversation

```bash
agent run "Help me debug my React application" --interactive
```

### Specifying Agent Type

```bash
agent run "Create a marketing plan" --agent MarketingAgent
```

## Command Options

- `--interactive`, `-i`: Enable interactive mode where you can converse with the agent
- `--agent`, `-a`: Specify the agent type to use (default: MultipurposeAgent)

## Features

- Markdown rendering: Agent responses are rendered as markdown in the terminal
- Interactive mode: Have real-time conversations with agents
- Configurable agent types: Use different specialized agents for different tasks
- Color-coded messages: Easily distinguish between user and agent messages
- Link transformation: Resource references like `store:abc123` and `collection:xyz789` are automatically converted to clickable URLs
- Styled hyperlinks: Links appear with white text and underline for better visibility

## Development

- Run in development mode: `npm run dev`
- Build the project: `npm run build`
- Run linting: `npm run lint`
- Format code: `npm run format`

## License

APL-2.0 © Vertesia
7 changes: 7 additions & 0 deletions agent-cli/env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Rename this file to .env and fill in the appropriate values

# Vertesia API URL (default: api.vertesia.io)
VERTESIA_ENVIRONMENT=api.vertesia.io

# Your Vertesia API key (required)
VERTESIA_API_KEY=your_api_key_here
22 changes: 22 additions & 0 deletions agent-cli/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
files: ["**/*.ts"],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: "./tsconfig.json",
},
},
plugins: {
"@typescript-eslint": tseslint.plugin,
},
rules: {
"@typescript-eslint/no-floating-promises": "error",
},
},
);
Loading