amai
v0.0.28
Published
ama cli
Readme
AMAI CLI
A CLI tool that connects to your backend server to execute tool calls locally on your machine.
Installation
Option 1: Install from npm (Recommended)
npm install -g amaiOption 2: Install Globally from Source
# From the cli package directory
cd packages/cli
npm install
npm run build
# Link globally using npm
npm link
# Or use the install script
./install-global.shOption 3: Link Locally to Another Project
# In your other project directory
npm link /path/to/ama/packages/cliOption 4: Install from Local Path
In your project's package.json:
{
"dependencies": {
"amai": "file:../path/to/ama/packages/cli"
}
}Then run npm install.
Usage
amai [command] [options]Commands
login- Authorize devicelogout- Log out and remove credentialsstart- Start background daemon (recommended for better performance)stop- Stop background daemonstatus- Check daemon statusproject add <path>- Register a project directoryproject list- List registered projects
Options
--help, -h- Show help message
Environment Variables
SERVER_URL- WebSocket server URL to connect to (optional, has a default)- Example:
ws://localhost:8787orwss://your-server.com
- Example:
Examples
# Login first
amai login
# Start in background mode (recommended)
amai start
# Check daemon status
amai status
# Stop daemon
amai stop
# Register a project
amai project add /path/to/your/project
# List registered projects
amai project list
# Show help
amai --helpHow It Works
- The CLI connects to a WebSocket server
- It listens for tool call messages from the server
- When tool calls are received, it executes them locally on your machine
- Results are sent back to the server via WebSocket
- It automatically reconnects if the connection is lost
Development
To build the CLI:
cd packages/cli
npm install
npm run buildThe built files will be in the dist/ directory.
Troubleshooting
Connection issues
- Check that the server is running and accessible
- Verify the WebSocket URL format (should start with
ws://orwss://) - Check firewall/network settings
- The CLI will automatically attempt to reconnect every 5 seconds if disconnected
Authentication issues
- Run
amai loginto authenticate - Credentials are stored in
~/.amai/credentials.json - Run
amai logoutto clear credentials and re-authenticate
