@y-square-t3/oh-my-codes-linux-x64 4.2.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.
Files changed (4) hide show
  1. package/README.md +183 -0
  2. package/bin/omc +0 -0
  3. package/bin/omcd +0 -0
  4. package/package.json +19 -0
package/README.md ADDED
@@ -0,0 +1,183 @@
1
+ [![omc-ci](https://github.com/Y-Square-T3/oh-my-codes/actions/workflows/omc-ci.yml/badge.svg)](https://github.com/Y-Square-T3/oh-my-codes/actions/workflows/omc-ci.yml)
2
+ [![omc-opencode-ci](https://github.com/Y-Square-T3/oh-my-codes/actions/workflows/omc-opencode-ci.yml/badge.svg)](https://github.com/Y-Square-T3/oh-my-codes/actions/workflows/omc-opencode-ci.yml)
3
+ [![npm oh-my-codes version](https://img.shields.io/npm/v/oh-my-codes)](https://www.npmjs.com/package/oh-my-codes)
4
+ [![npm oh-my-codes-opencode version](https://img.shields.io/npm/v/oh-my-codes-opencode)](https://www.npmjs.com/package/oh-my-codes-opencode)
5
+ [![license](https://img.shields.io/github/license/Y-Square-T3/oh-my-codes)](./LICENSE)
6
+
7
+ # oh-my-codes
8
+
9
+ A CLI + daemon system for managing AI model accounts, workspaces, and token usage. Built with Rust for performance and distributed via npm with prebuilt platform-specific binaries.
10
+
11
+ ## Features
12
+
13
+ - **OAuth 2.0 Device Code Flow** -- Browser-based authentication with automatic token refresh
14
+ - **Multi-Account & Multi-Workspace** -- Switch between accounts and workspaces with interactive CLI pickers
15
+ - **Background Daemon** -- OS-level service (launchd / systemd / Task Scheduler) with embedded SurrealDB storage
16
+ - **Model Discovery & Sync** -- List and sync available AI models from remote servers
17
+ - **Token Usage Tracking** -- Track, push, and summarize token usage with daily reports
18
+ - **Cross-Platform** -- Prebuilt binaries for macOS (arm64/x64), Linux (arm64/x64), and Windows (x64)
19
+
20
+ ## Architecture
21
+
22
+ ```
23
+ CLI (omc) ──HTTP/Unix Socket──▶ Daemon (omcd) ──HTTPS──▶ OMC Server
24
+
25
+ SurrealDB (RocksDB)
26
+ ```
27
+
28
+ | Component | Description |
29
+ |-----------|-------------|
30
+ | `omc` | CLI binary -- command parsing and daemon communication |
31
+ | `omcd` | Daemon binary -- state management, storage, and server proxy |
32
+ | `omc-core` | Shared types, config, and error handling |
33
+ | `omc-api` | HTTP client SDK for CLI-to-daemon communication |
34
+ | `omc-storage` | Storage trait + SurrealDB embedded backend |
35
+ | `omc-server` | Axum HTTP server with route handlers |
36
+ | `omc-service` | OS service management (launchd / systemd / Task Scheduler) |
37
+
38
+ ## Installation
39
+
40
+ ### Script Install (Recommended)
41
+
42
+ ```bash
43
+ curl -fsSL https://raw.githubusercontent.com/Y-Square-T3/oh-my-codes/main/scripts/install.sh | bash
44
+ ```
45
+
46
+ This will download and install the latest release binaries to `/usr/local/bin`. You may be prompted for your password.
47
+
48
+ To install a specific version:
49
+
50
+ ```bash
51
+ curl -fsSL https://raw.githubusercontent.com/Y-Square-T3/oh-my-codes/main/scripts/install.sh | bash -s -- v4.0.8
52
+ ```
53
+
54
+ ### npm Install
55
+
56
+ ```bash
57
+ npm install oh-my-codes
58
+ ```
59
+
60
+ Or with Yarn:
61
+
62
+ ```bash
63
+ yarn add oh-my-codes
64
+ ```
65
+
66
+ ## Quick Start
67
+
68
+ ```bash
69
+ # Install and start the daemon as an OS service
70
+ omc daemon install
71
+ omc daemon start
72
+
73
+ # Authenticate with your OMC server
74
+ omc account login https://your-omc-server.com
75
+
76
+ # Select a workspace
77
+ omc account switch
78
+
79
+ # Explore available models
80
+ omc model list
81
+
82
+ # Check token usage
83
+ omc token-usage summary
84
+ ```
85
+
86
+ ## CLI Commands
87
+
88
+ | Command | Description |
89
+ |---------|-------------|
90
+ | `omc account login <url>` | Authenticate via device code flow |
91
+ | `omc account logout [email]` | Remove an account |
92
+ | `omc account switch` | Switch active workspace/account |
93
+ | `omc account list` | List all accounts |
94
+ | `omc account show` | Show active account |
95
+ | `omc model list [--provider]` | List available models |
96
+ | `omc model sync` | Sync models from remote server |
97
+ | `omc token-usage status` | Check token usage status |
98
+ | `omc token-usage push` | Manually push token usage |
99
+ | `omc token-usage list [--limit]` | List usage records |
100
+ | `omc token-usage summary [--days]` | Daily usage summary |
101
+ | `omc config show` | Show resolved configuration |
102
+ | `omc config path` | Show config file path |
103
+ | `omc daemon install` | Install as OS service |
104
+ | `omc daemon uninstall` | Uninstall OS service |
105
+ | `omc daemon start` | Start daemon |
106
+ | `omc daemon stop` | Stop daemon |
107
+ | `omc daemon status` | Check daemon status |
108
+ | `omc health` | Health check |
109
+
110
+ ## Configuration
111
+
112
+ Configuration is resolved in the following priority (highest to lowest):
113
+
114
+ 1. Command-line arguments
115
+ 2. Environment variables
116
+ 3. Project config (`.omc/omc.json`)
117
+ 4. User config (`~/.config/omc/omc.json`)
118
+
119
+ ## Development
120
+
121
+ ### Prerequisites
122
+
123
+ - [Rust](https://www.rust-lang.org/tools/install) (edition 2024)
124
+ - [Node.js](https://nodejs.org/)
125
+ - [Yarn 4](https://yarnpkg.com/) (enable via `corepack enable`)
126
+
127
+ ### Setup
128
+
129
+ ```bash
130
+ corepack enable
131
+ yarn install
132
+ ```
133
+
134
+ ### Scripts
135
+
136
+ ```bash
137
+ yarn omc build # Compile binaries
138
+ yarn omc dev # Run CLI (cargo run -p omc --)
139
+ yarn omc dev:daemon # Run daemon (cargo run -p omcd --)
140
+ yarn omc test # Run all workspace tests
141
+ yarn omc check # Quick compilation check
142
+ yarn omc lint # Clippy lints (deny warnings)
143
+ yarn omc lint:fix # Clippy with auto-fix
144
+ yarn omc fmt # Format all Rust code
145
+ yarn omc fmt:check # Check formatting
146
+ ```
147
+
148
+ ## Project Structure
149
+
150
+ ```
151
+ oh-my-codes/
152
+ ├── packages/
153
+ │ ├── omc/ # Rust workspace + npm package
154
+ │ │ ├── crates/
155
+ │ │ │ ├── omc/ # CLI binary
156
+ │ │ │ ├── omcd/ # Daemon binary
157
+ │ │ │ ├── omc-core/ # Shared types & config
158
+ │ │ │ ├── omc-api/ # HTTP client SDK
159
+ │ │ │ ├── omc-storage/ # SurrealDB storage backend
160
+ │ │ │ ├── omc-server/ # Axum HTTP server
161
+ │ │ │ └── omc-service/ # OS service management
162
+ │ │ ├── dist/ # Platform-specific packages
163
+ │ │ └── scripts/ # Build scripts
164
+ │ └── omc-opencode/ # OpenCode plugin
165
+ ├── docs/ # Architecture documentation
166
+ └── AGENTS.md # AI agent instructions
167
+ ```
168
+
169
+ ## Documentation
170
+
171
+ Detailed architecture documentation is available in [`docs/archs/`](./docs/archs/).
172
+
173
+ ## Contributing
174
+
175
+ Contributions are welcome! Please make sure to:
176
+
177
+ 1. Run `yarn omc fmt` to format code
178
+ 2. Run `yarn omc lint` to check lints
179
+ 3. Run `yarn omc test` to verify tests pass
180
+
181
+ ## License
182
+
183
+ This project is licensed under the terms of the [LICENSE](./LICENSE) file.
package/bin/omc ADDED
Binary file
package/bin/omcd ADDED
Binary file
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@y-square-t3/oh-my-codes-linux-x64",
3
+ "version": "4.2.0",
4
+ "os": [
5
+ "linux"
6
+ ],
7
+ "cpu": [
8
+ "x64"
9
+ ],
10
+ "bin": {
11
+ "oh-my-codes": "bin/omc",
12
+ "omc": "bin/omc"
13
+ },
14
+ "files": [
15
+ "README.md",
16
+ "bin/omc",
17
+ "bin/omcd"
18
+ ]
19
+ }