mirror of
https://github.com/stablyai/orca.git
synced 2026-10-19 16:03:26 +00:00
49 lines
1.8 KiB
TypeScript
49 lines
1.8 KiB
TypeScript
import type { CommandSpec } from '../args'
|
|
import { GLOBAL_FLAGS } from '../args'
|
|
|
|
export const FILE_COMMAND_SPECS: CommandSpec[] = [
|
|
{
|
|
path: ['file', 'open'],
|
|
summary: 'Open a workspace file in the Orca editor',
|
|
usage: 'orca file open <path> [--worktree <selector>] [--json]',
|
|
allowedFlags: [...GLOBAL_FLAGS, 'path', 'worktree'],
|
|
positionalArgs: ['path'],
|
|
notes: [
|
|
'The path is relative to the selected worktree. When --worktree is omitted, local CLI calls infer the current Orca worktree from cwd.'
|
|
],
|
|
examples: [
|
|
'orca file open src/App.tsx',
|
|
'orca file open --path docs/readme.md --worktree active'
|
|
]
|
|
},
|
|
{
|
|
path: ['file', 'diff'],
|
|
summary: 'Open a workspace file diff in the Orca editor',
|
|
usage: 'orca file diff <path> [--staged] [--worktree <selector>] [--json]',
|
|
allowedFlags: [...GLOBAL_FLAGS, 'path', 'staged', 'worktree'],
|
|
positionalArgs: ['path'],
|
|
notes: [
|
|
'Diffs default to unstaged changes. Pass --staged to open the staged source-control diff.'
|
|
],
|
|
examples: [
|
|
'orca file diff src/App.tsx',
|
|
'orca file diff --path package.json --staged --worktree branch:feature'
|
|
]
|
|
},
|
|
{
|
|
path: ['file', 'open-changed'],
|
|
summary: 'Open all git-changed files for a workspace',
|
|
usage: 'orca file open-changed [--mode edit|diff|both] [--worktree <selector>] [--json]',
|
|
allowedFlags: [...GLOBAL_FLAGS, 'mode', 'worktree'],
|
|
notes: [
|
|
'For v1, changed files come from git status for the selected worktree.',
|
|
'The default mode is diff. Edit mode skips deleted files because there is no file to open.'
|
|
],
|
|
examples: [
|
|
'orca file open-changed',
|
|
'orca file open-changed --mode both',
|
|
'orca file open-changed --mode diff --worktree active'
|
|
]
|
|
}
|
|
]
|