aiwcli 0.15.5 → 0.17.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 +108 -1124
- package/bin/run.js +0 -4
- package/dist/capabilities/branch/adapters.d.ts +2 -0
- package/dist/capabilities/branch/adapters.js +21 -0
- package/dist/capabilities/branch/contracts.d.ts +57 -0
- package/dist/capabilities/branch/contracts.js +1 -0
- package/dist/capabilities/branch/control-plane.d.ts +2 -0
- package/dist/capabilities/branch/control-plane.js +343 -0
- package/dist/capabilities/branch/runtime-core.d.ts +5 -0
- package/dist/capabilities/branch/runtime-core.js +36 -0
- package/dist/capabilities/installation/control-plane/clean-command.d.ts +41 -0
- package/dist/capabilities/installation/control-plane/clean-command.js +196 -0
- package/dist/capabilities/installation/control-plane/clear-command.d.ts +162 -0
- package/dist/capabilities/installation/control-plane/clear-command.js +1249 -0
- package/dist/capabilities/installation/control-plane/init-command.d.ts +81 -0
- package/dist/capabilities/installation/control-plane/init-command.js +449 -0
- package/dist/capabilities/launch/contracts.d.ts +86 -0
- package/dist/capabilities/launch/contracts.js +1 -0
- package/dist/capabilities/launch/control-plane/execute-launch.d.ts +2 -0
- package/dist/capabilities/launch/control-plane/execute-launch.js +261 -0
- package/dist/capabilities/launch/runtime-core/launch-decisions.d.ts +82 -0
- package/dist/capabilities/launch/runtime-core/launch-decisions.js +202 -0
- package/dist/capabilities/launch/runtime-core/launch-options.d.ts +14 -0
- package/dist/capabilities/launch/runtime-core/launch-options.js +69 -0
- package/dist/cli/base-command.d.ts +18 -0
- package/dist/cli/base-command.js +55 -0
- package/dist/commands/branch.d.ts +1 -21
- package/dist/commands/branch.js +25 -417
- package/dist/commands/clean.d.ts +1 -41
- package/dist/commands/clean.js +1 -196
- package/dist/commands/clear.d.ts +1 -161
- package/dist/commands/clear.js +1 -1121
- package/dist/commands/init/index.d.ts +1 -98
- package/dist/commands/init/index.js +4 -478
- package/dist/commands/launch.d.ts +32 -12
- package/dist/commands/launch.js +107 -166
- package/dist/lib/claude-settings-types.d.ts +31 -19
- package/dist/lib/config.js +1 -2
- package/dist/lib/context/context-formatter.d.ts +74 -0
- package/dist/lib/context/context-formatter.js +493 -0
- package/dist/lib/context/context-selector.d.ts +42 -0
- package/dist/lib/context/context-selector.js +451 -0
- package/dist/lib/context/context-store.d.ts +100 -0
- package/dist/lib/context/context-store.js +644 -0
- package/dist/lib/context/plan-manager.d.ts +54 -0
- package/dist/lib/context/plan-manager.js +282 -0
- package/dist/lib/context/task-tracker.d.ts +44 -0
- package/dist/lib/context/task-tracker.js +146 -0
- package/dist/lib/core-ide-base.d.ts +4 -0
- package/dist/lib/core-ide-base.js +77 -0
- package/dist/lib/core-installer.d.ts +5 -0
- package/dist/lib/core-installer.js +33 -0
- package/dist/lib/debug.d.ts +0 -10
- package/dist/lib/debug.js +0 -10
- package/dist/lib/env-sanitizer.d.ts +25 -0
- package/dist/lib/env-sanitizer.js +46 -0
- package/dist/lib/errors.d.ts +0 -13
- package/dist/lib/errors.js +0 -15
- package/dist/lib/git-exclude-manager.d.ts +2 -2
- package/dist/lib/git-exclude-manager.js +3 -3
- package/dist/lib/hooks/context-monitor-logic.d.ts +6 -0
- package/dist/lib/hooks/context-monitor-logic.js +25 -0
- package/dist/lib/hooks/hook-utils.d.ts +143 -0
- package/dist/lib/hooks/hook-utils.js +620 -0
- package/dist/lib/hooks/prompt-binding-logic.d.ts +7 -0
- package/dist/lib/hooks/prompt-binding-logic.js +50 -0
- package/dist/lib/hooks/session-end-logic.d.ts +5 -0
- package/dist/lib/hooks/session-end-logic.js +51 -0
- package/dist/lib/hooks-merger.js +25 -19
- package/dist/lib/ide-path-resolver.d.ts +19 -7
- package/dist/lib/ide-path-resolver.js +25 -9
- package/dist/lib/install-state.d.ts +34 -0
- package/dist/lib/install-state.js +154 -0
- package/dist/lib/json-io.d.ts +12 -0
- package/dist/lib/json-io.js +30 -0
- package/dist/lib/lsp-patch.d.ts +12 -0
- package/dist/lib/lsp-patch.js +156 -0
- package/dist/lib/multiplexer.d.ts +65 -0
- package/dist/lib/multiplexer.js +38 -0
- package/dist/lib/multiplexers/psmux.d.ts +55 -0
- package/dist/lib/multiplexers/psmux.js +324 -0
- package/dist/lib/multiplexers/tmux.d.ts +36 -0
- package/dist/lib/multiplexers/tmux.js +221 -0
- package/dist/lib/multiplexers/wezterm.d.ts +38 -0
- package/dist/lib/multiplexers/wezterm.js +225 -0
- package/dist/lib/mux-utils.d.ts +6 -0
- package/dist/lib/mux-utils.js +36 -0
- package/dist/lib/paths.d.ts +2 -2
- package/dist/lib/paths.js +2 -2
- package/dist/lib/platform-commands.d.ts +27 -0
- package/dist/lib/platform-commands.js +49 -0
- package/dist/lib/prompt-file-manager.d.ts +23 -0
- package/dist/lib/prompt-file-manager.js +41 -0
- package/dist/lib/runtime/agent-launcher.d.ts +67 -0
- package/dist/lib/runtime/agent-launcher.js +262 -0
- package/dist/lib/runtime/aiw-cli.d.ts +39 -0
- package/dist/lib/runtime/aiw-cli.js +76 -0
- package/dist/lib/runtime/atomic-write.d.ts +19 -0
- package/dist/lib/runtime/atomic-write.js +121 -0
- package/dist/lib/runtime/cli-args.d.ts +58 -0
- package/dist/lib/runtime/cli-args.js +200 -0
- package/dist/lib/runtime/constants.d.ts +56 -0
- package/dist/lib/runtime/constants.js +230 -0
- package/dist/lib/runtime/executable-policy.d.ts +16 -0
- package/dist/lib/runtime/executable-policy.js +57 -0
- package/dist/lib/runtime/git-state.d.ts +9 -0
- package/dist/lib/runtime/git-state.js +59 -0
- package/dist/lib/runtime/inference.d.ts +37 -0
- package/dist/lib/runtime/inference.js +251 -0
- package/dist/lib/runtime/lint-dispatch.d.ts +40 -0
- package/dist/lib/runtime/lint-dispatch.js +285 -0
- package/dist/lib/runtime/logger.d.ts +66 -0
- package/dist/lib/runtime/logger.js +201 -0
- package/dist/lib/runtime/models.d.ts +20 -0
- package/dist/lib/runtime/models.js +20 -0
- package/dist/lib/runtime/platform-adapter.d.ts +7 -0
- package/dist/lib/runtime/platform-adapter.js +21 -0
- package/dist/lib/runtime/preflight.d.ts +24 -0
- package/dist/lib/runtime/preflight.js +65 -0
- package/dist/lib/runtime/sentinel-ipc.d.ts +14 -0
- package/dist/lib/runtime/sentinel-ipc.js +67 -0
- package/dist/lib/runtime/state-io.d.ts +31 -0
- package/dist/lib/runtime/state-io.js +179 -0
- package/dist/lib/runtime/stop-words.d.ts +20 -0
- package/dist/lib/runtime/stop-words.js +150 -0
- package/dist/lib/runtime/subprocess-utils.d.ts +29 -0
- package/dist/lib/runtime/subprocess-utils.js +96 -0
- package/dist/lib/runtime/tmux-preflight.d.ts +13 -0
- package/dist/lib/runtime/tmux-preflight.js +78 -0
- package/dist/lib/runtime/utils.d.ts +62 -0
- package/dist/lib/runtime/utils.js +192 -0
- package/dist/lib/schemas.d.ts +250 -0
- package/dist/lib/schemas.js +216 -0
- package/dist/lib/sentinel-manager.d.ts +32 -0
- package/dist/lib/sentinel-manager.js +62 -0
- package/dist/lib/sentinel-wrapper.d.ts +10 -0
- package/dist/lib/sentinel-wrapper.js +29 -0
- package/dist/lib/settings-hierarchy.js +3 -20
- package/dist/lib/shell-adapters/bash-adapter.d.ts +18 -0
- package/dist/lib/shell-adapters/bash-adapter.js +69 -0
- package/dist/lib/shell-adapters/index.d.ts +5 -0
- package/dist/lib/shell-adapters/index.js +7 -0
- package/dist/lib/shell-adapters/powershell-adapter.d.ts +18 -0
- package/dist/lib/shell-adapters/powershell-adapter.js +62 -0
- package/dist/lib/shell-adapters/shell-adapter.d.ts +45 -0
- package/dist/lib/shell-adapters/shell-adapter.js +5 -0
- package/dist/lib/shell-quoting.d.ts +5 -0
- package/dist/lib/shell-quoting.js +17 -0
- package/dist/lib/spawn-errors.d.ts +9 -0
- package/dist/lib/spawn-errors.js +29 -0
- package/dist/lib/spawn.js +5 -11
- package/dist/lib/spinner.d.ts +0 -5
- package/dist/lib/spinner.js +0 -16
- package/dist/lib/template-installer.d.ts +14 -5
- package/dist/lib/template-installer.js +40 -38
- package/dist/lib/template-resolver.d.ts +6 -7
- package/dist/lib/template-resolver.js +26 -21
- package/dist/lib/template-settings-reconstructor.d.ts +7 -2
- package/dist/lib/template-settings-reconstructor.js +76 -45
- package/dist/lib/terminal-strategy.d.ts +12 -0
- package/dist/lib/terminal-strategy.js +55 -0
- package/dist/lib/terminal.d.ts +34 -4
- package/dist/lib/terminal.js +192 -119
- package/dist/lib/tmux-pane-placement.d.ts +17 -0
- package/dist/lib/tmux-pane-placement.js +58 -0
- package/dist/lib/tmux-primitives.d.ts +3 -0
- package/dist/lib/tmux-primitives.js +11 -0
- package/dist/lib/tmux-session.d.ts +32 -0
- package/dist/lib/tmux-session.js +87 -0
- package/dist/lib/tty-detection.js +1 -1
- package/dist/lib/types.d.ts +168 -0
- package/dist/lib/types.js +6 -0
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/lib/windsurf-hooks-hierarchy.js +6 -23
- package/dist/platform/launch.d.ts +11 -0
- package/dist/platform/launch.js +11 -0
- package/dist/templates/CLAUDE.md +30 -40
- package/dist/templates/cc-native/.claude/settings.json +26 -36
- package/dist/templates/cc-native/CC-NATIVE-README.md +1 -1
- package/dist/templates/cc-native/TEMPLATE-SCHEMA.md +20 -12
- package/dist/templates/cc-native/_cc-native/cc-native.config.json +2 -6
- package/dist/templates/cc-native/_cc-native/hooks/CLAUDE.md +39 -59
- package/dist/templates/cc-native/_cc-native/hooks/cc-native-plan-review.ts +9 -11
- package/dist/templates/cc-native/_cc-native/hooks/enhance_plan_post_subagent.ts +2 -2
- package/dist/templates/cc-native/_cc-native/hooks/enhance_plan_post_write.ts +4 -5
- package/dist/templates/cc-native/_cc-native/hooks/mark_questions_asked.ts +4 -4
- package/dist/templates/cc-native/_cc-native/hooks/plan_questions_early.ts +2 -27
- package/dist/templates/cc-native/_cc-native/hooks/validate_task_prompt.ts +7 -7
- package/dist/templates/cc-native/_cc-native/lib-ts/.mocharc.json +9 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/aggregate-agents.test.ts +118 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/artifacts.test.ts +234 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/cc-native-state.test.ts +170 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/cli-output-parser.test.ts +73 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/config.test.ts +64 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/constants.test.ts +40 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/debug.test.ts +42 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/exports.test.ts +58 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/helpers.ts +107 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/hooks/add-plan-context.hook.test.ts +97 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/hooks/plan-questions.hook.test.ts +81 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/hooks/plan-review.hook.test.ts +71 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/json-parser.test.ts +99 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/orchestrator-agent.test.ts +288 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/orchestrator.test.ts +48 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/reviewers.test.ts +32 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/state.test.ts +124 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/verdict.test.ts +93 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/agent-selection.ts +163 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/aggregate-agents.ts +6 -14
- package/dist/templates/cc-native/_cc-native/{artifacts/lib → lib-ts/artifacts}/format.ts +597 -599
- package/dist/templates/cc-native/_cc-native/{artifacts/lib → lib-ts/artifacts}/index.ts +26 -26
- package/dist/templates/cc-native/_cc-native/{artifacts/lib → lib-ts/artifacts}/tracker.ts +106 -107
- package/dist/templates/cc-native/_cc-native/{artifacts/lib → lib-ts/artifacts}/write.ts +118 -119
- package/dist/templates/cc-native/_cc-native/lib-ts/artifacts.ts +21 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/cc-native-state.ts +17 -16
- package/dist/templates/cc-native/_cc-native/lib-ts/cli-output-parser.ts +132 -10
- package/dist/templates/cc-native/_cc-native/lib-ts/config.ts +1 -1
- package/dist/templates/cc-native/_cc-native/lib-ts/constants.ts +6 -6
- package/dist/templates/cc-native/_cc-native/lib-ts/corroboration.ts +119 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/debug.ts +2 -3
- package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/graduation.ts +132 -132
- package/dist/templates/cc-native/_cc-native/lib-ts/index.ts +88 -86
- package/dist/templates/cc-native/_cc-native/lib-ts/json-parser.ts +5 -6
- package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/orchestrator.ts +70 -70
- package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/output-builder.ts +130 -121
- package/dist/templates/cc-native/_cc-native/lib-ts/package-lock.json +1679 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/package.json +24 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/plan-discovery.ts +5 -5
- package/dist/templates/cc-native/_cc-native/lib-ts/plan-enhancement.ts +1 -6
- package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/plan-questions.ts +101 -101
- package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/review-pipeline.ts +511 -543
- package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/__tests__/agent-providers.test.ts +262 -0
- package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/reviewers/agent.ts +71 -85
- package/dist/templates/{_shared/lib-ts/agent-exec → cc-native/_cc-native/lib-ts/reviewers/base}/base-agent.ts +138 -150
- package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/reviewers/index.ts +12 -12
- package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/reviewers/providers/claude-agent.ts +66 -57
- package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/reviewers/providers/codex-agent.ts +185 -200
- package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/reviewers/providers/gemini-agent.ts +39 -40
- package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/reviewers/providers/orchestrator-claude-agent.ts +196 -225
- package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/reviewers/schemas.ts +201 -201
- package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/reviewers/types.ts +21 -23
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/__tests__/hyde.test.ts +365 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/__tests__/ollama-client.test.ts +223 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/embedding-indexer.ts +12 -16
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/hyde.ts +3 -2
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/index.ts +31 -31
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/logger.ts +7 -8
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/ollama-client.ts +7 -9
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/retrieval-pipeline.ts +16 -19
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/transcript-indexer.ts +37 -41
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/transcript-loader.ts +33 -43
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/transcript-searcher.ts +20 -20
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/types.ts +9 -10
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/vector-store.ts +3 -4
- package/dist/templates/cc-native/_cc-native/lib-ts/settings.ts +50 -126
- package/dist/templates/cc-native/_cc-native/lib-ts/state.ts +20 -22
- package/dist/templates/cc-native/_cc-native/lib-ts/tsconfig.json +2 -2
- package/dist/templates/cc-native/_cc-native/lib-ts/types.ts +14 -89
- package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/verdict.ts +72 -72
- package/dist/templates/cc-native/_cc-native/plan-review/CLAUDE.md +38 -1
- package/dist/templates/cc-native/_cc-native/plan-review/lib/__tests__/agent-selection.test.ts +345 -0
- package/dist/templates/cc-native/_cc-native/plan-review/lib/__tests__/preflight.test.ts +344 -0
- package/dist/templates/cc-native/_cc-native/plan-review/lib/agent-selection.ts +38 -16
- package/dist/templates/cc-native/_cc-native/plan-review/lib/preflight.ts +56 -26
- package/dist/templates/cc-native/_cc-native/scripts/council_debate.ts +242 -0
- package/dist/templates/cc-native/_cc-native/scripts/council_debate_simple.ts +294 -0
- package/dist/templates/cc-native/_cc-native/{plan-review/workflows → workflows}/specdev.md +9 -9
- package/dist/templates/core/.claude/skills/codex/SKILL.md +25 -0
- package/dist/templates/core/.claude/skills/devin/SKILL.md +25 -0
- package/dist/templates/core/.claude/skills/handoff/SKILL.md +11 -0
- package/dist/templates/core/.claude/skills/handoff-resume/SKILL.md +11 -0
- package/dist/templates/core/.claude/skills/meta-plan/SKILL.md +13 -0
- package/dist/templates/core/.codex/skills/codex/SKILL.md +13 -0
- package/dist/templates/core/.codex/skills/devin/SKILL.md +19 -0
- package/dist/templates/core/.codex/skills/handoff/SKILL.md +11 -0
- package/dist/templates/core/.codex/skills/handoff-resume/SKILL.md +11 -0
- package/dist/templates/core/.codex/skills/meta-plan/SKILL.md +13 -0
- package/dist/templates/core/.devin/AGENTS.md +5 -0
- package/dist/templates/core/.devin/config.json +12 -0
- package/dist/templates/core/.devin/skills/codex/SKILL.md +19 -0
- package/dist/templates/core/.devin/skills/devin/SKILL.md +13 -0
- package/dist/templates/core/.devin/skills/handoff/SKILL.md +11 -0
- package/dist/templates/core/.devin/skills/handoff-resume/SKILL.md +11 -0
- package/dist/templates/core/.devin/skills/meta-plan/SKILL.md +13 -0
- package/dist/templates/core/.windsurf/workflows/handoff-resume.md +9 -0
- package/dist/templates/{_shared → core}/.windsurf/workflows/handoff.md +1 -1
- package/dist/templates/{_shared → core}/.windsurf/workflows/meta-plan.md +1 -1
- package/dist/templates/core/hooks-ts/_utils/git-state.ts +2 -0
- package/dist/templates/{_shared → core}/hooks-ts/archive_plan.ts +15 -44
- package/dist/templates/core/hooks-ts/codex_explorer.ts +160 -0
- package/dist/templates/{_shared → core}/hooks-ts/context_monitor.ts +23 -55
- package/dist/templates/{_shared → core}/hooks-ts/file-suggestion.ts +5 -22
- package/dist/templates/{_shared → core}/hooks-ts/lint_after_edit.ts +7 -9
- package/dist/templates/core/hooks-ts/pre_compact.ts +36 -0
- package/dist/templates/{_shared → core}/hooks-ts/session_end.ts +38 -78
- package/dist/templates/{_shared → core}/hooks-ts/session_start.ts +5 -5
- package/dist/templates/core/hooks-ts/task_create_capture.ts +32 -0
- package/dist/templates/{_shared → core}/hooks-ts/task_update_capture.ts +9 -24
- package/dist/templates/core/hooks-ts/user_prompt_submit.ts +46 -0
- package/dist/templates/{_shared → core}/lib-ts/CLAUDE.md +27 -16
- package/dist/templates/{_shared → core}/lib-ts/context/CLAUDE.md +9 -6
- package/dist/templates/{_shared → core}/lib-ts/context/context-formatter.ts +16 -21
- package/dist/templates/{_shared → core}/lib-ts/context/context-selector.ts +8 -6
- package/dist/templates/{_shared → core}/lib-ts/context/context-store.ts +59 -20
- package/dist/templates/{_shared → core}/lib-ts/context/plan-manager.ts +19 -15
- package/dist/templates/{_shared → core}/lib-ts/context/task-tracker.ts +3 -3
- package/dist/templates/core/lib-ts/hooks/context-monitor-logic.ts +32 -0
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/hooks}/hook-utils.ts +179 -41
- package/dist/templates/core/lib-ts/hooks/prompt-binding-logic.ts +80 -0
- package/dist/templates/core/lib-ts/hooks/session-end-logic.ts +82 -0
- package/dist/templates/core/lib-ts/package.json +19 -0
- package/dist/templates/core/lib-ts/runtime/agent-launcher.ts +369 -0
- package/dist/templates/core/lib-ts/runtime/aiw-cli.ts +108 -0
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/atomic-write.ts +12 -7
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/cli-args.ts +24 -8
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/constants.ts +326 -324
- package/dist/templates/core/lib-ts/runtime/executable-policy.ts +89 -0
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/git-state.ts +6 -4
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/inference.ts +60 -23
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/lint-dispatch.ts +25 -23
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/logger.ts +32 -29
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/models.ts +9 -2
- package/dist/templates/core/lib-ts/runtime/platform-adapter.ts +33 -0
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/preflight.ts +4 -3
- package/dist/templates/core/lib-ts/runtime/sentinel-ipc.ts +91 -0
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/state-io.ts +20 -11
- package/dist/templates/core/lib-ts/runtime/stop-words.ts +185 -0
- package/dist/templates/core/lib-ts/runtime/subprocess-utils.ts +147 -0
- package/dist/templates/core/lib-ts/runtime/tmux-preflight.ts +93 -0
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/utils.ts +34 -4
- package/dist/templates/core/lib-ts/schemas.ts +233 -0
- package/dist/templates/{_shared → core}/lib-ts/templates/formatters.ts +7 -5
- package/dist/templates/{_shared → core}/lib-ts/templates/plan-context.ts +2 -1
- package/dist/templates/{_shared → core}/lib-ts/tsconfig.json +3 -1
- package/dist/templates/{_shared → core}/lib-ts/types.ts +78 -77
- package/dist/templates/core/scripts/resolve-run.ts +93 -0
- package/dist/templates/{_shared → core}/scripts/resolve_context.ts +3 -3
- package/dist/templates/{_shared → core}/scripts/status_line.ts +26 -21
- package/dist/templates/core/skills/codex/CLAUDE.md +83 -0
- package/dist/templates/{_shared → core}/skills/codex/SKILL.md +27 -18
- package/dist/templates/{_shared → core}/skills/codex/lib/codex-watcher.ts +79 -113
- package/dist/templates/{_shared → core}/skills/codex/scripts/launch-codex.ts +134 -148
- package/dist/templates/{_shared → core}/skills/codex/scripts/watch-codex.ts +6 -4
- package/dist/templates/core/skills/devin/CLAUDE.md +122 -0
- package/dist/templates/core/skills/devin/SKILL.md +73 -0
- package/dist/templates/core/skills/devin/lib/devin-watcher.ts +300 -0
- package/dist/templates/core/skills/devin/scripts/launch-devin.ts +258 -0
- package/dist/templates/{_shared → core}/skills/handoff-system/CLAUDE.md +436 -433
- package/dist/templates/{_shared → core}/skills/handoff-system/lib/document-generator.ts +9 -7
- package/dist/templates/{_shared → core}/skills/handoff-system/lib/handoff-reader.ts +6 -4
- package/dist/templates/{_shared → core}/skills/handoff-system/scripts/resume_handoff.ts +10 -8
- package/dist/templates/{_shared → core}/skills/handoff-system/scripts/save_handoff.ts +12 -10
- package/dist/templates/{_shared → core}/skills/handoff-system/workflows/handoff-resume.md +2 -2
- package/dist/templates/{_shared → core}/skills/handoff-system/workflows/handoff.md +6 -5
- package/dist/templates/{_shared → core}/skills/meta-plan/CLAUDE.md +2 -1
- package/dist/templates/{_shared → core}/skills/meta-plan/workflows/meta-plan.md +8 -7
- package/oclif.manifest.json +89 -13
- package/package.json +13 -12
- package/dist/lib/base-command.d.ts +0 -114
- package/dist/lib/base-command.js +0 -153
- package/dist/lib/env-compat.d.ts +0 -18
- package/dist/lib/env-compat.js +0 -23
- package/dist/lib/stdin.d.ts +0 -48
- package/dist/lib/stdin.js +0 -60
- package/dist/templates/_shared/.claude/settings.json +0 -120
- package/dist/templates/_shared/.claude/skills/codex/SKILL.md +0 -35
- package/dist/templates/_shared/.claude/skills/handoff/SKILL.md +0 -13
- package/dist/templates/_shared/.claude/skills/handoff-resume/SKILL.md +0 -13
- package/dist/templates/_shared/.claude/skills/meta-plan/SKILL.md +0 -43
- package/dist/templates/_shared/.codex/workflows/codex.md +0 -11
- package/dist/templates/_shared/.codex/workflows/handoff.md +0 -226
- package/dist/templates/_shared/.codex/workflows/meta-plan.md +0 -347
- package/dist/templates/_shared/hooks-ts/_utils/git-state.ts +0 -2
- package/dist/templates/_shared/hooks-ts/pre_compact.ts +0 -49
- package/dist/templates/_shared/hooks-ts/task_create_capture.ts +0 -48
- package/dist/templates/_shared/hooks-ts/user_prompt_submit.ts +0 -93
- package/dist/templates/_shared/lib-ts/agent-exec/backends/headless.ts +0 -33
- package/dist/templates/_shared/lib-ts/agent-exec/backends/index.ts +0 -6
- package/dist/templates/_shared/lib-ts/agent-exec/backends/tmux.ts +0 -119
- package/dist/templates/_shared/lib-ts/agent-exec/execution-backend.ts +0 -50
- package/dist/templates/_shared/lib-ts/agent-exec/index.ts +0 -6
- package/dist/templates/_shared/lib-ts/agent-exec/structured-output.ts +0 -166
- package/dist/templates/_shared/lib-ts/base/launchers/tmux-launcher.ts +0 -173
- package/dist/templates/_shared/lib-ts/base/launchers/window-launcher.ts +0 -93
- package/dist/templates/_shared/lib-ts/base/launchers/wt-launcher.ts +0 -64
- package/dist/templates/_shared/lib-ts/base/pane-launcher.ts +0 -55
- package/dist/templates/_shared/lib-ts/base/sentinel-ipc.ts +0 -87
- package/dist/templates/_shared/lib-ts/base/stop-words.ts +0 -184
- package/dist/templates/_shared/lib-ts/base/subprocess-utils.ts +0 -249
- package/dist/templates/_shared/lib-ts/base/tmux-driver.ts +0 -341
- package/dist/templates/_shared/lib-ts/base/tmux-pane-placement.ts +0 -78
- package/dist/templates/_shared/lib-ts/package.json +0 -20
- package/dist/templates/_shared/scripts/resolve-run.ts +0 -62
- package/dist/templates/_shared/skills/codex/CLAUDE.md +0 -70
- package/dist/templates/cc-native/_cc-native/CLAUDE.md +0 -73
- package/dist/templates/cc-native/_cc-native/artifacts/CLAUDE.md +0 -64
- package/dist/templates/cc-native/_cc-native/lib-ts/CLAUDE.md +0 -70
- package/dist/templates/cc-native/_cc-native/plan-review/CODING-STANDARDS-CHECKLIST.md +0 -75
- package/dist/templates/cc-native/_cc-native/plan-review/agents/CLAUDE.md +0 -143
- package/dist/templates/cc-native/_cc-native/plan-review/agents/PLAN-ORCHESTRATOR.md +0 -213
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-questions/PLAN-QUESTIONER.md +0 -70
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/ARCH-EVOLUTION.md +0 -62
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/ARCH-PATTERNS.md +0 -61
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/ARCH-STRUCTURE.md +0 -62
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/ASSUMPTION-TRACER.md +0 -56
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/CLARITY-AUDITOR.md +0 -53
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/COMPLETENESS-FEASIBILITY.md +0 -66
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/COMPLETENESS-GAPS.md +0 -70
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/COMPLETENESS-ORDERING.md +0 -62
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/CONSTRAINT-VALIDATOR.md +0 -72
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/DESIGN-ADR-VALIDATOR.md +0 -61
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/DESIGN-SCALE-MATCHER.md +0 -64
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/DEVILS-ADVOCATE.md +0 -56
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/DOCUMENTATION-PHILOSOPHY.md +0 -86
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/HANDOFF-READINESS.md +0 -59
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/HIDDEN-COMPLEXITY.md +0 -58
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/INCREMENTAL-DELIVERY.md +0 -66
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/RISK-DEPENDENCY.md +0 -62
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/RISK-FMEA.md +0 -66
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/RISK-PREMORTEM.md +0 -71
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/RISK-REVERSIBILITY.md +0 -74
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/SCOPE-BOUNDARY.md +0 -77
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/SIMPLICITY-GUARDIAN.md +0 -62
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/SKEPTIC.md +0 -68
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TESTDRIVEN-BEHAVIOR-AUDITOR.md +0 -61
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TESTDRIVEN-CHARACTERIZATION.md +0 -71
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TESTDRIVEN-FIRST-VALIDATOR.md +0 -61
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TESTDRIVEN-PYRAMID-ANALYZER.md +0 -61
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TRADEOFF-COSTS.md +0 -67
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TRADEOFF-STAKEHOLDERS.md +0 -65
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/VERIFY-COVERAGE.md +0 -74
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/VERIFY-STRENGTH.md +0 -69
- package/dist/templates/cc-native/_cc-native/plan-review/lib/corroboration.ts +0 -172
- package/dist/templates/cc-native/_cc-native/plan-review/lib/reviewers/base/base-agent.ts +0 -7
package/README.md
CHANGED
|
@@ -1,1242 +1,226 @@
|
|
|
1
|
-
AIW CLI
|
|
2
|
-
=========================================
|
|
1
|
+
# AIW CLI
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[](https://oclif.io)
|
|
8
|
-
[](https://npmjs.org/package/aiwcli)
|
|
9
|
-
[](https://npmjs.org/package/aiwcli)
|
|
10
|
-
|
|
11
|
-
## Installation
|
|
12
|
-
|
|
13
|
-
### Install from npm (Recommended)
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
# Install globally from npm
|
|
17
|
-
npm install -g aiwcli
|
|
18
|
-
|
|
19
|
-
# Verify installation
|
|
20
|
-
aiw --version
|
|
21
|
-
aiw --help
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### What's Included
|
|
25
|
-
|
|
26
|
-
aiwcli v0.9.0 includes:
|
|
27
|
-
|
|
28
|
-
- **CLI Commands**: `launch`, `init`, `branch`, `clean`, `clear`
|
|
29
|
-
- **Templates**:
|
|
30
|
-
- **cc-native** - Event-sourced context management with plan review, 25+ specialized agents
|
|
31
|
-
- **_shared** - Common utilities (context manager, event logging, task sync)
|
|
32
|
-
- **IDE Support**: Claude Code, Windsurf, Codex
|
|
33
|
-
|
|
34
|
-
After installation, run `aiw init --method cc-native` to set up the template in your project.
|
|
3
|
+
CLI package for launching and managing Claude Code with AIW hooks and configuration.
|
|
35
4
|
|
|
36
5
|
## Commands
|
|
37
6
|
|
|
38
|
-
AIW CLI provides the following commands:
|
|
39
|
-
|
|
40
7
|
### `aiw launch`
|
|
41
|
-
|
|
8
|
+
|
|
9
|
+
Launch Claude Code with AIW configuration (sandbox disabled, tmux-first when outside tmux).
|
|
42
10
|
|
|
43
11
|
```bash
|
|
44
12
|
aiw launch
|
|
45
|
-
aiw launch --debug
|
|
46
|
-
aiw launch --quiet
|
|
47
|
-
aiw launch --no-tmux
|
|
48
|
-
aiw launch --tmux-session aiw-main # Reuse
|
|
13
|
+
aiw launch --debug # Enable verbose logging
|
|
14
|
+
aiw launch --quiet # Suppress informational output
|
|
15
|
+
aiw launch --no-tmux # Bypass tmux auto-launch
|
|
16
|
+
aiw launch --tmux-session aiw-main # Reuse a named tmux session
|
|
49
17
|
```
|
|
50
18
|
|
|
51
|
-
|
|
19
|
+
Creates a fresh tmux session by default when auto-launching. On Windows (outside tmux), opens a new mintty window first.
|
|
52
20
|
|
|
53
|
-
|
|
21
|
+
Aliases:
|
|
54
22
|
|
|
55
23
|
```bash
|
|
56
24
|
alias codex='aiw launch --codex'
|
|
25
|
+
alias devin='aiw launch --devin'
|
|
57
26
|
```
|
|
58
27
|
|
|
59
28
|
### `aiw init`
|
|
60
|
-
|
|
29
|
+
|
|
30
|
+
Initialize AIW templates in a project.
|
|
61
31
|
|
|
62
32
|
```bash
|
|
63
|
-
aiw init --interactive #
|
|
33
|
+
aiw init --interactive # Interactive setup wizard
|
|
64
34
|
aiw init --method cc-native # Initialize CC-Native template
|
|
65
35
|
aiw init --method cc-native --ide windsurf # Install for Windsurf
|
|
66
|
-
aiw init --method cc-native --ide claude --ide windsurf #
|
|
36
|
+
aiw init --method cc-native --ide claude --ide windsurf # Multiple IDEs
|
|
67
37
|
```
|
|
68
38
|
|
|
69
39
|
### `aiw branch <branchName>`
|
|
70
|
-
Create git worktree in sibling folder and auto-launch Claude Code.
|
|
71
40
|
|
|
72
|
-
|
|
73
|
-
1. Creating a new git worktree with the specified branch name
|
|
74
|
-
2. Creating a sibling folder with suffix pattern (e.g., `aiwcli` → `aiwcli-feature-name`)
|
|
75
|
-
3. Opening a new terminal window at the worktree path
|
|
76
|
-
4. Automatically running `aiw launch` in that terminal
|
|
41
|
+
Create git worktree in sibling folder and auto-launch Claude Code.
|
|
77
42
|
|
|
78
43
|
```bash
|
|
79
44
|
aiw branch feature-name # Creates ../aiwcli-feature-name worktree
|
|
80
45
|
aiw branch fix-bug-123 # Creates ../aiwcli-fix-bug-123 worktree
|
|
81
|
-
aiw branch experiment # Creates ../aiwcli-experiment worktree
|
|
82
46
|
```
|
|
83
47
|
|
|
84
|
-
|
|
85
|
-
- Must be run from a git repository root
|
|
86
|
-
- Target folder must not already exist
|
|
87
|
-
- Branch name must not already exist
|
|
88
|
-
|
|
89
|
-
**Exit codes:**
|
|
90
|
-
- `0` - Success: Worktree created and terminal launched
|
|
91
|
-
- `1` - General error: Unexpected failure
|
|
92
|
-
- `2` - Invalid usage: Invalid branch name, folder exists, or not in git repo
|
|
93
|
-
- `3` - Environment error: Git not available
|
|
94
|
-
|
|
95
|
-
## Requirements
|
|
96
|
-
|
|
97
|
-
**Minimum Claude Code Version:** 0.1.0 or later
|
|
98
|
-
|
|
99
|
-
AIW CLI automatically detects your Claude Code version and warns if incompatibilities are detected. The CLI will continue to launch even with version warnings (graceful degradation).
|
|
100
|
-
|
|
101
|
-
### Known Incompatible Versions
|
|
102
|
-
|
|
103
|
-
- **0.0.9** - Has known issues with AIW CLI integration
|
|
48
|
+
Requirements: must be in a git repo root, target folder/branch must not exist.
|
|
104
49
|
|
|
105
|
-
|
|
50
|
+
### `aiw clean` / `aiw clear`
|
|
106
51
|
|
|
107
52
|
```bash
|
|
108
|
-
#
|
|
109
|
-
|
|
53
|
+
aiw clean # Remove _output/
|
|
54
|
+
aiw clean --method cc-native # One method
|
|
55
|
+
aiw clean --all # Everything
|
|
56
|
+
aiw clear # Full uninstall (workflow folders, output, IDE config)
|
|
110
57
|
```
|
|
111
58
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
### Windows Setup: Symlink Permission Denied
|
|
115
|
-
|
|
116
|
-
**Symptom:** `aiw init` fails with "Permission denied creating symlink" or "EPERM: operation not permitted"
|
|
59
|
+
---
|
|
117
60
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
**Option 1: Enable Developer Mode (Recommended)**
|
|
121
|
-
1. Open Windows Settings
|
|
122
|
-
2. Go to "Privacy & Security" → "For developers"
|
|
123
|
-
3. Enable "Developer Mode"
|
|
124
|
-
4. Run `aiw init` again
|
|
61
|
+
## Requirements
|
|
125
62
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
63
|
+
- Claude Code 0.1.0+
|
|
64
|
+
- Node.js 18+
|
|
65
|
+
- Bun (for TypeScript hooks)
|
|
66
|
+
- Git
|
|
129
67
|
|
|
130
|
-
|
|
68
|
+
---
|
|
131
69
|
|
|
132
|
-
|
|
70
|
+
## Troubleshooting
|
|
133
71
|
|
|
134
|
-
|
|
72
|
+
### Windows: Symlink Permission Denied
|
|
135
73
|
|
|
136
|
-
|
|
137
|
-
1. Check your current Claude Code version: `claude --version`
|
|
138
|
-
2. Upgrade to version 0.1.0 or later (see above)
|
|
139
|
-
3. If version cannot be detected, ensure Claude Code is installed and in your PATH
|
|
74
|
+
`aiw init` fails with EPERM:
|
|
140
75
|
|
|
141
|
-
**
|
|
76
|
+
1. **Developer Mode** (recommended): Settings > Privacy & Security > For developers > Enable
|
|
77
|
+
2. **Or** run as Administrator
|
|
142
78
|
|
|
143
|
-
|
|
79
|
+
### Version Compatibility
|
|
144
80
|
|
|
145
81
|
```bash
|
|
146
|
-
aiw launch --debug
|
|
82
|
+
aiw launch --debug # See version info
|
|
83
|
+
claude --version # Check Claude Code version
|
|
147
84
|
```
|
|
148
85
|
|
|
149
|
-
|
|
150
|
-
- Resolved AIW_DIR path
|
|
151
|
-
- Claude Code version detection
|
|
152
|
-
- Compatibility check results
|
|
153
|
-
- Spawn arguments and configuration
|
|
86
|
+
Known incompatible: v0.0.9. Upgrade with `npm install -g @anthropic-ai/claude-code@latest`.
|
|
154
87
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
If `claude --version` fails or hangs:
|
|
158
|
-
- Verify Claude Code is installed: `which claude` (Unix) or `where claude` (Windows)
|
|
159
|
-
- Check PATH includes Claude Code installation directory
|
|
160
|
-
- Reinstall Claude Code if necessary
|
|
161
|
-
|
|
162
|
-
AIW CLI assumes compatibility if version cannot be determined and will proceed with launch.
|
|
88
|
+
---
|
|
163
89
|
|
|
164
90
|
## Environment Variables
|
|
165
91
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
92
|
+
| Variable | Purpose |
|
|
93
|
+
|----------|---------|
|
|
94
|
+
| `AIW_DIR` | Custom AIW config directory (default: `~/.aiw`) |
|
|
95
|
+
| `NO_COLOR` | Disable colored output |
|
|
96
|
+
| `FORCE_COLOR` | Force colors even outside TTY (`1`=basic, `2`=256, `3`=truecolor) |
|
|
169
97
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
```bash
|
|
173
|
-
# Disable all colors
|
|
174
|
-
NO_COLOR=1 aiw launch
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
### FORCE_COLOR
|
|
178
|
-
|
|
179
|
-
Forces colored output even when not in a TTY (terminal). Useful for CI environments that support colors.
|
|
180
|
-
|
|
181
|
-
```bash
|
|
182
|
-
# Force colors (level 1 = basic 16 colors)
|
|
183
|
-
FORCE_COLOR=1 aiw launch | less -R
|
|
184
|
-
|
|
185
|
-
# Force 256 colors
|
|
186
|
-
FORCE_COLOR=2 aiw launch
|
|
187
|
-
|
|
188
|
-
# Force truecolor (16 million colors)
|
|
189
|
-
FORCE_COLOR=3 aiw launch
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
### AIW_DIR
|
|
193
|
-
|
|
194
|
-
Customize the AIW configuration directory (default: `~/.aiw`):
|
|
195
|
-
|
|
196
|
-
```bash
|
|
197
|
-
AIW_DIR=/custom/path aiw launch
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
## Output Behavior
|
|
201
|
-
|
|
202
|
-
AIW CLI automatically adapts its output based on the execution context:
|
|
203
|
-
|
|
204
|
-
### Interactive Terminal (TTY)
|
|
205
|
-
- Colors enabled
|
|
206
|
-
- Progress spinners shown
|
|
207
|
-
- Rich formatting
|
|
208
|
-
|
|
209
|
-
### Piped or Redirected Output
|
|
210
|
-
- Colors automatically disabled
|
|
211
|
-
- Spinners suppressed
|
|
212
|
-
- Clean, parseable text output
|
|
213
|
-
|
|
214
|
-
```bash
|
|
215
|
-
# Example: Piping to other commands
|
|
216
|
-
aiw launch --help | grep "OPTIONS"
|
|
217
|
-
|
|
218
|
-
# Example: Redirecting to file
|
|
219
|
-
aiw launch --help > help.txt
|
|
220
|
-
|
|
221
|
-
# Example: Processing with tools
|
|
222
|
-
aiw launch 2>&1 | tee output.log
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
This automatic behavior ensures AIW CLI works seamlessly in both interactive use and automation scripts without requiring manual configuration.
|
|
226
|
-
|
|
227
|
-
### Quiet Mode
|
|
228
|
-
|
|
229
|
-
For scripting and automation where you want minimal output, use the `--quiet` (or `-q`) flag to suppress informational messages while preserving errors:
|
|
230
|
-
|
|
231
|
-
```bash
|
|
232
|
-
# Suppress informational output
|
|
233
|
-
aiw launch --quiet
|
|
234
|
-
|
|
235
|
-
# Short form
|
|
236
|
-
aiw launch -q
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
**What Gets Suppressed:**
|
|
240
|
-
- Informational messages (`logInfo`)
|
|
241
|
-
- Success messages (`logSuccess`)
|
|
242
|
-
- Warning messages (`logWarning`)
|
|
243
|
-
- Progress spinners
|
|
244
|
-
|
|
245
|
-
**What's Always Shown:**
|
|
246
|
-
- Error messages (stderr) - critical for debugging failures
|
|
247
|
-
- Essential data output (stdout) - for parsing in scripts
|
|
248
|
-
|
|
249
|
-
**Example Usage:**
|
|
250
|
-
|
|
251
|
-
```bash
|
|
252
|
-
# Silent execution in scripts
|
|
253
|
-
aiw launch --quiet
|
|
254
|
-
EXIT_CODE=$?
|
|
255
|
-
if [ $EXIT_CODE -ne 0 ]; then
|
|
256
|
-
echo "Launch failed with code $EXIT_CODE"
|
|
257
|
-
fi
|
|
258
|
-
|
|
259
|
-
# Combine with piping
|
|
260
|
-
aiw launch --quiet 2>&1 | tee log.txt
|
|
261
|
-
|
|
262
|
-
# CI/CD pipelines
|
|
263
|
-
aiw launch --quiet || exit 1
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
**Quiet Mode vs. Piping:**
|
|
267
|
-
- **Piping**: Automatically disables colors and spinners
|
|
268
|
-
- **Quiet Mode**: Explicitly suppresses informational text
|
|
269
|
-
- **Combined**: Minimal clean output for scripting
|
|
270
|
-
|
|
271
|
-
## Command Chaining
|
|
272
|
-
|
|
273
|
-
AIW CLI is designed for seamless integration into command chains and pipelines, enabling complex automation workflows.
|
|
274
|
-
|
|
275
|
-
### Chaining with && (Success Chains)
|
|
276
|
-
|
|
277
|
-
Commands can be chained using `&&` to execute multiple operations sequentially, stopping at the first failure:
|
|
278
|
-
|
|
279
|
-
```bash
|
|
280
|
-
# Execute multiple commands - stops if any fails
|
|
281
|
-
aiw launch --help && aiw init --help
|
|
282
|
-
|
|
283
|
-
# Chain with other tools
|
|
284
|
-
aiw launch --help && echo "Launch command is available"
|
|
285
|
-
|
|
286
|
-
# Complex chains
|
|
287
|
-
aiw init && aiw launch --quiet && echo "Setup and launch complete"
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
**How It Works:**
|
|
291
|
-
- Exit code `0` (success) → chain continues to next command
|
|
292
|
-
- Exit code `1/2/3` (error) → chain stops, subsequent commands don't run
|
|
293
|
-
- Errors always output to stderr for visibility
|
|
294
|
-
|
|
295
|
-
### Piping Output
|
|
296
|
-
|
|
297
|
-
AIW CLI produces clean stdout that works seamlessly with standard Unix tools:
|
|
298
|
-
|
|
299
|
-
```bash
|
|
300
|
-
# Pipe to grep, awk, jq, etc.
|
|
301
|
-
aiw launch --help | grep "Launch"
|
|
302
|
-
|
|
303
|
-
# Combine quiet mode for cleanest output
|
|
304
|
-
aiw launch --help --quiet | wc -l
|
|
305
|
-
|
|
306
|
-
# Multi-stage pipelines
|
|
307
|
-
aiw launch --help | grep "flags" | sort
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
**Output Separation:**
|
|
311
|
-
- **stdout**: Data only (help text, command output)
|
|
312
|
-
- **stderr**: Errors and warnings only
|
|
313
|
-
- **Status messages**: Automatically suppressed when piped
|
|
314
|
-
|
|
315
|
-
### Cross-Platform Compatibility
|
|
316
|
-
|
|
317
|
-
**Windows PowerShell:**
|
|
318
|
-
```powershell
|
|
319
|
-
# && chains work in PowerShell 7+
|
|
320
|
-
aiw launch --help && echo "Success"
|
|
321
|
-
|
|
322
|
-
# Pipes work universally
|
|
323
|
-
aiw launch --help | Select-String "Launch"
|
|
324
|
-
|
|
325
|
-
# Legacy CMD/PowerShell 5.1 uses semicolon for sequential execution
|
|
326
|
-
aiw launch --help; echo "Runs regardless of success"
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
**Unix/macOS (Bash/Zsh):**
|
|
330
|
-
```bash
|
|
331
|
-
# Standard && chaining
|
|
332
|
-
aiw launch --help && echo "Success"
|
|
333
|
-
|
|
334
|
-
# Standard piping
|
|
335
|
-
aiw launch --help | grep "Launch"
|
|
336
|
-
|
|
337
|
-
# Complex pipelines
|
|
338
|
-
aiw launch --help | grep "flags" | awk '{print $1}'
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
### Practical Examples
|
|
342
|
-
|
|
343
|
-
**CI/CD Pipelines:**
|
|
344
|
-
```bash
|
|
345
|
-
# Stop pipeline on first failure
|
|
346
|
-
aiw init && aiw launch --quiet && other-command || exit 1
|
|
347
|
-
```
|
|
348
|
-
|
|
349
|
-
**Scripting with Error Handling:**
|
|
350
|
-
```bash
|
|
351
|
-
#!/bin/bash
|
|
352
|
-
if aiw launch --quiet; then
|
|
353
|
-
echo "Launch succeeded"
|
|
354
|
-
else
|
|
355
|
-
echo "Launch failed with code $?" >&2
|
|
356
|
-
exit 1
|
|
357
|
-
fi
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
**Data Processing:**
|
|
361
|
-
```bash
|
|
362
|
-
# Extract and process help text
|
|
363
|
-
aiw launch --help --quiet | grep -E "^ -" | sort
|
|
364
|
-
```
|
|
98
|
+
---
|
|
365
99
|
|
|
366
100
|
## Exit Codes
|
|
367
101
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
|
373
|
-
|
|
374
|
-
| `0` | Success | Command completed successfully without errors |
|
|
375
|
-
| `1` | General Error | Unexpected runtime failures, system errors, unhandled exceptions |
|
|
376
|
-
| `2` | Invalid Usage | Invalid arguments, unknown flags, missing required parameters |
|
|
377
|
-
| `3` | Environment Error | Missing prerequisites (Claude Code not installed, AIW_DIR not found, permission denied) |
|
|
378
|
-
|
|
379
|
-
### Checking Exit Codes
|
|
380
|
-
|
|
381
|
-
**Bash / Zsh (Unix, macOS, Linux, Git Bash, WSL):**
|
|
382
|
-
|
|
383
|
-
```bash
|
|
384
|
-
# Check last command's exit code
|
|
385
|
-
aiw launch
|
|
386
|
-
echo $? # 0 = success, non-zero = error
|
|
387
|
-
|
|
388
|
-
# Conditional execution with &&
|
|
389
|
-
aiw launch && echo "Success!"
|
|
390
|
-
|
|
391
|
-
# Fallback with ||
|
|
392
|
-
aiw launch || echo "Failed with code $?"
|
|
393
|
-
|
|
394
|
-
# Store and check exit code
|
|
395
|
-
aiw launch
|
|
396
|
-
EXIT_CODE=$?
|
|
397
|
-
if [ $EXIT_CODE -eq 0 ]; then
|
|
398
|
-
echo "Launch succeeded"
|
|
399
|
-
elif [ $EXIT_CODE -eq 3 ]; then
|
|
400
|
-
echo "Environment error - run 'aiw init' or install Claude Code"
|
|
401
|
-
else
|
|
402
|
-
echo "Command failed with exit code $EXIT_CODE"
|
|
403
|
-
fi
|
|
404
|
-
|
|
405
|
-
# Chain commands (stops on first failure)
|
|
406
|
-
aiw init && aiw launch && echo "All commands succeeded"
|
|
407
|
-
```
|
|
408
|
-
|
|
409
|
-
**PowerShell (Windows):**
|
|
410
|
-
|
|
411
|
-
```powershell
|
|
412
|
-
# Check last command's exit code
|
|
413
|
-
aiw launch
|
|
414
|
-
echo $LASTEXITCODE # 0 = success, non-zero = error
|
|
415
|
-
|
|
416
|
-
# Conditional execution
|
|
417
|
-
aiw launch
|
|
418
|
-
if ($LASTEXITCODE -eq 0) {
|
|
419
|
-
Write-Host "Success!"
|
|
420
|
-
} elseif ($LASTEXITCODE -eq 3) {
|
|
421
|
-
Write-Host "Environment error - run 'aiw init' or install Claude Code"
|
|
422
|
-
} else {
|
|
423
|
-
Write-Host "Failed with exit code $LASTEXITCODE"
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
# Throw on error
|
|
427
|
-
$ErrorActionPreference = "Stop"
|
|
428
|
-
aiw launch # Will throw exception if exit code is non-zero
|
|
429
|
-
|
|
430
|
-
# Continue on error but check result
|
|
431
|
-
$ErrorActionPreference = "Continue"
|
|
432
|
-
aiw launch
|
|
433
|
-
if ($LASTEXITCODE -ne 0) {
|
|
434
|
-
Write-Error "Launch failed"
|
|
435
|
-
exit $LASTEXITCODE
|
|
436
|
-
}
|
|
437
|
-
```
|
|
438
|
-
|
|
439
|
-
**CMD (Windows):**
|
|
440
|
-
|
|
441
|
-
```cmd
|
|
442
|
-
REM Check exit code with %ERRORLEVEL%
|
|
443
|
-
aiw launch
|
|
444
|
-
echo %ERRORLEVEL%
|
|
445
|
-
|
|
446
|
-
REM Conditional execution with &&
|
|
447
|
-
aiw init && aiw launch && echo Success!
|
|
448
|
-
|
|
449
|
-
REM Check exit code in batch script
|
|
450
|
-
aiw launch
|
|
451
|
-
if %ERRORLEVEL% EQU 0 (
|
|
452
|
-
echo Success
|
|
453
|
-
) else if %ERRORLEVEL% EQU 3 (
|
|
454
|
-
echo Environment error
|
|
455
|
-
) else (
|
|
456
|
-
echo Failed with code %ERRORLEVEL%
|
|
457
|
-
)
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
### Common Exit Code Scenarios
|
|
461
|
-
|
|
462
|
-
**Success (0):**
|
|
463
|
-
- Help displayed: `aiwlaunch --help`
|
|
464
|
-
- Setup completed successfully: `aiw init`
|
|
465
|
-
- Claude Code launched and exited normally: `aiwlaunch`
|
|
466
|
-
|
|
467
|
-
**General Error (1):**
|
|
468
|
-
- Unexpected runtime failures
|
|
469
|
-
- Network errors during operation
|
|
470
|
-
- File system errors (other than missing prerequisites)
|
|
471
|
-
- Unknown/unhandled exceptions
|
|
472
|
-
|
|
473
|
-
**Invalid Usage (2):**
|
|
474
|
-
- Unknown flag: `aiwlaunch --invalid-flag`
|
|
475
|
-
- Unknown command: `aiwinvalid-command`
|
|
476
|
-
- Missing required argument: `aiw init` (without --method arg)
|
|
477
|
-
- Conflicting options
|
|
478
|
-
|
|
479
|
-
**Environment Error (3):**
|
|
480
|
-
- Claude Code not installed: `aiwlaunch` (when `claude` not in PATH)
|
|
481
|
-
- AIW_DIR not found: `aiw init` (when ~/.aiw doesn't exist and AIW_DIR not set)
|
|
482
|
-
- Permission denied: `aiw init` (on Windows without Developer Mode or admin rights)
|
|
483
|
-
- Version incompatibility blocking operation
|
|
484
|
-
|
|
485
|
-
### Exit Codes in CI/CD
|
|
486
|
-
|
|
487
|
-
Exit codes enable reliable automation in continuous integration and deployment pipelines:
|
|
488
|
-
|
|
489
|
-
```yaml
|
|
490
|
-
# GitHub Actions example
|
|
491
|
-
- name: Launch AIW
|
|
492
|
-
run: aiw launch
|
|
493
|
-
# Automatically fails workflow on non-zero exit
|
|
494
|
-
|
|
495
|
-
# With custom error handling
|
|
496
|
-
- name: Launch AIW with fallback
|
|
497
|
-
run: |
|
|
498
|
-
aiw launch || {
|
|
499
|
-
EXIT_CODE=$?
|
|
500
|
-
if [ $EXIT_CODE -eq 3 ]; then
|
|
501
|
-
echo "Environment setup needed"
|
|
502
|
-
exit 1
|
|
503
|
-
fi
|
|
504
|
-
exit $EXIT_CODE
|
|
505
|
-
}
|
|
506
|
-
```
|
|
507
|
-
|
|
508
|
-
### Getting Help on Exit Codes
|
|
509
|
-
|
|
510
|
-
Every command documents its exit codes in help text:
|
|
102
|
+
| Code | Meaning |
|
|
103
|
+
|------|---------|
|
|
104
|
+
| `0` | Success |
|
|
105
|
+
| `1` | General error (runtime failures) |
|
|
106
|
+
| `2` | Invalid usage (bad args/flags) |
|
|
107
|
+
| `3` | Environment error (missing prerequisites, permissions) |
|
|
511
108
|
|
|
512
|
-
|
|
513
|
-
aiw launch --help # See EXIT CODES section
|
|
514
|
-
aiw init --help # See EXIT CODES section
|
|
515
|
-
```
|
|
109
|
+
---
|
|
516
110
|
|
|
517
111
|
## Shell Completion
|
|
518
112
|
|
|
519
|
-
AIW CLI supports tab completion for commands, subcommands, and flags in Bash, Zsh, and PowerShell.
|
|
520
|
-
|
|
521
|
-
### Installation
|
|
522
|
-
|
|
523
|
-
**Bash**
|
|
524
|
-
|
|
525
|
-
Add to your `~/.bashrc`:
|
|
526
|
-
|
|
527
113
|
```bash
|
|
114
|
+
# Bash -- add to ~/.bashrc
|
|
528
115
|
eval "$(aiw autocomplete:script bash)"
|
|
529
|
-
```
|
|
530
116
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
```bash
|
|
534
|
-
printf "eval \"\$(aiw autocomplete:script bash)\"" >> ~/.bashrc && source ~/.bashrc
|
|
535
|
-
```
|
|
536
|
-
|
|
537
|
-
**Note:** If your terminal starts as a login shell, modify `~/.bash_profile` or `~/.profile` instead:
|
|
538
|
-
|
|
539
|
-
```bash
|
|
540
|
-
printf "eval \"\$(aiw autocomplete:script bash)\"" >> ~/.bash_profile && source ~/.bash_profile
|
|
541
|
-
```
|
|
542
|
-
|
|
543
|
-
**Zsh**
|
|
544
|
-
|
|
545
|
-
Add to your `~/.zshrc`:
|
|
546
|
-
|
|
547
|
-
```bash
|
|
117
|
+
# Zsh -- add to ~/.zshrc
|
|
548
118
|
eval "$(aiw autocomplete:script zsh)"
|
|
549
|
-
```
|
|
550
|
-
|
|
551
|
-
Or run this one-liner:
|
|
552
|
-
|
|
553
|
-
```bash
|
|
554
|
-
printf "eval \"\$(aiw autocomplete:script zsh)\"" >> ~/.zshrc && source ~/.zshrc
|
|
555
|
-
```
|
|
556
|
-
|
|
557
|
-
**PowerShell**
|
|
558
119
|
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
```powershell
|
|
120
|
+
# PowerShell
|
|
562
121
|
aiw autocomplete powershell
|
|
563
|
-
```
|
|
564
|
-
|
|
565
|
-
The command will provide platform-specific setup instructions. Typically:
|
|
566
|
-
|
|
567
|
-
```powershell
|
|
568
|
-
# Create profile directory if it doesn't exist
|
|
569
|
-
New-Item -Type Directory -Path (Split-Path -Parent $PROFILE) -ErrorAction SilentlyContinue
|
|
570
|
-
|
|
571
|
-
# Add autocomplete to profile and reload
|
|
572
|
-
Add-Content -Path $PROFILE -Value (Invoke-Expression -Command "aiw autocomplete script powershell"); .$PROFILE
|
|
573
|
-
```
|
|
574
|
-
|
|
575
|
-
**Optional**: Enable menu-style completion in PowerShell:
|
|
576
|
-
|
|
577
|
-
```powershell
|
|
578
|
-
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
|
|
579
|
-
```
|
|
580
|
-
|
|
581
|
-
### Usage
|
|
582
|
-
|
|
583
|
-
After installation, you can use tab completion:
|
|
584
|
-
|
|
585
|
-
```bash
|
|
586
|
-
# Command completion
|
|
587
|
-
aiw la<TAB> # Completes to "aiw launch"
|
|
588
|
-
|
|
589
|
-
# Subcommand completion (when available)
|
|
590
|
-
aiw init <TAB> # Shows available subcommands
|
|
591
|
-
|
|
592
|
-
# Flag completion
|
|
593
|
-
aiw launch --<TAB> # Shows available flags
|
|
594
|
-
|
|
595
|
-
# Command listing
|
|
596
|
-
aiw <TAB> # Shows all available commands
|
|
597
|
-
```
|
|
598
122
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
**Bash**
|
|
602
|
-
|
|
603
|
-
If completion doesn't work:
|
|
604
|
-
- Check if `~/.bashrc` is sourced (may need `~/.bash_profile` for login shells)
|
|
605
|
-
- Verify completion script loaded: `type _aiw_completion`
|
|
606
|
-
- Restart your shell: `exec bash`
|
|
607
|
-
|
|
608
|
-
**Zsh**
|
|
609
|
-
|
|
610
|
-
If completion doesn't work:
|
|
611
|
-
- Check permissions: `compaudit -D`
|
|
612
|
-
- Rebuild completion cache: `rm ~/.zcompdump* && compinit`
|
|
613
|
-
- Restart your shell: `exec zsh`
|
|
614
|
-
|
|
615
|
-
**PowerShell**
|
|
616
|
-
|
|
617
|
-
If completion doesn't work:
|
|
618
|
-
- Check execution policy: `Get-ExecutionPolicy`
|
|
619
|
-
- May need: `Set-ExecutionPolicy RemoteSigned -Scope CurrentUser`
|
|
620
|
-
- Restart PowerShell
|
|
621
|
-
|
|
622
|
-
**Refresh Completion Cache**
|
|
623
|
-
|
|
624
|
-
If commands or flags change after updates:
|
|
625
|
-
|
|
626
|
-
```bash
|
|
123
|
+
# Refresh cache after updates
|
|
627
124
|
aiw autocomplete --refresh-cache
|
|
628
125
|
```
|
|
629
126
|
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
```bash
|
|
633
|
-
aiw autocomplete -r
|
|
634
|
-
```
|
|
635
|
-
|
|
636
|
-
## Scripting Examples
|
|
637
|
-
|
|
638
|
-
AIW CLI is designed for seamless integration into automation scripts, shell pipelines, and CI/CD workflows. All examples work on Windows (PowerShell/CMD/Git Bash), macOS, and Linux.
|
|
639
|
-
|
|
640
|
-
### Basic Piping
|
|
641
|
-
|
|
642
|
-
Pipe AIW CLI output to standard Unix tools for filtering and processing:
|
|
643
|
-
|
|
644
|
-
```bash
|
|
645
|
-
# Search help for specific command
|
|
646
|
-
aiw --help | grep "launch"
|
|
647
|
-
|
|
648
|
-
# Find all available flags
|
|
649
|
-
aiw launch --help | grep -E "^ -"
|
|
650
|
-
|
|
651
|
-
# Extract version number
|
|
652
|
-
aiw --version | cut -d' ' -f2
|
|
653
|
-
|
|
654
|
-
# Count lines of output
|
|
655
|
-
aiw --help | wc -l
|
|
656
|
-
```
|
|
657
|
-
|
|
658
|
-
**PowerShell equivalent:**
|
|
659
|
-
```powershell
|
|
660
|
-
# Search help
|
|
661
|
-
aiw --help | Select-String "launch"
|
|
662
|
-
|
|
663
|
-
# Find flags
|
|
664
|
-
aiw launch --help | Select-String "^ -"
|
|
665
|
-
```
|
|
666
|
-
|
|
667
|
-
### Command Chaining
|
|
668
|
-
|
|
669
|
-
Chain multiple commands together with proper error handling:
|
|
670
|
-
|
|
671
|
-
**Bash/Zsh (Unix, macOS, Linux, Git Bash):**
|
|
672
|
-
```bash
|
|
673
|
-
# Sequential execution - stops on first failure
|
|
674
|
-
aiw init && aiw launch
|
|
675
|
-
|
|
676
|
-
# Multiple commands
|
|
677
|
-
aiw --version && aiw init && aiw launch
|
|
678
|
-
|
|
679
|
-
# Continue on error
|
|
680
|
-
aiw init || echo "Setup failed"
|
|
681
|
-
|
|
682
|
-
# Error handling with exit codes
|
|
683
|
-
if aiw launch; then
|
|
684
|
-
echo "Launch succeeded"
|
|
685
|
-
else
|
|
686
|
-
EXIT_CODE=$?
|
|
687
|
-
echo "Launch failed with exit code $EXIT_CODE"
|
|
688
|
-
fi
|
|
689
|
-
```
|
|
690
|
-
|
|
691
|
-
**PowerShell (Windows):**
|
|
692
|
-
```powershell
|
|
693
|
-
# Sequential execution (PowerShell 7+)
|
|
694
|
-
aiw init && aiw launch
|
|
695
|
-
|
|
696
|
-
# Error handling
|
|
697
|
-
aiw launch
|
|
698
|
-
if ($LASTEXITCODE -eq 0) {
|
|
699
|
-
Write-Host "Success"
|
|
700
|
-
} else {
|
|
701
|
-
Write-Host "Failed with exit code $LASTEXITCODE"
|
|
702
|
-
}
|
|
703
|
-
```
|
|
704
|
-
|
|
705
|
-
**CMD (Windows):**
|
|
706
|
-
```cmd
|
|
707
|
-
REM Sequential execution
|
|
708
|
-
aiw init && aiw launch && echo Success
|
|
709
|
-
|
|
710
|
-
REM Error handling
|
|
711
|
-
aiw launch
|
|
712
|
-
if %ERRORLEVEL% EQU 0 (
|
|
713
|
-
echo Success
|
|
714
|
-
) else (
|
|
715
|
-
echo Failed with code %ERRORLEVEL%
|
|
716
|
-
)
|
|
717
|
-
```
|
|
718
|
-
|
|
719
|
-
### Quiet Mode for Scripts
|
|
720
|
-
|
|
721
|
-
Suppress informational output while preserving errors:
|
|
722
|
-
|
|
723
|
-
```bash
|
|
724
|
-
# Silent execution in automation
|
|
725
|
-
aiw launch --quiet
|
|
726
|
-
|
|
727
|
-
# Short form
|
|
728
|
-
aiw launch -q
|
|
729
|
-
|
|
730
|
-
# Capture exit code
|
|
731
|
-
aiw launch --quiet
|
|
732
|
-
EXIT_CODE=$?
|
|
733
|
-
|
|
734
|
-
# Only errors shown (goes to stderr)
|
|
735
|
-
aiw launch --quiet 2>errors.log
|
|
736
|
-
|
|
737
|
-
# Combine with piping for cleanest output
|
|
738
|
-
aiw launch --help --quiet | wc -l
|
|
739
|
-
```
|
|
740
|
-
|
|
741
|
-
**Use cases for `--quiet`:**
|
|
742
|
-
- CI/CD pipelines where minimal output is desired
|
|
743
|
-
- Automated scripts that parse command output
|
|
744
|
-
- Reducing noise in log files
|
|
745
|
-
- Background processes
|
|
746
|
-
|
|
747
|
-
### Exit Code Handling
|
|
748
|
-
|
|
749
|
-
AIW CLI uses standardized exit codes for reliable automation:
|
|
750
|
-
|
|
751
|
-
| Code | Meaning | Example Scenarios |
|
|
752
|
-
|------|---------|-------------------|
|
|
753
|
-
| `0` | Success | Command completed, help displayed, setup successful |
|
|
754
|
-
| `1` | General Error | Runtime failures, unexpected errors |
|
|
755
|
-
| `2` | Invalid Usage | Unknown flags, invalid arguments |
|
|
756
|
-
| `3` | Environment Error | Claude Code not installed, permissions denied |
|
|
757
|
-
|
|
758
|
-
**Bash/Zsh examples:**
|
|
759
|
-
```bash
|
|
760
|
-
# Basic exit code check
|
|
761
|
-
aiw launch
|
|
762
|
-
if [ $? -eq 0 ]; then
|
|
763
|
-
echo "Success"
|
|
764
|
-
fi
|
|
765
|
-
|
|
766
|
-
# Handle specific exit codes
|
|
767
|
-
aiw launch
|
|
768
|
-
EXIT_CODE=$?
|
|
769
|
-
case $EXIT_CODE in
|
|
770
|
-
0)
|
|
771
|
-
echo "Launch successful"
|
|
772
|
-
;;
|
|
773
|
-
2)
|
|
774
|
-
echo "Invalid usage - check arguments"
|
|
775
|
-
;;
|
|
776
|
-
3)
|
|
777
|
-
echo "Environment issue - is Claude Code installed?"
|
|
778
|
-
aiw init # Try setup
|
|
779
|
-
;;
|
|
780
|
-
*)
|
|
781
|
-
echo "Unexpected error: $EXIT_CODE"
|
|
782
|
-
;;
|
|
783
|
-
esac
|
|
784
|
-
|
|
785
|
-
# Use exit codes in pipelines
|
|
786
|
-
aiw init && aiw launch || {
|
|
787
|
-
echo "Failed at exit code $?"
|
|
788
|
-
exit 1
|
|
789
|
-
}
|
|
790
|
-
```
|
|
791
|
-
|
|
792
|
-
**PowerShell examples:**
|
|
793
|
-
```powershell
|
|
794
|
-
# Check last exit code
|
|
795
|
-
aiw launch
|
|
796
|
-
if ($LASTEXITCODE -eq 0) {
|
|
797
|
-
Write-Host "Success"
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
# Handle specific codes
|
|
801
|
-
aiw launch
|
|
802
|
-
switch ($LASTEXITCODE) {
|
|
803
|
-
0 { Write-Host "Success" }
|
|
804
|
-
2 { Write-Host "Invalid usage" }
|
|
805
|
-
3 { Write-Host "Environment issue"; aiw init }
|
|
806
|
-
default { Write-Host "Error: $LASTEXITCODE" }
|
|
807
|
-
}
|
|
808
|
-
|
|
809
|
-
# Fail on error
|
|
810
|
-
$ErrorActionPreference = "Stop"
|
|
811
|
-
aiw launch # Will throw if non-zero exit code
|
|
812
|
-
```
|
|
813
|
-
|
|
814
|
-
### Shell Completion Usage
|
|
815
|
-
|
|
816
|
-
After installing shell completion (see [Shell Completion](#shell-completion) section):
|
|
817
|
-
|
|
818
|
-
```bash
|
|
819
|
-
# Command completion
|
|
820
|
-
aiw la<TAB> # Completes to "aiw launch"
|
|
821
|
-
|
|
822
|
-
# Show all commands
|
|
823
|
-
aiw <TAB> # Lists: autocomplete, help, init, launch
|
|
824
|
-
|
|
825
|
-
# Flag completion
|
|
826
|
-
aiw launch --<TAB> # Shows: --debug, --help, --quiet
|
|
827
|
-
|
|
828
|
-
# Short flag completion
|
|
829
|
-
aiw launch -<TAB> # Shows: -d, -h, -q
|
|
830
|
-
```
|
|
831
|
-
|
|
832
|
-
**Benefits:**
|
|
833
|
-
- Faster command entry
|
|
834
|
-
- Discover available commands without `--help`
|
|
835
|
-
- Reduce typos
|
|
836
|
-
- Learn flag names interactively
|
|
837
|
-
|
|
838
|
-
### CI/CD Pipeline Examples
|
|
839
|
-
|
|
840
|
-
**GitHub Actions:**
|
|
841
|
-
```yaml
|
|
842
|
-
name: Deploy with AIW
|
|
843
|
-
|
|
844
|
-
on: [push]
|
|
845
|
-
|
|
846
|
-
jobs:
|
|
847
|
-
deploy:
|
|
848
|
-
runs-on: ubuntu-latest
|
|
849
|
-
steps:
|
|
850
|
-
- uses: actions/checkout@v2
|
|
851
|
-
|
|
852
|
-
- name: Setup AIW
|
|
853
|
-
run: |
|
|
854
|
-
npm install -g aiwcli
|
|
855
|
-
aiw init
|
|
856
|
-
|
|
857
|
-
- name: Launch Claude Code
|
|
858
|
-
run: aiw launch --quiet || exit $?
|
|
859
|
-
|
|
860
|
-
- name: Check exit code
|
|
861
|
-
if: failure()
|
|
862
|
-
run: |
|
|
863
|
-
echo "AIW launch failed"
|
|
864
|
-
echo "Exit code: $?"
|
|
865
|
-
```
|
|
866
|
-
|
|
867
|
-
**GitLab CI:**
|
|
868
|
-
```yaml
|
|
869
|
-
deploy:
|
|
870
|
-
script:
|
|
871
|
-
- aiw init
|
|
872
|
-
- aiw launch --quiet
|
|
873
|
-
only:
|
|
874
|
-
- main
|
|
875
|
-
```
|
|
876
|
-
|
|
877
|
-
**Jenkins:**
|
|
878
|
-
```groovy
|
|
879
|
-
pipeline {
|
|
880
|
-
agent any
|
|
881
|
-
stages {
|
|
882
|
-
stage('Setup') {
|
|
883
|
-
steps {
|
|
884
|
-
sh 'aiw init'
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
stage('Launch') {
|
|
888
|
-
steps {
|
|
889
|
-
sh 'aiw launch --quiet || exit $?'
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
}
|
|
894
|
-
```
|
|
895
|
-
|
|
896
|
-
### Automation Script Examples
|
|
127
|
+
---
|
|
897
128
|
|
|
898
|
-
|
|
899
|
-
```bash
|
|
900
|
-
#!/bin/bash
|
|
901
|
-
set -e # Exit on error
|
|
902
|
-
|
|
903
|
-
echo "Starting deployment..."
|
|
129
|
+
## Command Development Guide
|
|
904
130
|
|
|
905
|
-
|
|
906
|
-
if ! aiw --version > /dev/null 2>&1; then
|
|
907
|
-
echo "AIW CLI not found"
|
|
908
|
-
exit 3
|
|
909
|
-
fi
|
|
131
|
+
### Architecture
|
|
910
132
|
|
|
911
|
-
|
|
912
|
-
aiw init || {
|
|
913
|
-
echo "Setup failed with code $?"
|
|
914
|
-
exit 1
|
|
915
|
-
}
|
|
133
|
+
Uses [Oclif](https://oclif.io). File path = command name: `src/commands/launch.ts` -> `aiw launch`.
|
|
916
134
|
|
|
917
|
-
|
|
918
|
-
aiw launch --quiet
|
|
135
|
+
### Adding a Command
|
|
919
136
|
|
|
920
|
-
|
|
921
|
-
```
|
|
137
|
+
1. Create file in `src/commands/`:
|
|
922
138
|
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
# Check AIW status every 5 minutes
|
|
928
|
-
while true; do
|
|
929
|
-
if aiw --version --quiet; then
|
|
930
|
-
echo "[$(date)] AIW CLI operational"
|
|
931
|
-
else
|
|
932
|
-
echo "[$(date)] AIW CLI check failed: exit code $?"
|
|
933
|
-
fi
|
|
934
|
-
sleep 300
|
|
935
|
-
done
|
|
936
|
-
```
|
|
139
|
+
```typescript
|
|
140
|
+
import {Flags} from '@oclif/core'
|
|
141
|
+
import BaseCommand from '../lib/base-command.js'
|
|
937
142
|
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
# Process multiple operations with AIW
|
|
941
|
-
$operations = @("setup", "launch")
|
|
143
|
+
export default class Status extends BaseCommand {
|
|
144
|
+
static override description = 'Show AIW status'
|
|
942
145
|
|
|
943
|
-
|
|
944
|
-
|
|
146
|
+
static override examples = [
|
|
147
|
+
'<%= config.bin %> <%= command.id %>',
|
|
148
|
+
]
|
|
945
149
|
|
|
946
|
-
|
|
150
|
+
static override flags = {
|
|
151
|
+
...BaseCommand.baseFlags,
|
|
152
|
+
}
|
|
947
153
|
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
154
|
+
async run(): Promise<void> {
|
|
155
|
+
const {flags} = await this.parse(Status)
|
|
156
|
+
this.log('Status output')
|
|
157
|
+
}
|
|
952
158
|
}
|
|
953
|
-
|
|
954
|
-
Write-Host "All operations completed successfully"
|
|
955
|
-
```
|
|
956
|
-
|
|
957
|
-
### Tips for Scripting
|
|
958
|
-
|
|
959
|
-
**1. Always use `--quiet` in scripts:**
|
|
960
|
-
```bash
|
|
961
|
-
# Good: Clean output
|
|
962
|
-
aiw launch --quiet
|
|
963
|
-
|
|
964
|
-
# Avoid: Verbose output pollutes logs
|
|
965
|
-
aiw launch
|
|
966
|
-
```
|
|
967
|
-
|
|
968
|
-
**2. Check exit codes explicitly:**
|
|
969
|
-
```bash
|
|
970
|
-
# Good: Explicit error handling
|
|
971
|
-
aiw launch
|
|
972
|
-
if [ $? -ne 0 ]; then
|
|
973
|
-
handle_error
|
|
974
|
-
fi
|
|
975
|
-
|
|
976
|
-
# Risky: Assumes success
|
|
977
|
-
aiw launch
|
|
978
|
-
continue_anyway
|
|
979
159
|
```
|
|
980
160
|
|
|
981
|
-
|
|
982
|
-
```bash
|
|
983
|
-
# Capture errors for debugging
|
|
984
|
-
aiw launch 2>errors.log
|
|
985
|
-
|
|
986
|
-
# Capture both stdout and stderr
|
|
987
|
-
aiw launch >output.log 2>&1
|
|
988
|
-
```
|
|
989
|
-
|
|
990
|
-
**4. Use timeout for long operations:**
|
|
991
|
-
```bash
|
|
992
|
-
# Bash: timeout after 60 seconds
|
|
993
|
-
timeout 60 aiw launch || echo "Timeout or error"
|
|
994
|
-
|
|
995
|
-
# PowerShell: timeout after 60 seconds
|
|
996
|
-
Start-Process -Wait -Timeout 60 -NoNewWindow aiw -ArgumentList "launch"
|
|
997
|
-
```
|
|
998
|
-
|
|
999
|
-
**5. Combine with other CLI tools:**
|
|
1000
|
-
```bash
|
|
1001
|
-
# Log with timestamp
|
|
1002
|
-
aiw launch --quiet 2>&1 | while read line; do
|
|
1003
|
-
echo "$(date -Is) $line"
|
|
1004
|
-
done
|
|
1005
|
-
|
|
1006
|
-
# Notify on completion (Linux/macOS)
|
|
1007
|
-
aiw launch --quiet && notify-send "AIW launch complete"
|
|
1008
|
-
|
|
1009
|
-
# Email on failure (with sendmail)
|
|
1010
|
-
aiw launch --quiet || echo "AIW launch failed" | mail -s "Alert" admin@example.com
|
|
1011
|
-
```
|
|
1012
|
-
|
|
1013
|
-
## Command Development Guide
|
|
1014
|
-
|
|
1015
|
-
This section explains how to add new commands to AIW CLI following Oclif best practices and our established patterns.
|
|
1016
|
-
|
|
1017
|
-
### Command Architecture
|
|
1018
|
-
|
|
1019
|
-
AIW CLI uses [Oclif](https://oclif.io) which provides automatic command registration based on file structure:
|
|
1020
|
-
|
|
1021
|
-
- **File path = Command name**: `src/commands/launch.ts` → `aiw launch`
|
|
1022
|
-
- **Subdirectories = Topics**: `src/commands/init/index.ts` → `aiw init`
|
|
1023
|
-
- **Class names**: PascalCase version of command name (`Launch`, `Init`)
|
|
1024
|
-
|
|
1025
|
-
### Adding a New Top-Level Command
|
|
1026
|
-
|
|
1027
|
-
1. **Create the command file** in `src/commands/`:
|
|
1028
|
-
```bash
|
|
1029
|
-
# Example: Adding a "status" command
|
|
1030
|
-
touch src/commands/status.ts
|
|
1031
|
-
```
|
|
1032
|
-
|
|
1033
|
-
2. **Implement the command**:
|
|
1034
|
-
```typescript
|
|
1035
|
-
import {Flags} from '@oclif/core'
|
|
1036
|
-
|
|
1037
|
-
import BaseCommand from '../lib/base-command.js'
|
|
1038
|
-
|
|
1039
|
-
export default class Status extends BaseCommand {
|
|
1040
|
-
static override description = 'Show AIW status'
|
|
161
|
+
2. Add tests in `test/commands/`.
|
|
1041
162
|
|
|
1042
|
-
|
|
1043
|
-
'<%= config.bin %> <%= command.id %>',
|
|
1044
|
-
'<%= config.bin %> <%= command.id %> --debug',
|
|
1045
|
-
]
|
|
163
|
+
### Standard Flags
|
|
1046
164
|
|
|
1047
|
-
|
|
1048
|
-
...BaseCommand.baseFlags, // Inherit global flags
|
|
1049
|
-
// Add command-specific flags here
|
|
1050
|
-
}
|
|
165
|
+
All commands inherit from `BaseCommand`: `--debug` (`-d`), `--help` (`-h`), `--quiet` (`-q`).
|
|
1051
166
|
|
|
1052
|
-
|
|
1053
|
-
const {flags} = await this.parse(Status)
|
|
1054
|
-
// Implementation here
|
|
1055
|
-
this.log('Status output')
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1058
|
-
```
|
|
1059
|
-
|
|
1060
|
-
3. **Add tests** in `test/commands/`:
|
|
1061
|
-
```typescript
|
|
1062
|
-
// test/commands/status.test.ts
|
|
1063
|
-
import {expect, test} from '@oclif/test'
|
|
1064
|
-
|
|
1065
|
-
describe('status', () => {
|
|
1066
|
-
test
|
|
1067
|
-
.stdout()
|
|
1068
|
-
.command(['status'])
|
|
1069
|
-
.it('shows status', ctx => {
|
|
1070
|
-
expect(ctx.stdout).to.contain('Status output')
|
|
1071
|
-
})
|
|
1072
|
-
})
|
|
1073
|
-
```
|
|
1074
|
-
|
|
1075
|
-
### Adding a Topic (Command Group)
|
|
1076
|
-
|
|
1077
|
-
Topics organize related commands under a common namespace:
|
|
1078
|
-
|
|
1079
|
-
1. **Create directory** in `src/commands/`:
|
|
1080
|
-
```bash
|
|
1081
|
-
mkdir src/commands/config
|
|
1082
|
-
```
|
|
1083
|
-
|
|
1084
|
-
2. **Add topic commands**:
|
|
1085
|
-
```typescript
|
|
1086
|
-
// src/commands/config/show.ts → aiw config show
|
|
1087
|
-
// src/commands/config/edit.ts → aiw config edit
|
|
1088
|
-
```
|
|
1089
|
-
|
|
1090
|
-
### Standard Flag Patterns
|
|
1091
|
-
|
|
1092
|
-
All commands should inherit base flags from `BaseCommand`:
|
|
1093
|
-
|
|
1094
|
-
| Flag | Long Form | Short Form | Purpose |
|
|
1095
|
-
|------|-----------|------------|---------|
|
|
1096
|
-
| Debug | `--debug` | `-d` | Enable verbose logging |
|
|
1097
|
-
| Help | `--help` | `-h` | Show command help |
|
|
1098
|
-
| Quiet | `--quiet` | `-q` | Suppress informational output (errors still shown) |
|
|
1099
|
-
|
|
1100
|
-
**Pattern:**
|
|
1101
|
-
```typescript
|
|
1102
|
-
static override flags = {
|
|
1103
|
-
...BaseCommand.baseFlags, // Always inherit base flags
|
|
1104
|
-
myFlag: Flags.string({
|
|
1105
|
-
char: 'm', // Short form
|
|
1106
|
-
description: 'My flag description',
|
|
1107
|
-
required: false,
|
|
1108
|
-
}),
|
|
1109
|
-
}
|
|
1110
|
-
```
|
|
1111
|
-
|
|
1112
|
-
### Naming Conventions
|
|
167
|
+
### Conventions
|
|
1113
168
|
|
|
1114
169
|
| Element | Convention | Example |
|
|
1115
170
|
|---------|------------|---------|
|
|
1116
|
-
| Command files | kebab-case | `launch.ts
|
|
1117
|
-
| Command classes | PascalCase | `Launch
|
|
1118
|
-
| Flags | camelCase | `debug`, `aiwDir
|
|
171
|
+
| Command files | kebab-case | `launch.ts` |
|
|
172
|
+
| Command classes | PascalCase | `Launch` |
|
|
173
|
+
| Flags | camelCase | `debug`, `aiwDir` |
|
|
1119
174
|
| Constants | UPPER_SNAKE_CASE | `EXIT_CODES.SUCCESS` |
|
|
1120
175
|
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
Follow strict import order (enforced by ESLint):
|
|
1124
|
-
|
|
1125
|
-
```typescript
|
|
1126
|
-
// 1. Node builtins (with node: prefix)
|
|
1127
|
-
import {spawn} from 'node:child_process'
|
|
1128
|
-
|
|
1129
|
-
// 2. External packages
|
|
1130
|
-
import {Flags} from '@oclif/core'
|
|
1131
|
-
|
|
1132
|
-
// 3. Internal imports
|
|
1133
|
-
import BaseCommand from '../lib/base-command.js'
|
|
1134
|
-
import {getAiwDir} from '../lib/config.js'
|
|
1135
|
-
|
|
1136
|
-
// 4. Type imports
|
|
1137
|
-
import type {LaunchOptions} from '../types/index.js'
|
|
1138
|
-
```
|
|
176
|
+
Import order: Node builtins (with `node:` prefix) > external packages > internal imports > type imports.
|
|
1139
177
|
|
|
1140
178
|
### Error Handling
|
|
1141
179
|
|
|
1142
|
-
Use categorized exit codes and actionable error messages:
|
|
1143
|
-
|
|
1144
180
|
```typescript
|
|
1145
181
|
import {EXIT_CODES} from '../types/index.js'
|
|
1146
182
|
|
|
1147
|
-
// Actionable error format: {what_wrong}. {how_to_fix}
|
|
1148
183
|
this.error(
|
|
1149
184
|
'Configuration file not found. Run `aiw init` to initialize.',
|
|
1150
185
|
{exit: EXIT_CODES.ENVIRONMENT_ERROR}
|
|
1151
186
|
)
|
|
1152
187
|
```
|
|
1153
188
|
|
|
1154
|
-
|
|
1155
|
-
- `EXIT_CODES.SUCCESS` (0) - Successful execution
|
|
1156
|
-
- `EXIT_CODES.GENERAL_ERROR` (1) - General error
|
|
1157
|
-
- `EXIT_CODES.INVALID_USAGE` (2) - Invalid arguments
|
|
1158
|
-
- `EXIT_CODES.ENVIRONMENT_ERROR` (3) - Environment/prerequisite error
|
|
1159
|
-
|
|
1160
|
-
### Help System
|
|
1161
|
-
|
|
1162
|
-
Oclif provides built-in help:
|
|
1163
|
-
|
|
1164
|
-
- `aiw <command> --help` - Show command help
|
|
1165
|
-
- `aiw help <command>` - Alternative help format (same output)
|
|
1166
|
-
- `aiw help` - List all commands
|
|
1167
|
-
|
|
1168
|
-
Help is automatically generated from command metadata (description, examples, flags).
|
|
1169
|
-
|
|
1170
|
-
### Testing Commands
|
|
189
|
+
### Rules
|
|
1171
190
|
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
- Use `execSync()` to run commands
|
|
1179
|
-
- Cross-platform compatibility
|
|
1180
|
-
|
|
1181
|
-
**Example:**
|
|
1182
|
-
```typescript
|
|
1183
|
-
import {execSync} from 'node:child_process'
|
|
1184
|
-
import {platform} from 'node:os'
|
|
1185
|
-
|
|
1186
|
-
const bin = platform() === 'win32' ? String.raw`.\bin\dev.cmd` : './bin/dev.js'
|
|
191
|
+
**Must:**
|
|
192
|
+
- Extend `BaseCommand`, inherit `BaseCommand.baseFlags`
|
|
193
|
+
- Use `.js` extension in all imports (ESM)
|
|
194
|
+
- Add `node:` prefix for Node builtins
|
|
195
|
+
- Use `this.error()` not `process.exit()`
|
|
196
|
+
- Provide both short and long flag forms
|
|
1187
197
|
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
198
|
+
**Must not:**
|
|
199
|
+
- Call `process.exit()` directly
|
|
200
|
+
- Create utils in `src/utils/` or `src/helpers/` (use `src/lib/`)
|
|
201
|
+
- Use `I` prefix on interfaces
|
|
202
|
+
- Skip `.js` extension in imports
|
|
203
|
+
- Use Promise chains (use async/await)
|
|
1193
204
|
|
|
1194
205
|
### Project Structure
|
|
1195
206
|
|
|
1196
207
|
```
|
|
1197
|
-
|
|
208
|
+
packages/cli/
|
|
1198
209
|
├── src/
|
|
1199
210
|
│ ├── commands/
|
|
1200
|
-
│ │ ├── branch.ts
|
|
1201
|
-
│ │ ├── launch.ts
|
|
1202
|
-
│ │ └── init/
|
|
1203
|
-
│
|
|
1204
|
-
│ ├──
|
|
1205
|
-
│ │ ├── base-command.ts # BaseCommand (extend this)
|
|
211
|
+
│ │ ├── branch.ts
|
|
212
|
+
│ │ ├── launch.ts
|
|
213
|
+
│ │ └── init/index.ts
|
|
214
|
+
│ ├── lib/
|
|
215
|
+
│ │ ├── base-command.ts
|
|
1206
216
|
│ │ ├── config.ts
|
|
1207
217
|
│ │ ├── debug.ts
|
|
1208
218
|
│ │ ├── errors.ts
|
|
1209
219
|
│ │ └── spawn.ts
|
|
1210
|
-
│ └── types/
|
|
1211
|
-
│ └── index.ts
|
|
220
|
+
│ └── types/index.ts
|
|
1212
221
|
├── test/
|
|
1213
|
-
│ ├── commands/
|
|
1214
|
-
│ ├── lib/
|
|
1215
|
-
│ └── integration/
|
|
222
|
+
│ ├── commands/
|
|
223
|
+
│ ├── lib/
|
|
224
|
+
│ └── integration/
|
|
1216
225
|
└── README.md
|
|
1217
226
|
```
|
|
1218
|
-
|
|
1219
|
-
### Critical Rules
|
|
1220
|
-
|
|
1221
|
-
**MUST:**
|
|
1222
|
-
- Extend `BaseCommand` for all commands
|
|
1223
|
-
- Inherit `BaseCommand.baseFlags` in flag definitions
|
|
1224
|
-
- Use `.js` extension in all imports (ESM requirement)
|
|
1225
|
-
- Add `node:` prefix for Node builtins
|
|
1226
|
-
- Use `this.error()` instead of `process.exit()`
|
|
1227
|
-
- Provide both short (`-f`) and long (`--flag`) flag forms
|
|
1228
|
-
- Follow kebab-case for command file names
|
|
1229
|
-
|
|
1230
|
-
**MUST NOT:**
|
|
1231
|
-
- Call `process.exit()` directly
|
|
1232
|
-
- Create utilities in `src/utils/` or `src/helpers/` (use `src/lib/`)
|
|
1233
|
-
- Use `I` prefix on interfaces (`Config` not `IConfig`)
|
|
1234
|
-
- Skip the `.js` extension in imports
|
|
1235
|
-
- Use Promise chains (use async/await)
|
|
1236
|
-
|
|
1237
|
-
### Resources
|
|
1238
|
-
|
|
1239
|
-
- [Oclif Documentation](https://oclif.io/docs)
|
|
1240
|
-
- [Oclif Commands](https://oclif.io/docs/commands)
|
|
1241
|
-
- [Oclif Flags](https://oclif.io/docs/flags)
|
|
1242
|
-
- [Oclif Topics](https://oclif.io/docs/topics)
|