@circuitorg/agent-cli 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +486 -0
  2. package/package.json +54 -0
package/README.md ADDED
@@ -0,0 +1,486 @@
1
+ # Circuit CLI
2
+
3
+ The official command-line tool for creating, testing, and deploying agents on the Circuit platform.
4
+
5
+ ## 📑 Table of Contents
6
+
7
+ - [Circuit CLI](#circuit-cli)
8
+ - [📑 Table of Contents](#-table-of-contents)
9
+ - [🚀 Features](#-features)
10
+ - [📦 Installation](#-installation)
11
+ - [Installation Methods Explained](#installation-methods-explained)
12
+ - [For Private Repository Access](#for-private-repository-access)
13
+ - [Option 1: Direct Download (All Platforms)](#option-1-direct-download-all-platforms)
14
+ - [Option 2: Install via npm/Bun (Requires node/Bun Runtime)](#option-2-install-via-npmbun-requires-nodebun-runtime)
15
+ - [Installation Size Comparison](#installation-size-comparison)
16
+ - [🎯 Quick Start](#-quick-start)
17
+ - [First Steps](#first-steps)
18
+ - [Creating Your First Agent](#creating-your-first-agent)
19
+ - [Step 1a - From Scratch](#step-1a---from-scratch)
20
+ - [Step 1b - Adding an existing agent to the CLI agent registry](#step-1b---adding-an-existing-agent-to-the-cli-agent-registry)
21
+ - [Steps 2-5: Soft deploy, create session for testing, test locally, deploy live](#steps-2-5-soft-deploy-create-session-for-testing-test-locally-deploy-live)
22
+ - [📚 Command Reference](#-command-reference)
23
+ - [Core Commands](#core-commands)
24
+ - [Agent Commands](#agent-commands)
25
+ - [Simulation Commands](#simulation-commands)
26
+ - [Simulation Mode Flags](#simulation-mode-flags)
27
+ - [Authentication Commands](#authentication-commands)
28
+ - [Wallet Commands](#wallet-commands)
29
+ - [🔧 Configuration](#-configuration)
30
+ - [Project Configuration](#project-configuration)
31
+ - [🏗️ Agent Development](#️-agent-development)
32
+ - [Supported Project Types](#supported-project-types)
33
+ - [TypeScript Agents](#typescript-agents)
34
+ - [Python Agents](#python-agents)
35
+ - [Getting Started with Agents](#getting-started-with-agents)
36
+ - [🔧 Troubleshooting](#-troubleshooting)
37
+ - [Common Issues](#common-issues)
38
+ - ["No supported project type detected"](#no-supported-project-type-detected)
39
+ - ["Server failed to start within timeout"](#server-failed-to-start-within-timeout)
40
+ - ["Authentication Required"](#authentication-required)
41
+ - [Need Help?](#need-help)
42
+ - [📄 License](#-license)
43
+ - [📞 Support](#-support)
44
+ - [🔗 Related](#-related)
45
+
46
+ ## 🚀 Features
47
+
48
+ - **Easy Setup**: Initialize new agents with a single command
49
+ - **Local Testing**: Test your agents locally before deploying
50
+ - **Interactive Mode**: User-friendly menus for all commands
51
+ - **Multi-Language**: Support for both TypeScript and Python agents
52
+ - **Zero Dependencies**: Standalone executables work out of the box
53
+ - **Cross-Platform**: Works on macOS, Linux, and Windows
54
+
55
+ ## 📦 Installation
56
+
57
+ ### Installation Methods Explained
58
+
59
+ **Two ways to install Circuit CLI:**
60
+
61
+ 1. **Standalone Executable (Recommended)** - No dependencies required
62
+ - What you get: A self-contained binary with embedded Bun runtime
63
+ - File size: ~57MB (includes everything needed)
64
+ - Best for: Python developers, CI/CD, users without Bun installed
65
+ - Works anywhere, no runtime dependencies
66
+
67
+ 2. **npm/Bun Package** - Requires Bun runtime
68
+ - What you get: Minified JavaScript bundle that runs with your local Bun
69
+ - File size: ~640KB (minified bundle)
70
+ - Best for: JavaScript/TypeScript developers who already have Bun
71
+ - Requires: Bun v1.0.0 or higher installed on your system
72
+
73
+ ### For Private Repository Access
74
+
75
+ Since this repository is currently private, you'll need to download the executables directly from the GitHub releases page.
76
+
77
+ #### Option 1: Direct Download (All Platforms)
78
+
79
+ 1. Go to the [releases page](https://github.com/circuitorg/agents-cli/releases/latest)
80
+ 2. Download the appropriate file for your platform:
81
+ - **macOS Intel**: `circuit-darwin-x64-vX.X.X.tar.gz`
82
+ - **macOS Apple Silicon**: `circuit-darwin-arm64-vX.X.X.tar.gz`
83
+ - **Linux x64**: `circuit-linux-x64-vX.X.X.tar.gz`
84
+ - **Linux ARM64**: `circuit-linux-arm64-vX.X.X.tar.gz`
85
+ - **Windows**: `circuit-windows-x64-vX.X.X.zip`
86
+
87
+ 3. Extract and install:
88
+ ```bash
89
+ # macOS/Linux - One Liner after download
90
+ cd ~/Downloads && tar -xzf circuit-darwin-arm64-v0.1.29.tar.gz && \
91
+ sudo mv circuit-darwin-arm64 /usr/local/bin/circuit && \
92
+ sudo xattr -rd com.apple.quarantine /usr/local/bin/circuit
93
+
94
+ # Verify installation
95
+ circuit --version
96
+ ```
97
+
98
+ #### Option 2: Install via npm/Bun (Requires node/Bun Runtime)
99
+
100
+ **⚠️ Prerequisites**:
101
+ - You must have Bun or node installed - bun install link: (`curl -fsSL https://bun.sh/install | bash`)
102
+ - For global install, you must have a properly configured ~/.npmrc file
103
+ ```bash
104
+ # Sample .npmrc file
105
+ # Create a GitHub Personal Access Token with `read:packages` scope
106
+ # https://github.com/settings/tokens/new
107
+ @circuitorg:registry=https://npm.pkg.github.com
108
+ //npm.pkg.github.com/:_authToken=${NPM_TOKEN}
109
+ ```
110
+
111
+ ```bash
112
+ # Install the CLI (this installs TypeScript source, not a binary)
113
+ npm install -g @circuitorg/agent-cli
114
+ # or with Bun
115
+ bun install -g @circuitorg/agent-cli
116
+ ```
117
+
118
+ **Note**: This method installs a minified JavaScript bundle, not a compiled binary. The `circuit` command will run using your local Bun runtime.
119
+
120
+
121
+ <!-- Remove this comment block when the repository becomes public -->
122
+ <!--
123
+ ### For Public Repository (Future)
124
+ ### Option 1: Quick Install (Recommended)
125
+
126
+ Download and install the standalone executable - no dependencies required:
127
+
128
+ #### macOS/Linux (One-liner)
129
+ ```bash
130
+ # Automatic detection of platform and architecture
131
+ curl -fsSL https://raw.githubusercontent.com/circuitorg/agents-cli/main/install.sh | bash
132
+ ```
133
+
134
+ #### macOS/Linux (Manual one-liner for specific platforms)
135
+ ```bash
136
+ # macOS Apple Silicon
137
+ curl -L https://github.com/circuitorg/agents-cli/releases/latest/download/circuit-darwin-arm64.tar.gz | tar -xz && sudo install -m 755 circuit-darwin-arm64 /usr/local/bin/circuit
138
+
139
+ # macOS Intel
140
+ curl -L https://github.com/circuitorg/agents-cli/releases/latest/download/circuit-darwin-x64.tar.gz | tar -xz && sudo install -m 755 circuit-darwin-x64 /usr/local/bin/circuit
141
+
142
+ # Linux x64
143
+ curl -L https://github.com/circuitorg/agents-cli/releases/latest/download/circuit-linux-x64.tar.gz | tar -xz && sudo install -m 755 circuit-linux-x64 /usr/local/bin/circuit
144
+ ```
145
+
146
+ #### Windows
147
+ ```powershell
148
+ # Quick install (PowerShell)
149
+ Invoke-WebRequest -Uri "https://github.com/circuitorg/agents-cli/releases/latest/download/circuit-windows-x64.exe.zip" -OutFile "circuit.zip"
150
+ Expand-Archive "circuit.zip" -Force
151
+ Remove-Item "circuit.zip"
152
+ # Add to PATH or move circuit.exe to a PATH directory
153
+ ```
154
+
155
+ ### Option 2: Install with package managers
156
+
157
+ ```bash
158
+ # With Homebrew (macOS/Linux)
159
+ brew install circuitorg/tap/circuit
160
+
161
+ # With npm
162
+ npm install -g @circuitorg/agent-cli
163
+
164
+ # With Bun
165
+ bun install -g @circuitorg/agent-cli
166
+ ```
167
+
168
+ | Platform | Architecture | Download |
169
+ |----------|--------------|----------|
170
+ | macOS | Apple Silicon (M1/M2) | `circuit-darwin-arm64.tar.gz` |
171
+ | macOS | Intel | `circuit-darwin-x64.tar.gz` |
172
+ | Linux | x64 | `circuit-linux-x64.tar.gz` |
173
+ | Linux | ARM64 | `circuit-linux-arm64.tar.gz` |
174
+ | Windows | x64 | `circuit-windows-x64.exe.zip` |
175
+
176
+ After downloading:
177
+ ```bash
178
+ # macOS/Linux
179
+ tar -xzf circuit-<platform>.tar.gz
180
+ sudo mv circuit-<platform> /usr/local/bin/circuit
181
+ chmod +x /usr/local/bin/circuit
182
+
183
+ # Windows
184
+ # Extract the zip and add to PATH
185
+ ```
186
+ -->
187
+
188
+ ### Installation Size Comparison
189
+
190
+ | Method | Download Size | Installed Size | Runtime Required |
191
+ |--------|---------------|----------------|------------------|
192
+ | Standalone Executable | ~20-25MB (compressed) | ~57MB | None (self-contained) |
193
+ | npm/Bun Package | ~640KB | ~640KB | Bun v1.0.0+ |
194
+
195
+ ## 🎯 Quick Start
196
+
197
+ ### First Steps
198
+
199
+ ```bash
200
+ # Verify installation
201
+ circuit --version
202
+
203
+ # See all available commands
204
+ circuit --help
205
+
206
+ # Start with interactive mode (recommended for beginners)
207
+ circuit
208
+
209
+ # Get a welcome overview and quick start guide
210
+ circuit welcome
211
+ ```
212
+
213
+ ### Creating Your First Agent
214
+ #### Step 1a - From Scratch
215
+
216
+ ```bash
217
+ # (First time setup only) Authenticate your cli tool with your circuit account
218
+ circuit auth login
219
+
220
+
221
+ # Initialize a new agent project
222
+ circuit agent init
223
+
224
+ # Follow the prompts to:
225
+ # - Choose TypeScript or Python
226
+ # - Name your agent
227
+ # - Set up the project structure
228
+
229
+ # Navigate to your new agent
230
+ cd my-agent
231
+
232
+ # Install your local dependencies (required to run the 'circuit agent simulate' commands)
233
+ bun install
234
+
235
+ ```
236
+
237
+ #### Step 1b - Adding an existing agent to the CLI agent registry
238
+ >Note: If you already have agents and want to deploy via the cli tool, you will need to go through the following steps to ensure the agent is aligned with the current deployment structure.
239
+
240
+ ```bash
241
+ # Navigate to your existing agent
242
+ cd <existing-agent-dir>
243
+
244
+ # Initialize the agent with --no-dir
245
+ # This will add the agent to the CLI's agent registry, and add a main.py/pyproject.toml file (index.ts/package.json for TS agents) to your project.
246
+ # If you already have a main.py file, it will create a main-RENAMEME.py file
247
+ # If you already have a pyproject.toml file, it will simply add the correct circuit config section
248
+ circuit agent init --no-dir
249
+
250
+ # Install your local dependencies (required to run the 'circuit agent simulate' commands)
251
+ bun install
252
+
253
+ # Follow prompts to configure the agent
254
+ ```
255
+ - Next you will need to copy over your existing execution and stop logic, place into the execute and stop functions defined in the template main.py file. See the sdk repo for more details on the overall structure of the app, but at a high level, you will simply need to define your execute and stop functions, and pass to the Agent class, which will handle exposing the correct endpoints based on its deployment location.
256
+
257
+ #### Steps 2-5: Soft deploy, create session for testing, test locally, deploy live
258
+ ```bash
259
+ # Soft deploy your agent to register the agent with Circuit and allow the creation of a test session
260
+ circuit agent deploy
261
+
262
+ # Create a test session
263
+ circuit agent sessions create
264
+
265
+ # Test your agent locally
266
+ circuit agent simulate execute
267
+
268
+ # When ready, deploy to Circuit
269
+ circuit agent deploy --live
270
+ ```
271
+
272
+
273
+ ## 📚 Command Reference
274
+
275
+ ### Core Commands
276
+
277
+ | Command | Description |
278
+ |---------|-------------|
279
+ | `circuit` | Start interactive mode with menu |
280
+ | `circuit --help` | Show help information |
281
+ | `circuit --version` | Show version information |
282
+ | `circuit info` | Display CLI information and status |
283
+ | `circuit configure` | Configure CLI and agent settings |
284
+
285
+ ### Agent Commands
286
+
287
+ | Command | Description |
288
+ |---------|-------------|
289
+ | `circuit agent` | Interactive agent management menu |
290
+ | `circuit agent init` | Initialize a new agent project |
291
+ | `circuit agent deploy` | Deploy an agent to Circuit platform |
292
+ | `circuit agent configure` | Configure agent settings |
293
+ | `circuit agent validate` | Validate agent configuration |
294
+ | `circuit agent info` | Show agent information |
295
+ | `circuit agent status` | Check agent deployment status |
296
+ | `circuit agent sessions` | Manage agent sessions |
297
+ | `circuit agent sessions create` | Create a new agent session |
298
+ | `circuit agent sessions kill` | Kill an agent session |
299
+
300
+ ### Simulation Commands
301
+
302
+ | Command | Description |
303
+ |---------|-------------|
304
+ | `circuit agent simulate` | Interactive simulation menu |
305
+ | `circuit agent simulate execute` | Execute agent logic locally |
306
+ | `circuit agent simulate stop` | Stop agent execution locally |
307
+
308
+ #### Simulation Mode Flags
309
+
310
+ You can bypass the interactive menu by specifying the simulation mode directly:
311
+
312
+ | Flag | Description |
313
+ |------|-------------|
314
+ | `--local` or `-l` | Use local development mode (auto-start server) |
315
+ | `--custom` or `-c` | Use custom server mode (connect to existing server) |
316
+ | `--live` or `-L` | Use deployed/live version of the agent |
317
+ | `--port <number>` or `-p <number>` | Specify port for custom server mode (default: prompts for input) |
318
+
319
+ **Examples:**
320
+ ```bash
321
+ # Test with local development server (auto-start)
322
+ circuit agent simulate execute --local
323
+
324
+ # Connect to custom server on port 8080
325
+ circuit agent simulate execute --custom --port 8080
326
+
327
+ # Test the deployed/live version
328
+ circuit agent simulate execute --live
329
+
330
+ # Stop simulation with custom server
331
+ circuit agent simulate stop --custom --port 8080
332
+ ```
333
+
334
+ ### Authentication Commands
335
+
336
+ | Command | Description |
337
+ |---------|-------------|
338
+ | `circuit auth` | Interactive authentication menu |
339
+ | `circuit auth login` | Login to Circuit platform |
340
+ | `circuit auth logout` | Logout from Circuit platform |
341
+ | `circuit auth whoami` | Check current user |
342
+
343
+ ### Wallet Commands
344
+
345
+ | Command | Description |
346
+ |---------|-------------|
347
+ | `circuit wallet` | Interactive wallet management menu |
348
+ | `circuit wallet import` | Import a wallet |
349
+ | `circuit wallet list` | List all wallets |
350
+
351
+
352
+
353
+ ## 🔧 Configuration
354
+
355
+ ### Project Configuration
356
+
357
+ Create a `circuit.json` file in your agent project:
358
+
359
+ ```json
360
+ {
361
+ "name": "my-agent",
362
+ "description": "My Circuit agent",
363
+ "environment": "development",
364
+ "projectType": "custom",
365
+ "runCommand": "bun index.ts",
366
+ "circuit": {
367
+ "name": "My Agent",
368
+ "slug": "my-agent",
369
+ "description": "A test agent",
370
+ "version": 1,
371
+ "defaultSleepIntervalMinutes": 15,
372
+ "imageUrl": "https://i.imgur.com/GCjt5Hs.png",
373
+ "allowedWalletTypes": ["ethereum"],
374
+ "filesToExclude": ["node_modules", ".git", "*.log"]
375
+ }
376
+ }
377
+ ```
378
+
379
+ ## 🏗️ Agent Development
380
+
381
+ ### Supported Project Types
382
+
383
+ The CLI supports two project types:
384
+
385
+ #### TypeScript Agents
386
+
387
+ ```bash
388
+ # Initialize TypeScript agent
389
+ circuit agent init
390
+
391
+ # Project structure:
392
+ my-agent/
393
+ ├── index.ts # Main agent file
394
+ ├── package.json # Dependencies with @circuitorg/agents-sdk@0.1.4
395
+ └── circuit.json # Agent configuration
396
+ ```
397
+
398
+ **Available Templates:**
399
+ - **Bare**: Simple message sending template (recommended for beginners)
400
+ - **More to come!**
401
+
402
+ #### Python Agents
403
+
404
+ ```bash
405
+ # Initialize Python agent
406
+ circuit agent init
407
+
408
+ # Project structure:
409
+ my-agent/
410
+ ├── main.py # Main agent file
411
+ ├── pyproject.toml # Dependencies
412
+ └── circuit.json # Agent configuration
413
+ ```
414
+
415
+ ### Getting Started with Agents
416
+
417
+ When you run `circuit agent init`, the CLI will:
418
+
419
+ 1. Prompt you to choose TypeScript or Python
420
+ 2. For TypeScript: Select from available templates (bare, self-send, kitchen-sink-evm, or kitchen-sink-solana)
421
+ 3. Create a complete project structure with:
422
+ - Main agent file with example code
423
+ - Configuration file (`circuit.json`)
424
+ - Dependencies file (`package.json` or `pyproject.toml`)
425
+ - Ready-to-run agent template
426
+
427
+ The generated agent includes:
428
+ - HTTP server setup
429
+ - Health check endpoint
430
+ - Execute and stop functions
431
+ - Proper error handling
432
+ - Circuit SDK v1.0 integration with new unified API
433
+ - Template-specific examples (balance checking, transfers, custom transactions)
434
+
435
+
436
+ ## 🔧 Troubleshooting
437
+
438
+ ### Common Issues
439
+
440
+ #### "No supported project type detected"
441
+
442
+ Make sure you're in a directory with the correct project structure:
443
+
444
+ - **TypeScript**: `index.ts` + `package.json`
445
+ - **Python**: `main.py` + `pyproject.toml`
446
+
447
+ #### "Server failed to start within timeout"
448
+
449
+ Check that your agent server:
450
+ 1. Has a `/health` endpoint
451
+ 2. Starts within the timeout period (default: 30 seconds)
452
+ 3. Binds to the correct port
453
+
454
+ #### "Authentication Required"
455
+
456
+ Run `circuit auth login` to authenticate with the Circuit platform.
457
+
458
+ ### Need Help?
459
+
460
+ ```bash
461
+ # Show available commands
462
+ circuit --help
463
+
464
+ # Show help for specific command
465
+ circuit agent --help
466
+
467
+ # Enable verbose output
468
+ circuit --verbose
469
+ ```
470
+
471
+ ## 📄 License
472
+
473
+ MIT License - see [LICENSE](LICENSE) for details.
474
+
475
+
476
+ ## 📞 Support
477
+
478
+ - **Documentation**: [GitHub Wiki](https://github.com/circuitorg/agents-cli/wiki)
479
+ - **Issues**: [GitHub Issues](https://github.com/circuitorg/agents-cli/issues)
480
+ - **Discussions**: [GitHub Discussions](https://github.com/circuitorg/agents-cli/discussions)
481
+
482
+ ## 🔗 Related
483
+
484
+ - [Circuit Platform](https://circuit.org)
485
+ - [Circuit Agents SDK](https://github.com/circuitorg/agents-sdk)
486
+ - [Bun Runtime](https://bun.sh)
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@circuitorg/agent-cli",
3
+ "version": "1.0.1",
4
+ "description": "A CLI tool for deploying agents to the Circuit platform",
5
+ "type": "module",
6
+ "bin": {
7
+ "circuit": "./circuit"
8
+ },
9
+ "files": [
10
+ "circuit",
11
+ "README.md"
12
+ ],
13
+ "scripts": {
14
+ "build": "bun scripts/build.ts",
15
+ "dev": "bun --hot src/index.ts",
16
+ "test": "bun test",
17
+ "test:coverage": "bun test --coverage",
18
+ "typecheck": "bun tsc --noEmit",
19
+ "format": "bun x prettier --write src/**/*.ts",
20
+ "format:check": "bun x prettier --check src/**/*.ts",
21
+ "clean": "rm -f circuit circuit.exe circuit-*",
22
+ "all-checks": "bun run format:check && bun run typecheck && bun run test && bun run build && ./circuit --version"
23
+ },
24
+ "keywords": [
25
+ "cli",
26
+ "circuit",
27
+ "typescript",
28
+ "bun"
29
+ ],
30
+ "author": "circuitorg",
31
+ "license": "MIT",
32
+ "dependencies": {
33
+ "chalk": "^5.4.1",
34
+ "enquirer": "^2.4.1",
35
+ "minimatch": "^10.0.1",
36
+ "ora": "^8.2.0",
37
+ "terminal-link": "^4.0.0",
38
+ "tty-table": "^4.2.3",
39
+ "zod": "^4.0.5"
40
+ },
41
+ "devDependencies": {
42
+ "bun-types": "latest",
43
+ "prettier": "^3.0.0",
44
+ "typescript": "^5.3.0"
45
+ },
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "https://github.com/circuitorg/agents-cli.git"
49
+ },
50
+ "bugs": {
51
+ "url": "https://github.com/circuitorg/agents-cli/issues"
52
+ },
53
+ "homepage": "https://github.com/circuitorg/agents-cli#readme"
54
+ }