opencode-profiles 1.0.0
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/LICENSE +21 -0
- package/README.md +70 -0
- package/dist/index.js +78 -0
- package/package.json +57 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 kahi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# opencode-profiles (`ocp`)
|
|
2
|
+
|
|
3
|
+
A CLI tool for managing and switching between multiple [opencode](https://opencode.ai) profiles. Each profile points to a directory containing its own `opencode.jsonc` config, letting you run opencode with different configurations without touching your global setup.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- [Bun](https://bun.sh) installed
|
|
8
|
+
- [opencode](https://opencode.ai) installed and configured (global config directory must exist)
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
bun install -g opencode-profiles
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
### `ocp init`
|
|
19
|
+
|
|
20
|
+
Initialize OCP. Creates the `ocp.jsonc` config file inside your opencode global config directory.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
ocp init
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### `ocp profile add <name>`
|
|
27
|
+
|
|
28
|
+
Add a new profile pointing to a directory that contains an `opencode.jsonc`.
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Use a specific path
|
|
32
|
+
ocp profile add work --path ~/projects/work
|
|
33
|
+
|
|
34
|
+
# Use the current directory
|
|
35
|
+
ocp profile add personal --cwd
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### `ocp profile remove <name>`
|
|
39
|
+
|
|
40
|
+
Remove a profile by name.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
ocp profile remove work
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### `ocp profile list`
|
|
47
|
+
|
|
48
|
+
List all profiles. Shows whether each profile is valid (path exists and contains an `opencode.jsonc`).
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
ocp profile list
|
|
52
|
+
|
|
53
|
+
# Output:
|
|
54
|
+
# ┌─────────┬──────┬──────────────────────┬───────┐
|
|
55
|
+
# │ (index) │ Name │ Path │ Valid │
|
|
56
|
+
# ├─────────┼──────┼──────────────────────┼───────┤
|
|
57
|
+
# │ 0 │ work │ /home/user/work │ ✓ │
|
|
58
|
+
# │ 1 │ old │ /home/user/old │ ✗ │
|
|
59
|
+
# └─────────┴──────┴──────────────────────┴───────┘
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### `ocp run <profile> [opencode args]`
|
|
63
|
+
|
|
64
|
+
Launch opencode with the given profile. Any extra arguments are passed directly to the opencode CLI.
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
ocp run work
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
If the profile has `randomPort: true` in your `ocp.jsonc`, a random port is picked each time.
|