@vanthaita/orca 0.1.26

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 +159 -0
  2. package/bin/orca.js +17 -0
  3. package/install.js +276 -0
  4. package/package.json +52 -0
package/README.md ADDED
@@ -0,0 +1,159 @@
1
+ <div align="center">
2
+ <!-- <img src="https://res.cloudinary.com/dq2z27agv/image/upload/q_auto,f_webp,w_1200/v1767689659/c0b0wna5zvcn2m0spkei.png" alt="Orca Logo" width="100%" /> -->
3
+
4
+ # ORCA CLI
5
+
6
+ **AI-powered Git workflow for modern developers.**
7
+
8
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
9
+ [![Rust](https://img.shields.io/badge/built_with-Rust-d83018.svg)](https://www.rust-lang.org/)
10
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
11
+ </div>
12
+
13
+ <br />
14
+
15
+ ## 🌊 What is Orca?
16
+
17
+ Orca is a command-line toolset designed to remove friction from your daily development workflow. It uses advanced AI to understand your code changes, generate semantic commit messages, plan complex refactors, and automate the pull request process.
18
+
19
+ Instead of fighting with git commands and writing boilerplate descriptions, let Orca handle the choreography so you can focus on shipping features.
20
+
21
+ ## A New Philosophy for Version Control
22
+ Git is powerful, but noisy. It requires you to manually stage, commit, and push hundreds of times. Orca changes this by introducing an agentic layer between you and Git.
23
+
24
+ Instead of micro-managing commits, you describe your intent or let Orca infer it. Orca analyzes your changes, groups them semantically using advanced AI models, and generates clean, meaningful history that tells a story.
25
+
26
+ It's not just a wrapper; it's a workflow engine designed for the era of AI-assisted coding.
27
+
28
+ ## ✨ Features
29
+
30
+ - **🧠 Intelligent Commits**: Analyzes your diffs and generates conventional commit messages automatically.
31
+ - **🗺️ Strategic Planning**: Generates a `plan.json` for complex tasks, allowing you to review and edit the strategy before execution.
32
+ - **🚀 Zero-Friction Releases**: Handles the entire publish flow—commits, pushes, and creates a PR with a generated summary in one command.
33
+ - **🔒 Local-First Privacy**: Your code stays on your machine. Orca interacts with AI providers securely using your own API keys.
34
+ - **⚡ Blazing Fast**: Built with Rust for instant startup times and high performance.
35
+
36
+ ## 📦 Installation
37
+
38
+ Choose your preferred installation method:
39
+
40
+ ### npm (Cross-platform)
41
+
42
+ ```bash
43
+ npm install -g orca
44
+ ```
45
+
46
+ ### Bun (Cross-platform)
47
+
48
+ ```bash
49
+ bun install -g orca
50
+ ```
51
+
52
+ ### Homebrew (macOS/Linux)
53
+
54
+ ```bash
55
+ brew tap vanthaita/orca
56
+ brew install orca
57
+ ```
58
+
59
+ ### Winget (Windows)
60
+
61
+ ```bash
62
+ winget install vanthaita.Orca
63
+ ```
64
+
65
+ ### Shell Script (Linux/macOS)
66
+
67
+ ```bash
68
+ curl -fsSL https://raw.githubusercontent.com/vanthaita/orca-releases/main/install.sh | sh
69
+ ```
70
+
71
+ ### Windows MSI Installer
72
+
73
+ **Recommended for Windows users**
74
+
75
+ 1. Download the latest `OrcaSetup-<version>.msi` from [Releases](https://github.com/vanthaita/orca-releases/releases/latest).
76
+ 2. Run the installer.
77
+ 3. Open a new terminal and type `orca --help`.
78
+
79
+ ### Portable Archive
80
+
81
+ Download the appropriate archive for your platform from [Releases](https://github.com/vanthaita/orca-releases/releases/latest):
82
+
83
+ - **Windows**: `orca-x86_64-pc-windows-msvc.zip`
84
+ - **macOS**: `orca-x86_64-apple-darwin.tar.gz`
85
+ - **Linux**: `orca-x86_64-unknown-linux-gnu.tar.gz`
86
+
87
+ Extract and add to your system PATH.
88
+
89
+ ### From Source
90
+
91
+ Requirements: [Rust](https://rustup.rs/) (stable)
92
+
93
+ ```bash
94
+ # Clone the repository
95
+ git clone https://github.com/vanthaita/Orca.git
96
+ cd Orca/cli
97
+
98
+ # Build and install
99
+ cargo install --path .
100
+ ```
101
+
102
+ ## 🛠️ Usage
103
+
104
+ ### 1. Setup
105
+ Configure your preferred AI provider and API keys.
106
+
107
+ ```bash
108
+ orca setup --provider openai --api-key sk-...
109
+ ```
110
+
111
+ ### 2. The Daily Driver
112
+ Stage changes and generate a commit message in one go.
113
+
114
+ ```bash
115
+ # Verify changes and commit
116
+ orca commit
117
+ ```
118
+
119
+ ### 3. Advanced Planning
120
+ For complex features, generate a plan first.
121
+
122
+ ```bash
123
+ # Generate a plan based on current changes or a prompt
124
+ orca plan --out plan.json
125
+
126
+ # ... Edit plan.json manually if needed ...
127
+
128
+ # Execute the plan
129
+ orca apply --file plan.json
130
+ ```
131
+
132
+ ### 4. Publishing
133
+ Ship your changes to GitHub without leaving the terminal.
134
+
135
+ ```bash
136
+ # Commits, pushes, and opens a PR
137
+ orca publish --branch feat/my-new-feature
138
+ ```
139
+
140
+ ## ⌨️ Commands
141
+
142
+ | Command | Description |
143
+ |---------|-------------|
144
+ | `orca commit` | Analyze changes and create a commit. |
145
+ | `orca plan` | Generate a detailed execution plan. |
146
+ | `orca apply` | Execute a plan file. |
147
+ | `orca publish` | Commit, push, and create a PR. |
148
+ | `orca setup` | Configure AI providers and settings. |
149
+ | `orca login` | Authenticate with Orca Cloud. |
150
+ | `orca doctor` | Check environment health. |
151
+ | `orca update` | Update to the latest version. |
152
+
153
+ ## 🤝 Contributing
154
+
155
+ We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to get started.
156
+
157
+ ## 📄 License
158
+
159
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
package/bin/orca.js ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ const { spawn } = require('child_process');
3
+ const path = require('path');
4
+ const binPath = path.join(__dirname, process.platform === 'win32' ? 'orca.exe' : 'orca');
5
+
6
+ const child = spawn(binPath, process.argv.slice(2), { stdio: 'inherit' });
7
+
8
+ child.on('close', (code) => {
9
+ process.exit(code);
10
+ });
11
+
12
+ child.on('error', (err) => {
13
+ console.error('Failed to start Orca CLI:', err);
14
+ console.error('This might be because the binary was not installed correctly.');
15
+ console.error('Try running: npm rebuild @vanthaita/orca');
16
+ process.exit(1);
17
+ });
package/install.js ADDED
@@ -0,0 +1,276 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Post-install script for orca npm package
5
+ * Downloads and installs the appropriate binary for the user's platform
6
+ */
7
+
8
+ const fs = require('fs');
9
+ const path = require('path');
10
+ const https = require('https');
11
+ const { execSync } = require('child_process');
12
+ const { pipeline } = require('stream');
13
+ const { promisify } = require('util');
14
+ const zlib = require('zlib');
15
+
16
+ const streamPipeline = promisify(pipeline);
17
+
18
+ const REPO = 'vanthaita/orca-releases';
19
+ const BINARY_NAME = process.platform === 'win32' ? 'orca.exe' : 'orca';
20
+ // BIN_DIR is detected dynamically in install()
21
+
22
+ // Platform and architecture mapping
23
+ function getPlatformInfo() {
24
+ const platform = process.platform;
25
+ const arch = process.arch;
26
+
27
+ let target;
28
+ let archive;
29
+
30
+ if (platform === 'win32' && arch === 'x64') {
31
+ target = 'x86_64-pc-windows-msvc';
32
+ archive = 'zip';
33
+ } else if (platform === 'darwin' && arch === 'x64') {
34
+ target = 'x86_64-apple-darwin';
35
+ archive = 'tar.gz';
36
+ } else if (platform === 'darwin' && arch === 'arm64') {
37
+ target = 'aarch64-apple-darwin';
38
+ archive = 'tar.gz';
39
+ } else if (platform === 'linux' && arch === 'x64') {
40
+ target = 'x86_64-unknown-linux-gnu';
41
+ archive = 'tar.gz';
42
+ } else if (platform === 'linux' && arch === 'arm64') {
43
+ target = 'aarch64-unknown-linux-gnu';
44
+ archive = 'tar.gz';
45
+ } else {
46
+ throw new Error(`Unsupported platform: ${platform} ${arch}`);
47
+ }
48
+
49
+ return { target, archive, platform };
50
+ }
51
+
52
+ // Download file from URL
53
+ async function download(url, dest) {
54
+ return new Promise((resolve, reject) => {
55
+ https.get(url, { headers: { 'User-Agent': 'npm-orca-installer' } }, (response) => {
56
+ if (response.statusCode === 302 || response.statusCode === 301) {
57
+ // Follow redirect
58
+ download(response.headers.location, dest).then(resolve).catch(reject);
59
+ return;
60
+ }
61
+
62
+ if (response.statusCode !== 200) {
63
+ reject(new Error(`Failed to download: ${response.statusCode} ${response.statusMessage}`));
64
+ return;
65
+ }
66
+
67
+ const file = fs.createWriteStream(dest);
68
+ response.pipe(file);
69
+
70
+ file.on('finish', () => {
71
+ file.close();
72
+ resolve();
73
+ });
74
+
75
+ file.on('error', (err) => {
76
+ fs.unlink(dest, () => { });
77
+ reject(err);
78
+ });
79
+ }).on('error', reject);
80
+ });
81
+ }
82
+
83
+ // Extract tar.gz archive
84
+ async function extractTarGz(archivePath, dest) {
85
+ return new Promise((resolve, reject) => {
86
+ try {
87
+ execSync(`tar -xzf "${archivePath}" -C "${path.dirname(dest)}"`, {
88
+ stdio: 'inherit'
89
+ });
90
+
91
+ if (fs.existsSync(dest)) {
92
+ resolve();
93
+ return;
94
+ }
95
+
96
+ // If the archive contains a nested path, search for the binary and move it to dest.
97
+ const dir = path.dirname(dest);
98
+ const expectedName = path.basename(dest);
99
+
100
+ const stack = [dir];
101
+ while (stack.length > 0) {
102
+ const current = stack.pop();
103
+ const entries = fs.readdirSync(current, { withFileTypes: true });
104
+ for (const entry of entries) {
105
+ const fullPath = path.join(current, entry.name);
106
+ if (entry.isDirectory()) {
107
+ stack.push(fullPath);
108
+ continue;
109
+ }
110
+ if (entry.isFile() && entry.name === expectedName) {
111
+ fs.renameSync(fullPath, dest);
112
+ resolve();
113
+ return;
114
+ }
115
+ }
116
+ }
117
+
118
+ reject(new Error(`Binary ${expectedName} not found after extracting ${path.basename(archivePath)}`));
119
+ } catch (err) {
120
+ reject(new Error('tar extraction failed. Please install tar or manually extract the archive.'));
121
+ }
122
+ });
123
+ }
124
+
125
+ // Extract zip archive (Windows)
126
+ function extractZip(archivePath, dest) {
127
+ const AdmZip = require('adm-zip');
128
+ const zip = new AdmZip(archivePath);
129
+ zip.extractAllTo(path.dirname(dest), true);
130
+ }
131
+
132
+ async function install() {
133
+ try {
134
+ console.log('Installing Orca CLI...');
135
+
136
+ const { target, archive, platform } = getPlatformInfo();
137
+ console.log(`Detected platform: ${platform} (${target})`);
138
+
139
+ // Determine BIN_DIR
140
+ // If running from scripts/ (dev), we want ../cli/bin
141
+ // If running from package root (prod), we want ./bin
142
+ const devBinDir = path.join(__dirname, '..', 'cli', 'bin');
143
+ const prodBinDir = path.join(__dirname, 'bin');
144
+
145
+ // We use prod structure if we can't find the dev structure, or if we are clearly in the package (package.json exists in __dirname)
146
+ const isProd = fs.existsSync(path.join(__dirname, 'package.json'));
147
+ const BIN_DIR = isProd ? prodBinDir : devBinDir;
148
+
149
+ console.log(`Using binary directory: ${BIN_DIR}`);
150
+
151
+ // Create bin directory if it doesn't exist
152
+ if (!fs.existsSync(BIN_DIR)) {
153
+ fs.mkdirSync(BIN_DIR, { recursive: true });
154
+ }
155
+
156
+ // Determine Version to download
157
+ let version = 'latest';
158
+ try {
159
+ const pkgPath = isProd ? path.join(__dirname, 'package.json') : path.join(__dirname, '..', 'cli', 'package.json');
160
+ if (fs.existsSync(pkgPath)) {
161
+ const pkg = require(pkgPath);
162
+ version = pkg.version;
163
+ }
164
+ } catch (e) {
165
+ console.warn('Could not determine version from package.json, falling back to latest.');
166
+ }
167
+
168
+ console.log(`Target version: ${version}`);
169
+
170
+ // Construct Download URL
171
+ // Latest: https://github.com/vanthaita/orca-releases/releases/latest/download/orca-target.archive
172
+ // Tagged: https://github.com/vanthaita/orca-releases/releases/download/v1.2.3/orca-target.archive
173
+
174
+ let downloadBase;
175
+ if (version === 'latest') {
176
+ downloadBase = `https://github.com/${REPO}/releases/latest/download`;
177
+ } else {
178
+ const tag = version.startsWith('v') ? version : `v${version}`;
179
+ downloadBase = `https://github.com/${REPO}/releases/download/${tag}`;
180
+ }
181
+
182
+ const downloadUrl = `${downloadBase}/orca-${target}.${archive}`;
183
+ const archivePath = path.join(BIN_DIR, `orca-${target}.${archive}`);
184
+ const binaryPath = path.join(BIN_DIR, BINARY_NAME);
185
+
186
+ console.log(`Downloading from ${downloadUrl}...`);
187
+ try {
188
+ await download(downloadUrl, archivePath);
189
+ } catch (err) {
190
+ if (version !== 'latest') {
191
+ console.warn(`Failed to download specific version ${version}, falling back to latest...`);
192
+ // Fallback to latest if specific version fails (e.g. if release isn't published yet when testing)
193
+ const latestUrl = `https://github.com/${REPO}/releases/latest/download/orca-${target}.${archive}`;
194
+ await download(latestUrl, archivePath);
195
+ } else {
196
+ throw err;
197
+ }
198
+ }
199
+
200
+ console.log('Extracting binary...');
201
+ if (archive === 'tar.gz') {
202
+ await extractTarGz(archivePath, binaryPath);
203
+ // Move binary to correct location if extracted with directory structure
204
+ // In our case, tar might extract to current dir or path/to/bin.
205
+ // We need to find 'orca' executable.
206
+
207
+ // Should reliably be at BIN_DIR/orca if tar command worked as expected with tar -C
208
+ // But let's verify
209
+ const possibleBinary = path.join(BIN_DIR, 'orca');
210
+ if (fs.existsSync(possibleBinary) && possibleBinary !== binaryPath) {
211
+ fs.renameSync(possibleBinary, binaryPath);
212
+ }
213
+
214
+ } else if (archive === 'zip') {
215
+ // For Windows/Zip
216
+ const tempDir = path.join(BIN_DIR, 'temp_extract');
217
+ if (fs.existsSync(tempDir)) {
218
+ fs.rmSync(tempDir, { recursive: true, force: true });
219
+ }
220
+ fs.mkdirSync(tempDir);
221
+
222
+ try {
223
+ execSync(`powershell -command "Expand-Archive -Force -Path '${archivePath}' -DestinationPath '${tempDir}'"`, {
224
+ stdio: 'inherit'
225
+ });
226
+ } catch (e) {
227
+ // Fallback or retry?
228
+ throw new Error('PowerShell Expand-Archive failed');
229
+ }
230
+
231
+ // Find binary in temp (could be nested)
232
+ // But usually it's at root of zip.
233
+ const extractedBinary = path.join(tempDir, BINARY_NAME);
234
+
235
+ if (fs.existsSync(extractedBinary)) {
236
+ if (fs.existsSync(binaryPath)) fs.unlinkSync(binaryPath);
237
+ fs.renameSync(extractedBinary, binaryPath);
238
+ } else {
239
+ // Search recursively?
240
+ // For now, assume flat zip
241
+ throw new Error(`Binary ${BINARY_NAME} not found in zip`);
242
+ }
243
+
244
+ // Cleanup temp dir
245
+ fs.rmSync(tempDir, { recursive: true, force: true });
246
+ }
247
+
248
+ // Make binary executable (Unix-like systems)
249
+ if (platform !== 'win32') {
250
+ if (fs.existsSync(binaryPath)) {
251
+ fs.chmodSync(binaryPath, 0o755);
252
+ } else {
253
+ throw new Error(`Binary path ${binaryPath} does not exist after extraction`);
254
+ }
255
+ }
256
+
257
+ // Cleanup archive
258
+ if (fs.existsSync(archivePath)) {
259
+ fs.unlinkSync(archivePath);
260
+ }
261
+
262
+ console.log(`✓ Orca CLI installed successfully to ${binaryPath}`);
263
+ console.log('Run "orca --help" to get started.');
264
+ } catch (error) {
265
+ console.error('Installation failed:', error.message);
266
+ console.error('\nPlease install manually from: https://github.com/vanthaita/orca-releases/releases/latest');
267
+ process.exit(1);
268
+ }
269
+ }
270
+
271
+ // Run installation
272
+ if (require.main === module) {
273
+ install();
274
+ }
275
+
276
+ module.exports = { install };
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@vanthaita/orca",
3
+ "version": "0.1.26",
4
+ "description": "AI-powered Git Workflow automation for modern developers",
5
+ "scripts": {
6
+ "postinstall": "node install.js"
7
+ },
8
+ "bin": {
9
+ "orca": "./bin/orca.js"
10
+ },
11
+ "dependencies": {
12
+ "adm-zip": "^0.5.10"
13
+ },
14
+ "files": [
15
+ "bin/",
16
+ "install.js",
17
+ "package.json",
18
+ "README.md",
19
+ "LICENSE"
20
+ ],
21
+ "keywords": [
22
+ "git",
23
+ "cli",
24
+ "ai",
25
+ "workflow",
26
+ "automation",
27
+ "commit",
28
+ "rust"
29
+ ],
30
+ "author": "vanthaita",
31
+ "license": "MIT",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/vanthaita/orca-releases.git"
35
+ },
36
+ "homepage": "https://orcacli.codes",
37
+ "bugs": {
38
+ "url": "https://github.com/vanthaita/orca-releases/issues"
39
+ },
40
+ "engines": {
41
+ "node": ">=14.0.0"
42
+ },
43
+ "os": [
44
+ "darwin",
45
+ "linux",
46
+ "win32"
47
+ ],
48
+ "cpu": [
49
+ "x64",
50
+ "arm64"
51
+ ]
52
+ }