amai 0.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.
- package/README.md +114 -0
- package/dist/cli.cjs +1946 -0
- package/dist/cli.d.cts +2 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1934 -0
- package/dist/lib/daemon-entry.cjs +1588 -0
- package/dist/lib/daemon-entry.d.cts +2 -0
- package/dist/lib/daemon-entry.d.ts +2 -0
- package/dist/lib/daemon-entry.js +1578 -0
- package/dist/server.cjs +1437 -0
- package/dist/server.d.cts +7 -0
- package/dist/server.d.ts +7 -0
- package/dist/server.js +1425 -0
- package/package.json +62 -0
package/README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Ama Agent CLI
|
|
2
|
+
|
|
3
|
+
A CLI tool that connects to your Convex backend to execute tool calls locally on your machine.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Option 1: Install Globally (Recommended)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# From the ama-agent package directory
|
|
11
|
+
cd packages/ama-agent
|
|
12
|
+
bun install
|
|
13
|
+
bun run build
|
|
14
|
+
|
|
15
|
+
# Link globally using npm
|
|
16
|
+
npm link
|
|
17
|
+
|
|
18
|
+
# Or use bun link
|
|
19
|
+
bun link
|
|
20
|
+
|
|
21
|
+
# Or use the install script
|
|
22
|
+
./install-global.sh
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Option 2: Link Locally to Another Project
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# In your other project directory
|
|
29
|
+
npm link /path/to/ama/packages/ama-agent
|
|
30
|
+
# or with bun
|
|
31
|
+
bun link /path/to/ama/packages/ama-agent
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Option 3: Install from Local Path
|
|
35
|
+
|
|
36
|
+
In your project's `package.json`:
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"ama-agent": "file:../path/to/ama/packages/ama-agent"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
Then run `npm install` or `bun install`.
|
|
45
|
+
|
|
46
|
+
### Option 4: Publish to npm (For Sharing)
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
cd packages/ama-agent
|
|
50
|
+
npm publish
|
|
51
|
+
# Then in your other project: npm install ama-agent
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Usage
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
ama-agent [options]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Options
|
|
61
|
+
|
|
62
|
+
- `--help, -h` - Show help message
|
|
63
|
+
|
|
64
|
+
### Environment Variables
|
|
65
|
+
|
|
66
|
+
- `SERVER_URL` - WebSocket server URL to connect to (required)
|
|
67
|
+
- Example: `ws://localhost:3000` or `wss://your-server.com`
|
|
68
|
+
|
|
69
|
+
### Examples
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Using environment variable
|
|
73
|
+
SERVER_URL=ws://localhost:3000 ama-agent
|
|
74
|
+
|
|
75
|
+
# Or export it first
|
|
76
|
+
export SERVER_URL=ws://localhost:3000
|
|
77
|
+
ama-agent
|
|
78
|
+
|
|
79
|
+
# Show help
|
|
80
|
+
ama-agent --help
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## How It Works
|
|
84
|
+
|
|
85
|
+
1. The CLI connects to a WebSocket server at the provided `SERVER_URL`
|
|
86
|
+
2. It listens for tool call messages from the server
|
|
87
|
+
3. When tool calls are received, it executes them locally on your machine
|
|
88
|
+
4. Results are sent back to the server via WebSocket
|
|
89
|
+
5. It automatically reconnects if the connection is lost
|
|
90
|
+
|
|
91
|
+
## Development
|
|
92
|
+
|
|
93
|
+
To build the CLI:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
cd packages/ama-agent
|
|
97
|
+
bun install
|
|
98
|
+
bun run build
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
The built files will be in the `dist/` directory.
|
|
102
|
+
|
|
103
|
+
## Troubleshooting
|
|
104
|
+
|
|
105
|
+
### "SERVER_URL is required" error
|
|
106
|
+
|
|
107
|
+
Make sure to provide the server URL via the `SERVER_URL` environment variable.
|
|
108
|
+
|
|
109
|
+
### Connection issues
|
|
110
|
+
|
|
111
|
+
- Check that the server is running and accessible
|
|
112
|
+
- Verify the WebSocket URL format (should start with `ws://` or `wss://`)
|
|
113
|
+
- Check firewall/network settings
|
|
114
|
+
- The CLI will automatically attempt to reconnect every 5 seconds if disconnected
|