@tsuzuku/arise 1.1.1 โ†’ 1.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.
package/README.md CHANGED
@@ -6,6 +6,7 @@ Unified, workplace-agnostic Git worktree and Herdr workspace orchestrator with p
6
6
 
7
7
  ## Features
8
8
 
9
+ - **Interactive TUI Mode**: Run `arise` with zero arguments for an interactive menu (create worktrees, switch/open existing sessions, list worktrees with Herdr status, nuke/cleanup with multi-picker, and install AI agent skills).
9
10
  - **Unified Lifecycle**: Handles git worktree creation, branch resolution, Herdr workspace orchestration, 4-pane quadrant terminal setup, and safe teardown/nuke.
10
11
  - **Pluggable Presets**: Built-in support for **Node.js** (`npm`/`yarn`/`pnpm`), **Laravel/PHP** (`composer`, logs, permissions), and **Generic** projects.
11
12
  - **Zero-Config Auto-Detection**: Automatically detects project types based on directory markers (`package.json`, `composer.json`, `artisan`, etc.).
@@ -21,7 +22,7 @@ Unified, workplace-agnostic Git worktree and Herdr workspace orchestrator with p
21
22
  npm install -g arise
22
23
 
23
24
  # Or run directly without installing via npx
24
- npx arise --branch <branch-name>
25
+ npx arise
25
26
  ```
26
27
 
27
28
  Aliases provided: `arise`, `herdr-worktree`, `herder-worktree`, and `hwk`.
@@ -30,7 +31,29 @@ Aliases provided: `arise`, `herdr-worktree`, `herder-worktree`, and `hwk`.
30
31
 
31
32
  ## Quick Start
32
33
 
33
- ### 1. Create a Worktree Session
34
+ ### 1. Interactive Setup Wizard (`arise init`)
35
+ ```bash
36
+ # Run interactive configuration wizard (Quick or Guided Step-by-Step, with .gitignore prompt)
37
+ arise init
38
+
39
+ # Fast-path quick initialization with detected repo defaults (optionally adding to .gitignore)
40
+ arise init --quick
41
+ arise init --quick --gitignore
42
+ ```
43
+
44
+ ### 2. Interactive Menu / TUI Mode (Zero Arguments)
45
+ ```bash
46
+ # Launch interactive menu
47
+ arise
48
+ ```
49
+ Interactive options include:
50
+ - ๐Ÿš€ **Create new worktree** (select base source branch, enter branch name)
51
+ - ๐Ÿ”„ **Switch / Open existing worktree in Herdr**
52
+ - ๐Ÿ“‹ **List worktrees** (with active Herdr workspace status)
53
+ - ๐Ÿงน **Nuke / Cleanup worktree** (multi-select / picker with branch deletion options)
54
+ - โš™๏ธ **Initialize / Configure Arise** (interactive setup wizard)
55
+
56
+ ### 2. Create a Worktree Session (CLI Flags)
34
57
  ```bash
35
58
  # Auto-detects project type (Node, Laravel, etc.)
36
59
  arise --branch feature/login
@@ -46,7 +69,7 @@ arise --branch feature/login -a aider
46
69
  arise --branch feature/login --source develop --focus claude
47
70
  ```
48
71
 
49
- ### 2. Nuke / Clean Up a Worktree
72
+ ### 3. Nuke / Clean Up a Worktree
50
73
  ```bash
51
74
  # Inside a worktree directory (auto-detects current worktree):
52
75
  arise --nuke
@@ -61,7 +84,7 @@ arise --nuke feature-login --dir-only
61
84
  arise --nuke feature-login --keep-remote
62
85
  ```
63
86
 
64
- ### 3. Install AI Agent Skill (Antigravity `agy`, Claude Code, etc.)
87
+ ### 4. Install AI Agent Skill (Antigravity `agy`, Claude Code, etc.)
65
88
  ```bash
66
89
  # Install globally to ~/.agents/skills and link to ~/.gemini/skills:
67
90
  arise --install-skill
@@ -108,6 +131,7 @@ arise/
108
131
  โ”‚ โ””โ”€โ”€ cli.js # Executable CLI
109
132
  โ”œโ”€โ”€ lib/
110
133
  โ”‚ โ”œโ”€โ”€ cli.js # CLI argument parsing & help output
