UNPKG

@shutootaki/gwm

Version:
51 lines 3.27 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { Text, Box } from 'ink'; const Row = ({ label, desc }) => { const labelWidth = 32; // ラベルの固定幅 const paddedLabel = label.padEnd(labelWidth, ' '); return (_jsxs(Text, { children: [_jsx(Text, { color: "yellow", children: paddedLabel }), desc] })); }; export const Welcome = () => { const commands = [ { label: 'list, ls', desc: 'List all worktrees with status' }, { label: 'add [branch] [-r] [--from branch]', desc: 'Add new worktree', }, { label: 'remove, rm [query] [-f] [--clean-branch <mode>]', desc: 'Remove worktrees (interactive)', }, { label: 'clean [-n] [--force]', desc: 'Clean up safe-to-delete worktrees', }, { label: 'pull-main', desc: 'Update main branch worktree(s)' }, { label: 'go [query] [--code] [--cursor]', desc: 'Navigate or open worktree', }, { label: 'help [command]', desc: 'Show help for gwm or specific command' }, ]; const options = [ { label: '-r, --remote', desc: 'Add from remote branch' }, { label: '--from <branch>', desc: 'Specify base branch for new worktree' }, { label: '-f, --force', desc: 'Force remove worktree' }, { label: '-n, --dry-run', desc: 'Preview cleanable worktrees', }, { label: '--force', desc: 'Skip confirmation on clean', }, { label: '--clean-branch <mode>', desc: 'auto | ask | never (local branch cleanup)', }, { label: '--code', desc: 'Open selected worktree in VS Code' }, { label: '--cursor', desc: 'Open selected worktree in Cursor' }, ]; return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "cyan", bold: true, children: "gwm - Git Worktree Manager" }) }), _jsx(Box, { marginBottom: 1, children: _jsxs(Text, { children: ["Usage: ", _jsx(Text, { color: "yellow", children: "gwm <command> [options]" })] }) }), _jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { bold: true, children: "Commands:" }), commands.map((row) => (_jsx(Row, { ...row }, row.label)))] }), _jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { bold: true, children: "Options:" }), options.map((row) => (_jsx(Row, { ...row }, row.label)))] }), _jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { bold: true, children: "Examples:" }), _jsx(Row, { label: "gwm list", desc: "Show all worktrees" }), _jsx(Row, { label: "gwm add feature/new-ui", desc: "Add worktree from local branch" }), _jsx(Row, { label: "gwm add -r origin/main", desc: "Add from remote branch" }), _jsx(Row, { label: "gwm remove", desc: "Interactive worktree removal" }), _jsx(Row, { label: "gwm clean -n", desc: "Dry-run clean" }), _jsx(Row, { label: "gwm clean --force", desc: "Force clean without confirmation" })] }), _jsx(Text, { color: "gray", children: "Configuration: ~/.config/gwm/config.toml or ~/.gwmrc" })] })); }; //# sourceMappingURL=Welcome.js.map