opencode-cloud 0.1.2 → 1.0.3

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 +172 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,172 @@
1
+ # opencode-cloud
2
+
3
+ [![CI](https://github.com/pRizz/opencode-cloud/actions/workflows/ci.yml/badge.svg)](https://github.com/pRizz/opencode-cloud/actions/workflows/ci.yml)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ A production-ready toolkit for deploying [opencode](https://github.com/anomalyco/opencode) as a persistent cloud service.
7
+
8
+ ## Features
9
+
10
+ - Cross-platform CLI (`opencode-cloud` / `occ`)
11
+ - Docker container management
12
+ - Service lifecycle commands (start, stop, status, logs)
13
+ - Platform service integration (systemd/launchd)
14
+ - XDG-compliant configuration
15
+ - Singleton enforcement (one instance per host)
16
+
17
+ ## Requirements
18
+
19
+ ### For npm installation
20
+
21
+ - **Node.js 20+**
22
+ - **Rust 1.82+** (for compiling native bindings)
23
+ - Install via [rustup](https://rustup.rs): `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`
24
+
25
+ ### For cargo installation
26
+
27
+ - **Rust 1.82+**
28
+
29
+ ## Installation
30
+
31
+ ### Via npm (compiles from source)
32
+
33
+ ```bash
34
+ npx opencode-cloud --version
35
+ ```
36
+
37
+ Or install globally:
38
+
39
+ ```bash
40
+ npm install -g opencode-cloud
41
+ occ --version
42
+ ```
43
+
44
+ ### Via cargo
45
+
46
+ ```bash
47
+ cargo install opencode-cloud
48
+ opencode-cloud --version
49
+ ```
50
+
51
+ ### From source
52
+
53
+ ```bash
54
+ git clone https://github.com/pRizz/opencode-cloud.git
55
+ cd opencode-cloud
56
+ just build
57
+ cargo run -p opencode-cloud -- --version
58
+ ```
59
+
60
+ ## Usage
61
+
62
+ ```bash
63
+ # Show version
64
+ occ --version
65
+
66
+ # Start the service (builds image on first run)
67
+ occ start
68
+
69
+ # Start on a custom port
70
+ occ start --port 8080
71
+
72
+ # Start and open browser
73
+ occ start --open
74
+
75
+ # Check service status
76
+ occ status
77
+
78
+ # View logs
79
+ occ logs
80
+
81
+ # Follow logs in real-time
82
+ occ logs -f
83
+
84
+ # Stop the service
85
+ occ stop
86
+
87
+ # Restart the service
88
+ occ restart
89
+
90
+ # Install as a system service (starts on login/boot)
91
+ occ install
92
+
93
+ # Uninstall the system service
94
+ occ uninstall
95
+
96
+ # View configuration
97
+ occ config show
98
+ ```
99
+
100
+ ### Rebuilding the Docker Image
101
+
102
+ When developing locally or after updating opencode-cloud, you may need to rebuild the Docker image to pick up changes in the embedded Dockerfile:
103
+
104
+ ```bash
105
+ # Rebuild using Docker cache (fast - only rebuilds changed layers)
106
+ occ start --cached-rebuild
107
+
108
+ # Rebuild from scratch without cache (slow - for troubleshooting)
109
+ occ start --full-rebuild
110
+ ```
111
+
112
+ **`--cached-rebuild`** (recommended for most cases):
113
+ - Uses Docker layer cache for fast rebuilds
114
+ - Only rebuilds layers that changed (e.g., if only the CMD changed, it's nearly instant)
115
+ - Stops and removes any existing container before rebuilding
116
+
117
+ **`--full-rebuild`** (for troubleshooting):
118
+ - Ignores Docker cache and rebuilds everything from scratch
119
+ - Takes 10-15 minutes but guarantees a completely fresh image
120
+ - Use when cached rebuild doesn't fix issues
121
+
122
+ **When to rebuild:**
123
+ - After pulling updates to opencode-cloud → use `--cached-rebuild`
124
+ - When modifying the Dockerfile during development → use `--cached-rebuild`
125
+ - When the container fails to start due to image issues → try `--cached-rebuild` first, then `--full-rebuild`
126
+ - When you want a completely fresh environment → use `--full-rebuild`
127
+
128
+ ## Configuration
129
+
130
+ Configuration is stored at:
131
+ - Linux/macOS: `~/.config/opencode-cloud/config.json`
132
+
133
+ Data (PID files, etc.) is stored at:
134
+ - Linux/macOS: `~/.local/share/opencode-cloud/`
135
+
136
+ ## Development
137
+
138
+ ```bash
139
+ # Install dependencies
140
+ pnpm install
141
+
142
+ # Configure git hooks (once after cloning)
143
+ git config core.hooksPath .githooks
144
+
145
+ # Build everything
146
+ just build
147
+
148
+ # Compile and run occ (arguments automatically get passed to the binary)
149
+ just run --version
150
+
151
+ # Run tests
152
+ just test
153
+
154
+ # Format and lint
155
+ just fmt
156
+ just lint
157
+ ```
158
+
159
+ > **Note:** The git hooks automatically sync `README.md` to npm package directories on commit.
160
+
161
+ ## Architecture
162
+
163
+ This is a monorepo with:
164
+ - `packages/core` - Rust core library with NAPI-RS bindings
165
+ - `packages/cli-rust` - Rust CLI binary
166
+ - `packages/cli-node` - Node.js CLI wrapper (calls into core via NAPI)
167
+
168
+ The npm package compiles the Rust core on install (no prebuilt binaries).
169
+
170
+ ## License
171
+
172
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-cloud",
3
- "version": "0.1.2",
3
+ "version": "1.0.3",
4
4
  "description": "CLI for managing opencode as a persistent cloud service",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -38,7 +38,7 @@
38
38
  "arm64"
39
39
  ],
40
40
  "dependencies": {
41
- "@opencode-cloud/core": "0.1.2"
41
+ "@opencode-cloud/core": "1.0.3"
42
42
  },
43
43
  "devDependencies": {
44
44
  "typescript": "^5.7.3",