@diggerhq/anyware 0.7.28 → 0.7.30
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 +250 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
# Anyware CLI
|
|
2
|
+
|
|
3
|
+
The command-line client for [Anyware](https://anyware.run) — control Claude Code from anywhere, on any device.
|
|
4
|
+
|
|
5
|
+
Anyware CLI runs Claude Code locally on your machine while streaming the session to the cloud. Continue working from your phone, laptop, or any browser. Get notified when Claude needs your input.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @diggerhq/anyware
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Requires Node.js >= 20.0.0
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Login (opens browser for authentication)
|
|
19
|
+
anyware login
|
|
20
|
+
|
|
21
|
+
# Start a session in your project directory
|
|
22
|
+
cd /path/to/your/project
|
|
23
|
+
anyware
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
That's it. Your session is now live at [anyware.run](https://anyware.run).
|
|
27
|
+
|
|
28
|
+
## How It Works
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
┌─────────────────────────────────────────────────────────────────────────┐
|
|
32
|
+
│ Your Machine │
|
|
33
|
+
│ ┌──────────────────────────────────────────────────────────────────┐ │
|
|
34
|
+
│ │ anyware CLI │ │
|
|
35
|
+
│ │ ┌────────────┐ ┌─────────────┐ ┌─────────────────────┐ │ │
|
|
36
|
+
│ │ │ Loop │◄──►│ Session │◄──►│ WebSocket Client │───┼──┼──► anyware.run
|
|
37
|
+
│ │ │ local/ │ │ manager │ │ (real-time sync) │ │ │
|
|
38
|
+
│ │ │ remote │ └─────────────┘ └─────────────────────┘ │ │
|
|
39
|
+
│ │ └─────┬──────┘ │ │
|
|
40
|
+
│ │ │ │ │
|
|
41
|
+
│ │ ▼ │ │
|
|
42
|
+
│ │ ┌────────────┐ ┌─────────────┐ │ │
|
|
43
|
+
│ │ │ Claude │───►│ LLM Proxy │─────────────────────────────┼──┼──► OpenRouter
|
|
44
|
+
│ │ │ Code │ │ (model │ │ │
|
|
45
|
+
│ │ │ (spawned) │ │ routing) │ │ │
|
|
46
|
+
│ │ └────────────┘ └─────────────┘ │ │
|
|
47
|
+
│ └──────────────────────────────────────────────────────────────────┘ │
|
|
48
|
+
└─────────────────────────────────────────────────────────────────────────┘
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Dual-Mode Operation
|
|
52
|
+
|
|
53
|
+
The CLI operates in two modes that switch automatically:
|
|
54
|
+
|
|
55
|
+
- **Local mode**: You type directly in the terminal. Claude responds locally, and output streams to the web dashboard.
|
|
56
|
+
- **Remote mode**: Commands come from the web dashboard via WebSocket. Output appears both in your terminal and the web UI.
|
|
57
|
+
|
|
58
|
+
Mode switching happens seamlessly:
|
|
59
|
+
- **Local → Remote**: When you send a message from the web dashboard
|
|
60
|
+
- **Remote → Local**: When you press Enter in the terminal to take back control
|
|
61
|
+
|
|
62
|
+
## Commands
|
|
63
|
+
|
|
64
|
+
### `anyware`
|
|
65
|
+
|
|
66
|
+
Start a Claude Code session in the current directory.
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
anyware # Start session
|
|
70
|
+
anyware --model openai/gpt-4o # Use a specific model via OpenRouter
|
|
71
|
+
anyware --continue # Continue the last conversation
|
|
72
|
+
anyware --resume <sessionId> # Resume a specific Claude session
|
|
73
|
+
anyware --remote # Start in remote mode
|
|
74
|
+
anyware --path /other/dir # Use a different working directory
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### `anyware login`
|
|
78
|
+
|
|
79
|
+
Authenticate with anyware.run. Opens your browser to complete the OAuth flow.
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
anyware login
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### `anyware logout`
|
|
86
|
+
|
|
87
|
+
Clear local credentials.
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
anyware logout
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### `anyware status`
|
|
94
|
+
|
|
95
|
+
Show current login status and configuration.
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
anyware status
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### `anyware config`
|
|
102
|
+
|
|
103
|
+
View or set configuration options.
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
anyware config # Show current config
|
|
107
|
+
anyware config --api-url <url> # Set custom API URL
|
|
108
|
+
anyware config --llm-url <url> # Set custom LLM proxy URL
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### `anyware update`
|
|
112
|
+
|
|
113
|
+
Update to the latest version.
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
anyware update
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### `anyware version`
|
|
120
|
+
|
|
121
|
+
Print version information and check for updates.
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
anyware version
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### `anyware alias`
|
|
128
|
+
|
|
129
|
+
Set up `claude` as an alias for `anyware` in your shell.
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
anyware alias
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### `anyware claude-args`
|
|
136
|
+
|
|
137
|
+
Show valid Claude Code arguments that can be passed through.
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
anyware claude-args
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Custom Models
|
|
144
|
+
|
|
145
|
+
Use any model available on [OpenRouter](https://openrouter.ai):
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
anyware --model openai/gpt-4o
|
|
149
|
+
anyware --model google/gemini-2.0-flash-001
|
|
150
|
+
anyware --model anthropic/claude-sonnet-4
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Or set a default model via environment variable:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
export ANYWARE_MODEL=openai/gpt-4o
|
|
157
|
+
anyware
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Configuration
|
|
161
|
+
|
|
162
|
+
Configuration is stored in `~/.anyware/config.json`.
|
|
163
|
+
|
|
164
|
+
### Environment Variables
|
|
165
|
+
|
|
166
|
+
| Variable | Description |
|
|
167
|
+
|----------|-------------|
|
|
168
|
+
| `ANYWARE_API_URL` | Override the API URL (default: `https://anyware.run`) |
|
|
169
|
+
| `ANYWARE_LLM_URL` | Override the LLM proxy URL (default: `https://llm.anyware.run`) |
|
|
170
|
+
| `ANYWARE_MODEL` | Default model to use via OpenRouter |
|
|
171
|
+
|
|
172
|
+
## Web Dashboard
|
|
173
|
+
|
|
174
|
+
1. Go to [anyware.run](https://anyware.run)
|
|
175
|
+
2. Login with the same account
|
|
176
|
+
3. See active sessions, click to view live terminal
|
|
177
|
+
4. Type to send prompts, approve tool permissions
|
|
178
|
+
|
|
179
|
+
## Notifications
|
|
180
|
+
|
|
181
|
+
Get SMS or WhatsApp alerts when Claude needs input and you're away from your terminal. Configure at [anyware.run/settings/notifications](https://anyware.run/settings/notifications).
|
|
182
|
+
|
|
183
|
+
## Development
|
|
184
|
+
|
|
185
|
+
### Prerequisites
|
|
186
|
+
|
|
187
|
+
- Node.js >= 20.0.0
|
|
188
|
+
- npm
|
|
189
|
+
|
|
190
|
+
### Setup
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
# Clone the repository
|
|
194
|
+
git clone https://github.com/diggerhq/anyware-cli.git
|
|
195
|
+
cd anyware-cli
|
|
196
|
+
|
|
197
|
+
# Install dependencies
|
|
198
|
+
npm install
|
|
199
|
+
|
|
200
|
+
# Build
|
|
201
|
+
npm run build
|
|
202
|
+
|
|
203
|
+
# Run in development mode
|
|
204
|
+
npm run dev
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Scripts
|
|
208
|
+
|
|
209
|
+
| Command | Description |
|
|
210
|
+
|---------|-------------|
|
|
211
|
+
| `npm run build` | Compile TypeScript to `dist/` |
|
|
212
|
+
| `npm run dev` | Run from source with tsx |
|
|
213
|
+
| `npm run start` | Run compiled output |
|
|
214
|
+
| `npm run typecheck` | Type-check without emitting |
|
|
215
|
+
|
|
216
|
+
### Project Structure
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
src/
|
|
220
|
+
├── main.ts # CLI entry point (commander setup)
|
|
221
|
+
├── api/ # Server communication
|
|
222
|
+
│ ├── auth.ts # OAuth login flow
|
|
223
|
+
│ ├── session.ts # Session creation/management
|
|
224
|
+
│ └── wsClient.ts # WebSocket client
|
|
225
|
+
├── claude/ # Claude Code integration
|
|
226
|
+
│ ├── loop.ts # Local/remote mode switching
|
|
227
|
+
│ ├── session.ts # Session state management
|
|
228
|
+
│ ├── claudeLocal*.ts # Local mode (terminal UI)
|
|
229
|
+
│ ├── claudeRemote*.ts # Remote mode (SDK-based)
|
|
230
|
+
│ └── sdk/ # Claude SDK wrapper
|
|
231
|
+
├── config/ # Configuration management
|
|
232
|
+
├── hooks/ # Session hooks
|
|
233
|
+
├── ui/ # Terminal UI components
|
|
234
|
+
├── update/ # Self-update functionality
|
|
235
|
+
└── utils/ # Utilities (message queue, etc.)
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## Self-Hosting
|
|
239
|
+
|
|
240
|
+
See the main [Anyware repository](https://github.com/diggerhq/anyware) for self-hosting documentation.
|
|
241
|
+
|
|
242
|
+
## License
|
|
243
|
+
|
|
244
|
+
MIT
|
|
245
|
+
|
|
246
|
+
## Links
|
|
247
|
+
|
|
248
|
+
- [Anyware Website](https://anyware.run)
|
|
249
|
+
- [Documentation](https://docs.anyware.run)
|
|
250
|
+
- [Main Repository](https://github.com/diggerhq/anyware)
|