@circuitorg/agent-cli 1.0.7 → 1.1.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.
package/README.md CHANGED
@@ -13,16 +13,11 @@ The official command-line tool for creating, testing, and deploying agents on th
13
13
  - [🎯 Quick Start](#-quick-start)
14
14
  - [First Steps](#first-steps)
15
15
  - [Creating Your First Agent](#creating-your-first-agent)
16
- - [Step 1a - From Scratch](#step-1a---from-scratch)
17
- - [Step 1b - Adding an existing agent to the CLI agent registry](#step-1b---adding-an-existing-agent-to-the-cli-agent-registry)
18
- - [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)
19
16
  - [📚 Command Reference](#-command-reference)
20
17
  - [Core Commands](#core-commands)
21
- - [Agent Commands](#agent-commands)
22
- - [Simulation Commands](#simulation-commands)
23
- - [Simulation Mode Flags](#simulation-mode-flags)
24
- - [Authentication Commands](#authentication-commands)
18
+ - [Agent Management Commands](#agent-management-commands)
25
19
  - [Wallet Commands](#wallet-commands)
20
+ - [Run Command Flags](#run-command-flags)
26
21
  - [Getting Started with Agents](#getting-started-with-agents)
27
22
  - [🔧 Troubleshooting](#-troubleshooting)
28
23
  - [Common Issues](#common-issues)
@@ -79,65 +74,53 @@ circuit
79
74
  ```
80
75
 
81
76
  ### Creating Your First Agent
82
- #### Step 1a - From Scratch
83
-
84
- ```bash
85
- # (First time setup only) Authenticate your cli tool with your circuit account
86
- circuit auth login
87
77
 
78
+ **Streamlined Workflow:**
88
79
 
89
- # Initialize a new agent project
90
- circuit agent init
80
+ ```bash
81
+ # 1. Authenticate your cli tool with your circuit account
82
+ circuit login
91
83
 
84
+ # 2. Initialize a new agent project (optionally pass --no-dir to use an existing folder)
85
+ circuit init
92
86
  # Follow the prompts to:
93
87
  # - Choose TypeScript or Python
94
88
  # - Name your agent
95
89
  # - Set up the project structure
96
90
 
97
- # Navigate to your new agent
98
- cd my-agent
91
+ # 3. Navigate to your new agent (Skip if you passed --no-dir above)
92
+ cd <generated-folder>
99
93
 
100
- # Install your local dependencies (required to run the 'circuit agent simulate' commands)
101
- bun install
94
+ # 4. Install dependencies
95
+ bun install # For TypeScript agents
102
96
  # OR
103
- uv sync
97
+ uv sync # For Python agents
104
98
 
99
+ # 5. Test your agent (handles setup, session creation automatically)
100
+ circuit run
101
+
102
+ # 6. Deploy to production when ready
103
+ circuit deploy
105
104
  ```
106
105
 
107
- #### Step 1b - Adding an existing agent to the CLI agent registry
108
- >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.
106
+ **Existing Agent Setup:**
109
107
 
110
108
  ```bash
111
- # Navigate to your existing agent
109
+ # Navigate to your existing agent directory
112
110
  cd <existing-agent-dir>
113
111
 
114
- # Initialize the agent with --no-dir
115
- # 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.
116
- # If you already have a main.py file, it will create a main-RENAMEME.py file
117
- # If you already have a pyproject.toml file, it will simply add the correct circuit config section
118
- circuit agent init --no-dir
112
+ # Initialize with --no-dir to configure existing project
113
+ circuit init --no-dir
114
+ # This adds the agent to CLI registry and updates config files
119
115
 
120
- # Install your local dependencies (required to run the 'circuit agent simulate' commands)
121
- bun install
116
+ # Install dependencies
117
+ bun install # or uv sync for Python
122
118
 
123
- # Follow prompts to configure the agent
119
+ # Test your agent
120
+ circuit run
124
121
  ```
125
- - 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.
126
-
127
- #### Steps 2-5: Soft deploy, create session for testing, test locally, deploy live
128
- ```bash
129
- # Soft deploy your agent to register the agent with Circuit and allow the creation of a test session
130
- circuit agent deploy
131
122
 
132
- # Create a test session
133
- circuit agent sessions create
134
-
135
- # Test your agent locally
136
- circuit agent simulate execute
137
-
138
- # When ready, deploy to Circuit
139
- circuit agent deploy --live
140
- ```
123
+ > **Note**: For existing agents, copy your execution logic into the execute/stop functions in the generated template files. See the SDK documentation for details on the Agent class structure.
141
124
 
142
125
 
143
126
  ## 📚 Command Reference
@@ -147,82 +130,57 @@ circuit agent deploy --live
147
130
  | Command | Description |
148
131
  |---------|-------------|
149
132
  | `circuit` | Start interactive mode with menu |
150
- | `circuit --help` | Show help information |
151
- | `circuit --version` | Show version information |
152
- | `circuit info` | Display CLI information and status |
153
- | `circuit configure` | Configure CLI and agent settings |
133
+ | `circuit whoami` | Show current authenticated user |
134
+ | `circuit login` | Authenticate with Circuit platform |
135
+ | `circuit logout` | Sign out from Circuit platform |
136
+ | `circuit init` | Initialize a new agent project |
137
+ | `circuit run` | Run/test your agent (handles setup automatically) |
138
+ | `circuit deploy` | Deploy agent to production |
139
+ | `circuit help` | Show detailed help and getting started guide |
154
140
 
155
- ### Agent Commands
141
+ ### Agent Management Commands
156
142
 
157
143
  | Command | Description |
158
144
  |---------|-------------|
159
- | `circuit agent` | Interactive agent management menu |
160
- | `circuit agent init` | Initialize a new agent project |
161
- | `circuit agent deploy` | Deploy an agent to Circuit platform |
162
- | `circuit agent configure` | Configure agent settings |
163
- | `circuit agent validate` | Validate agent configuration |
164
- | `circuit agent info` | Show agent information |
145
+ | `circuit agent info` | Show current agent information |
165
146
  | `circuit agent status` | Check agent deployment status |
166
- | `circuit agent sessions` | Manage agent sessions |
167
- | `circuit agent sessions create` | Create a new agent session |
168
- | `circuit agent sessions kill` | Kill an agent session |
169
147
 
170
- ### Simulation Commands
148
+ ### Wallet Commands
171
149
 
172
150
  | Command | Description |
173
151
  |---------|-------------|
174
- | `circuit agent simulate` | Interactive simulation menu |
175
- | `circuit agent simulate execute` | Execute agent logic locally |
176
- | `circuit agent simulate stop` | Stop agent execution locally |
152
+ | `circuit wallet list` | List your available wallets |
153
+ | `circuit wallet import` | Import a new wallet for testing |
177
154
 
178
- #### Simulation Mode Flags
155
+ ### Run Command Flags
179
156
 
180
- You can bypass the interactive menu by specifying the simulation mode directly:
157
+ The `circuit run` command supports these optional flags to skip interactive prompts:
181
158
 
182
159
  | Flag | Description |
183
160
  |------|-------------|
184
- | `--local` or `-l` | Use local development mode (auto-start server) |
185
- | `--custom` or `-c` | Use custom server mode (connect to existing server) |
186
- | `--live` or `-L` | Use deployed/live version of the agent |
187
- | `--port <number>` or `-p <number>` | Specify port for custom server mode (default: prompts for input) |
161
+ | `--wallet <address>` | Use specific wallet address |
162
+ | `--mode local\|live\|custom` | Set simulation mode |
163
+ | `--action execute\|stop` | Choose action to perform |
164
+ | `--port <number>` | Port for custom server mode |
188
165
 
189
166
  **Examples:**
190
167
  ```bash
191
- # Test with local development server (auto-start)
192
- circuit agent simulate execute --local
168
+ # Interactive mode (recommended)
169
+ circuit run
193
170
 
194
- # Connect to custom server on port 8080
195
- circuit agent simulate execute --custom --port 8080
171
+ # Skip prompts with flags
172
+ circuit run --wallet 0x123... --mode local --action execute
196
173
 
197
- # Test the deployed/live version
198
- circuit agent simulate execute --live
174
+ # Connect to custom server
175
+ circuit run --mode custom --port 8080
199
176
 
200
177
  # Stop simulation with custom server
201
- circuit agent simulate stop --custom --port 8080
178
+ circuit run --mode custom --port 8080 --action stop
202
179
  ```
203
180
 
204
- ### Authentication Commands
205
-
206
- | Command | Description |
207
- |---------|-------------|
208
- | `circuit auth` | Interactive authentication menu |
209
- | `circuit auth login` | Login to Circuit platform |
210
- | `circuit auth logout` | Logout from Circuit platform |
211
- | `circuit auth whoami` | Check current user |
212
-
213
- ### Wallet Commands
214
-
215
- | Command | Description |
216
- |---------|-------------|
217
- | `circuit wallet` | Interactive wallet management menu |
218
- | `circuit wallet import` | Import a wallet |
219
- | `circuit wallet list` | List all wallets |
220
-
221
-
222
-
223
181
  ### Getting Started with Agents
224
182
 
225
- When you run `circuit agent init`, the CLI will:
183
+ When you run `circuit init`, the CLI will:
226
184
 
227
185
  1. Prompt you to choose TypeScript or Python
228
186
  2. For TypeScript: Select from available templates (bare, self-send)
@@ -261,7 +219,7 @@ Check that your agent server:
261
219
 
262
220
  #### "Authentication Required"
263
221
 
264
- Run `circuit auth login` to authenticate with the Circuit platform.
222
+ Run `circuit login` to authenticate with the Circuit platform.
265
223
 
266
224
  ### Need Help?
267
225
 
package/bin/circuit CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { execSync } from 'child_process';
3
+ import { spawnSync } from 'child_process';
4
4
  import path from 'path';
5
5
  import fs from 'fs';
6
6
  import { fileURLToPath } from 'url';
@@ -36,11 +36,18 @@ if (!fs.existsSync(binaryPath)) {
36
36
  }
37
37
 
38
38
  try {
39
+ // Get the arguments, excluding node/bun and script path
40
+ const args = process.argv.slice(2);
41
+
39
42
  // Execute the appropriate binary with all arguments
40
- execSync(`"${binaryPath}" ${process.argv.slice(2).join(' ')}`, {
43
+ // Use spawnSync instead of execSync to avoid shell interpretation issues
44
+ const result = spawnSync(binaryPath, args, {
41
45
  stdio: 'inherit',
42
- cwd: process.cwd()
46
+ cwd: process.cwd(),
47
+ env: process.env
43
48
  });
49
+
50
+ process.exit(result.status || 0);
44
51
  } catch (error) {
45
52
  process.exit(error.status || 1);
46
53
  }
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@circuitorg/agent-cli",
3
- "version": "1.0.7",
3
+ "version": "1.1.1",
4
4
  "description": "A CLI tool for deploying agents to the Circuit platform",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,6 +15,7 @@
15
15
  "dev": "bun --hot src/index.ts",
16
16
  "test": "bun test",
17
17
  "test:coverage": "bun test --coverage",
18
+ "test:package": "bun scripts/test-package.ts",
18
19
  "typecheck": "bun tsc --noEmit",
19
20
  "format": "bun x prettier --write src/**/*.ts",
20
21
  "format:check": "bun x prettier --check src/**/*.ts",