134
+ โ”‚ โ”œโ”€โ”€ interactive.js # Interactive TUI menu & prompt handlers
111
135
  โ”‚ โ”œโ”€โ”€ config.js # Config discovery & preset merging
112
136
  โ”‚ โ”œโ”€โ”€ git.js # Git worktree & branch operations
113
137
  โ”‚ โ”œโ”€โ”€ herdr.js # Herdr workspace & pane operations
package/index.js CHANGED
@@ -3,9 +3,11 @@ const { parseArgs, showUsage } = require('./lib/cli');
3
3
  const { resolveConfiguration } = require('./lib/config');
4
4
  const { executeCreate } = require('./lib/lifecycle/create');
5
5
  const { executeNuke } = require('./lib/lifecycle/nuke');
6
+ const logger = require('./lib/logger');
6
7
 
7
8
  async function run(argv = process.argv.slice(2), cwd = process.cwd()) {
8
9
  const flags = parseArgs(argv);
10
+ logger.initLogger(flags);
9
11
 
10
12
  if (flags.showHelp) {
11
13
  showUsage();
@@ -17,18 +19,54 @@ async function run(argv = process.argv.slice(2), cwd = process.cwd()) {
17
19
  process.exit(0);
18
20
  }
19
21
 
20
- if (flags.installSkill) {
21
- const { installSkill } = require('./lib/skill');
22
- installSkill({ scope: flags.skillScope, cwd });
23
- process.exit(0);
24
- }
22
+ try {
23
+ if (flags.installSkill) {
24
+ const { installSkill } = require('./lib/skill');
25
+ installSkill({ scope: flags.skillScope, cwd });
26
+ process.exit(0);
27
+ }
28
+
29
+ if (flags.isInit) {
30
+ const { ConfigInitWizard } = require('./lib/config/init');
31
+ await ConfigInitWizard.run({
32
+ quick: flags.quick || flags.yes,
33
+ local: flags.skillScope === 'local',
34
+ global: flags.skillScope === 'global' && flags.rawArgs.includes('--global'),
35
+ targetPath: flags.targetPath,
36
+ force: flags.force,
37
+ gitignore: flags.gitignore,
38
+ cwd,
39
+ });
40
+ return;
41
+ }
42
+
43
+ const config = resolveConfiguration(flags, cwd);
44
+ logger.debug(`Loaded configuration for cwd="${cwd}":`, {
45
+ configFile: config.configFile,
46
+ preset: config.preset?.name,
47
+ layoutCount: config.layout?.length,
48
+ panes: config.layout?.map((p) => ({ id: p.id, title: p.title, from: p.from, split: p.split })),
49
+ });
50
+
51
+ if (flags.isCleanup) {
52
+ await executeNuke(flags, config, cwd);
53
+ return;
54
+ }
25
55
 
26
- const config = resolveConfiguration(flags, cwd);
56
+ // Interactive CLI / TUI Mode (arise with zero args or --interactive flag)
57
+ const isZeroArgs = flags.rawArgs.length === 0 && !flags.branch;
58
+ if (flags.interactive || isZeroArgs) {
59
+ if (process.stdin.isTTY || flags.interactive) {
60
+ const { startInteractiveMenu } = require('./lib/interactive');
61
+ await startInteractiveMenu(flags, config, cwd);
62
+ return;
63
+ }
64
+ }
27
65
 
28
- if (flags.isCleanup) {
29
- await executeNuke(flags, config, cwd);
30
- } else {
31
66
  await executeCreate(flags, config, cwd);
67
+ } catch (err) {
68
+ logger.error(`Execution failed: ${err.message}`, err);
69
+ process.exit(1);
32
70
  }
33
71
  }
34
72
 
package/lib/cli.js CHANGED
@@ -5,12 +5,22 @@ function showUsage() {
5
5
  Arise - Unified Worktree & Herdr Workspace Orchestrator
6
6
 
7
7
  Usage:
8
+ arise (Interactive menu / TUI mode)
9
+ arise init [options] (Interactive setup wizard / .ariserc.json generator)
8
10
  arise --branch <branch> [options]
9
11
  arise --nuke [<worktree dir or branch>] [nuke-options]
10
12
  arise --cleanup [<worktree dir or branch>] [nuke-options]
11
13
 
14
+ Interactive & Wizard Modes:
15
+ arise (Running with zero arguments launches the interactive TUI menu)
16
+ arise init, --init Launch the Arise configuration initialization wizard.
17
+ --quick, -q (Wizard option) Fast-path setup with detected repo defaults.
18
+ --gitignore (Wizard option) Add generated config file to .gitignore.
19
+ --no-gitignore (Wizard option) Do not add generated config file to .gitignore.
20
+ --interactive, -I, --menu Launch interactive prompt/menu (create, switch, list, nuke, init).
21
+
12
22
  Creation Arguments:
13
- --branch, -b <branch> (Required for creation) Git branch to create or boot into.
23
+ --branch, -b <branch> (Required for non-interactive creation) Git branch to create or boot into.
14
24
  --dirname, -d <dirname> (Optional) Directory name of the worktree. Defaults to sanitized branch name.
15
25
  --workspace, -w <name> (Optional) Custom Herdr workspace name.
16
26
  --source, -s, --base <src> (Optional) Base branch if creating a new branch. Defaults to preset default (e.g. 'develop' / 'prod').
@@ -33,7 +43,9 @@ Agent Skill Arguments:
33
43
  --local, --workspace Install skill locally to current workspace (.agents/skills).
34
44
 
35
45
  General Arguments:
36
- --yes, -y (Optional) Automatically answer yes to confirmation prompts (e.g. installing Herdr).
46
+ --yes, -y (Optional) Automatically answer yes to confirmation prompts (e.g. installing Herdr, quick init).
47
+ --debug (Optional) Enable verbose debug logging to stderr and log file.
48
+ --verbose, -V (Optional) Alias for --debug.
37
49
  --help, -h Show this help message.
38
50
  --version, -v Show version information.
39
51
  `);
@@ -41,12 +53,17 @@ General Arguments:
41
53
 
42
54
  function parseArgs(argv = process.argv.slice(2)) {
43
55
  const flags = {
56
+ interactive: false,
57
+ isInit: false,
58
+ quick: false,
44
59
  isCleanup: false,
45
60
  cleanupTarget: null,
46
61
  dirOnly: false,
47
62
  keepRemote: false,
48
63
  force: false,
49
64
  yes: false,
65
+ debug: false,
66
+ verbose: false,
50
67
  branch: null,
51
68
  dirname: null,
52
69
  workspaceName: null,
@@ -56,6 +73,8 @@ function parseArgs(argv = process.argv.slice(2)) {
56
73
  focusTarget: null,
57
74
  installSkill: false,
58
75
  skillScope: 'global',
76
+ targetPath: null,
77
+ gitignore: null,
59
78
  showHelp: false,
60
79
  showVersion: false,
61
80
  rawArgs: argv,
@@ -68,6 +87,21 @@ function parseArgs(argv = process.argv.slice(2)) {
68
87
  flags.showHelp = true;
69
88
  } else if (arg === '--version' || arg === '-v') {
70
89
  flags.showVersion = true;
90
+ } else if (arg === '--debug') {
91
+ flags.debug = true;
92
+ } else if (arg === '--verbose' || arg === '-V') {
93
+ flags.verbose = true;
94
+ flags.debug = true;
95
+ } else if (arg === 'init' || arg === '--init') {
96
+ flags.isInit = true;
97
+ } else if (arg === '--quick' || arg === '-q') {
98
+ flags.quick = true;
99
+ } else if (arg === '--gitignore' || arg === '--add-gitignore') {
100
+ flags.gitignore = true;
101
+ } else if (arg === '--no-gitignore') {
102
+ flags.gitignore = false;
103
+ } else if (arg === '--interactive' || arg === '-I' || arg === '--menu' || arg === 'menu' || arg === 'interactive') {
104
+ flags.interactive = true;
71
105
  } else if (arg === '--install-skill' || arg === '--install-agent-skill' || arg === '--setup-skill' || arg === '-i') {
72
106
  flags.installSkill = true;
73
107
  } else if (arg === '--global') {
@@ -88,6 +122,9 @@ function parseArgs(argv = process.argv.slice(2)) {
88
122
  flags.force = true;
89
123
  } else if (arg === '--yes' || arg === '-y') {
90
124
  flags.yes = true;
125
+ } else if (arg === '--target' || arg === '--out') {
126
+ flags.targetPath = argv[i + 1];
127
+ i++;
91
128
  } else if (arg === '--branch' || arg === '-b') {
92
129
  flags.branch = argv[i + 1];
93
130
  i++;