chatup 0.2.18__tar.gz → 0.2.20__tar.gz

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 (105) hide show
  1. {chatup-0.2.18/src/chatup.egg-info → chatup-0.2.20}/PKG-INFO +27 -3
  2. {chatup-0.2.18 → chatup-0.2.20}/README.md +25 -1
  3. {chatup-0.2.18 → chatup-0.2.20}/pyproject.toml +4 -1
  4. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/__init__.py +1 -1
  5. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/cli.py +4 -0
  6. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/commands/desktop.py +2 -0
  7. chatup-0.2.20/src/chatup/commands/macos.py +53 -0
  8. chatup-0.2.20/src/chatup/commands/remotion.py +53 -0
  9. chatup-0.2.20/src/chatup/setup/assets/remotion/.gitignore +3 -0
  10. chatup-0.2.20/src/chatup/setup/assets/remotion/package-lock.json +3843 -0
  11. chatup-0.2.20/src/chatup/setup/assets/remotion/package.json +16 -0
  12. chatup-0.2.20/src/chatup/setup/assets/remotion/src/index.jsx +22 -0
  13. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/desktop.py +39 -4
  14. chatup-0.2.20/src/chatup/setup/remotion.py +143 -0
  15. {chatup-0.2.18 → chatup-0.2.20/src/chatup.egg-info}/PKG-INFO +27 -3
  16. {chatup-0.2.18 → chatup-0.2.20}/src/chatup.egg-info/SOURCES.txt +7 -0
  17. {chatup-0.2.18 → chatup-0.2.20}/src/chatup.egg-info/requires.txt +1 -1
  18. {chatup-0.2.18 → chatup-0.2.20}/tests/test_pyproject_metadata.py +1 -1
  19. {chatup-0.2.18 → chatup-0.2.20}/tests/test_version.py +1 -1
  20. {chatup-0.2.18 → chatup-0.2.20}/LICENSE +0 -0
  21. {chatup-0.2.18 → chatup-0.2.20}/setup.cfg +0 -0
  22. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/chrome_for_testing.py +0 -0
  23. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/chromedriver.py +0 -0
  24. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/commands/__init__.py +0 -0
  25. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/commands/chrome_for_testing.py +0 -0
  26. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/commands/chromedriver.py +0 -0
  27. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/commands/playwright.py +0 -0
  28. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/config.py +0 -0
  29. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/const.py +0 -0
  30. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/interaction/__init__.py +0 -0
  31. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/interaction/command_schema.py +0 -0
  32. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/interaction/policy.py +0 -0
  33. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/interaction/warnings.py +0 -0
  34. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/playwright.py +0 -0
  35. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/runtime/__init__.py +0 -0
  36. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/runtime/_managed_artifact.py +0 -0
  37. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/runtime/chrome_for_testing.py +0 -0
  38. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/runtime/chromedriver.py +0 -0
  39. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/runtime/playwright.py +0 -0
  40. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/__init__.py +0 -0
  41. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/assets/hermes/install.sh +0 -0
  42. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/assets/nvm.sh +0 -0
  43. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/cc_connect.py +0 -0
  44. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/chatgpt.py +0 -0
  45. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/claude.py +0 -0
  46. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/cli.py +0 -0
  47. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/codex.py +0 -0
  48. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/crs.py +0 -0
  49. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/cursor_agent.py +0 -0
  50. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/discourse.py +0 -0
  51. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/docker.py +0 -0
  52. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/elements.py +0 -0
  53. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/frp.py +0 -0
  54. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/gitea.py +0 -0
  55. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/hermes.py +0 -0
  56. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/lark_cli.py +0 -0
  57. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/mode_prompt.py +0 -0
  58. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/mysql.py +0 -0
  59. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/nginx.py +0 -0
  60. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/nodejs.py +0 -0
  61. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/opencode.py +0 -0
  62. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/service_credentials.py +0 -0
  63. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/shell_rc.py +0 -0
  64. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/twikoo.py +0 -0
  65. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/uv.py +0 -0
  66. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/workspace/__init__.py +0 -0
  67. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/workspace/cli.py +0 -0
  68. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/workspace/core.py +0 -0
  69. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/workspace/options.py +0 -0
  70. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/workspace/render.py +0 -0
  71. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/workspace/templates/default/en/AGENTS.md +0 -0
  72. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/workspace/templates/default/en/discussion/README.md +0 -0
  73. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/workspace/templates/default/en/projects/README.md +0 -0
  74. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/workspace/templates/default/zh/AGENTS.md +0 -0
  75. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/workspace/templates/default/zh/discussion/README.md +0 -0
  76. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/workspace/templates/default/zh/projects/README.md +0 -0
  77. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/workspace.py +0 -0
  78. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/zsh.py +0 -0
  79. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/setup/zulip.py +0 -0
  80. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/utils/__init__.py +0 -0
  81. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/utils/custom_logger.py +0 -0
  82. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/utils/pathing.py +0 -0
  83. {chatup-0.2.18 → chatup-0.2.20}/src/chatup/utils/platforming.py +0 -0
  84. {chatup-0.2.18 → chatup-0.2.20}/src/chatup.egg-info/dependency_links.txt +0 -0
  85. {chatup-0.2.18 → chatup-0.2.20}/src/chatup.egg-info/entry_points.txt +0 -0
  86. {chatup-0.2.18 → chatup-0.2.20}/src/chatup.egg-info/top_level.txt +0 -0
  87. {chatup-0.2.18 → chatup-0.2.20}/tests/test_browser_backend_cli.py +0 -0
  88. {chatup-0.2.18 → chatup-0.2.20}/tests/test_chatgpt_setup.py +0 -0
  89. {chatup-0.2.18 → chatup-0.2.20}/tests/test_chrome_for_testing.py +0 -0
  90. {chatup-0.2.18 → chatup-0.2.20}/tests/test_chromedriver.py +0 -0
  91. {chatup-0.2.18 → chatup-0.2.20}/tests/test_cli_tree_docs.py +0 -0
  92. {chatup-0.2.18 → chatup-0.2.20}/tests/test_codex_setup.py +0 -0
  93. {chatup-0.2.18 → chatup-0.2.20}/tests/test_crs_setup.py +0 -0
  94. {chatup-0.2.18 → chatup-0.2.20}/tests/test_cursor_agent_setup.py +0 -0
  95. {chatup-0.2.18 → chatup-0.2.20}/tests/test_hermes_model_defaults.py +0 -0
  96. {chatup-0.2.18 → chatup-0.2.20}/tests/test_playwright.py +0 -0
  97. {chatup-0.2.18 → chatup-0.2.20}/tests/test_playwright_cli.py +0 -0
  98. {chatup-0.2.18 → chatup-0.2.20}/tests/test_publish_workflow.py +0 -0
  99. {chatup-0.2.18 → chatup-0.2.20}/tests/test_service_installers.py +0 -0
  100. {chatup-0.2.18 → chatup-0.2.20}/tests/test_setup_cli.py +0 -0
  101. {chatup-0.2.18 → chatup-0.2.20}/tests/test_twikoo_setup.py +0 -0
  102. {chatup-0.2.18 → chatup-0.2.20}/tests/test_uv_activation.py +0 -0
  103. {chatup-0.2.18 → chatup-0.2.20}/tests/test_windows_compat.py +0 -0
  104. {chatup-0.2.18 → chatup-0.2.20}/tests/test_workspace_setup.py +0 -0
  105. {chatup-0.2.18 → chatup-0.2.20}/tests/test_zsh_alias_names.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chatup
3
- Version: 0.2.18
3
+ Version: 0.2.20
4
4
  Summary: ChatArch setup CLI extracted from ChatTool
5
5
  Author-email: rexwzh <1073853456@qq.com>
6
6
  License-Expression: MIT
@@ -14,7 +14,7 @@ Requires-Python: >=3.10
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
16
  Requires-Dist: click<9.0,>=8.0
17
- Requires-Dist: chatstyle<0.3.0,>=0.2.0
17
+ Requires-Dist: chatstyle[tui]<0.3.0,>=0.2.0
18
18
  Requires-Dist: chatenv<0.3.0,>=0.2.11
19
19
  Requires-Dist: python-dotenv<2.0,>=1.0
20
20
  Requires-Dist: colorama
@@ -76,6 +76,29 @@ chatup nginx proxy-pass ./gitea-local.conf --set SERVER_NAME=gitea.local.example
76
76
  chatup crs --install-dir ~/.chatarch/crs/local --port 12392 --redis-port 6379
77
77
  ```
78
78
 
79
+ ## macOS 常用应用
80
+
81
+ ```bash
82
+ chatup macos # 勾选安装,Apple Silicon 默认全选四项
83
+ chatup macos --app snipaste # 只安装 Snipaste
84
+ chatup macos --app blender # 安装 Blender 5.2.2 LTS(Apple Silicon)
85
+ chatup macos -I # 不询问,安装当前机器支持的全部选项
86
+ chatup macos --dry-run # 只预览安装计划
87
+ ```
88
+
89
+ 仅限 macOS。Apple Silicon 默认勾选 Snipaste、iTerm2、Chrome、Blender;Intel 保持前三项。终端中用空格切换勾选,回车安装;取消全部勾选则直接退出。可重复传入 `--app snipaste|iterm|chrome|blender` 选择多个应用。直接使用官方安装包,无需 Homebrew,已有应用验证后复用。详见[macOS 安装入口](https://arch.gh.wzhecnu.cn/ChatUp/commands/#macos)。
90
+
91
+ ## Remotion 视频项目
92
+
93
+ ```bash
94
+ chatup remotion ./my-video --dry-run -I
95
+ chatup remotion ./my-video -I
96
+ cd my-video
97
+ npm run studio
98
+ ```
99
+
100
+ 需要已有 Node.js >=18.12 和 npm >=9。创建带锁文件的 Remotion 4.0.530 项目,检测本机 Chrome 并输出渲染命令;不覆盖已有无关目录,也不替换 Node 或下载浏览器。项目放在指定目录,已有 Blender/Chrome 可通过 `chatup macos --app blender --app chrome` 验证或安装。详见[Remotion 安装约定](https://arch.gh.wzhecnu.cn/ChatUp/commands/#remotion)。
101
+
79
102
  ## Chrome 与 iTerm2
80
103
 
81
104
  ```bash
@@ -105,7 +128,8 @@ chatup chatgpt --yes # Windows 首次安装时接受 Store 协议
105
128
  | --- | --- |
106
129
  | 基础运行环境 | `doctor`、`uv`、`nodejs`、`docker`、`zsh`、`chrome-for-testing`、`chromedriver`、`playwright`、`frp` |
107
130
  | 工作区脚手架 | `workspace` |
108
- | 桌面应用 | `chrome`、`iterm`(仅 macOS)、`chatgpt`(含 Codex) |
131
+ | 桌面应用 | `macos`(Snipaste/iTerm2/Chrome/Blender 多选)、`chrome`、`iterm`(仅 macOS)、`chatgpt`(含 Codex) |
132
+ | 视频项目 | `remotion` |
109
133
  | 本地服务安装 | `gitea`、`discourse`、`zulip`、`mysql`、`nginx`、`crs` |
110
134
  | Agent 工具链 | `cc-connect`、`claude`、`codex`、`cursor-agent`、`opencode`、`hermes`、`lark-cli` |
111
135
 
@@ -45,6 +45,29 @@ chatup nginx proxy-pass ./gitea-local.conf --set SERVER_NAME=gitea.local.example
45
45
  chatup crs --install-dir ~/.chatarch/crs/local --port 12392 --redis-port 6379
46
46
  ```
47
47
 
48
+ ## macOS 常用应用
49
+
50
+ ```bash
51
+ chatup macos # 勾选安装,Apple Silicon 默认全选四项
52
+ chatup macos --app snipaste # 只安装 Snipaste
53
+ chatup macos --app blender # 安装 Blender 5.2.2 LTS(Apple Silicon)
54
+ chatup macos -I # 不询问,安装当前机器支持的全部选项
55
+ chatup macos --dry-run # 只预览安装计划
56
+ ```
57
+
58
+ 仅限 macOS。Apple Silicon 默认勾选 Snipaste、iTerm2、Chrome、Blender;Intel 保持前三项。终端中用空格切换勾选,回车安装;取消全部勾选则直接退出。可重复传入 `--app snipaste|iterm|chrome|blender` 选择多个应用。直接使用官方安装包,无需 Homebrew,已有应用验证后复用。详见[macOS 安装入口](https://arch.gh.wzhecnu.cn/ChatUp/commands/#macos)。
59
+
60
+ ## Remotion 视频项目
61
+
62
+ ```bash
63
+ chatup remotion ./my-video --dry-run -I
64
+ chatup remotion ./my-video -I
65
+ cd my-video
66
+ npm run studio
67
+ ```
68
+
69
+ 需要已有 Node.js >=18.12 和 npm >=9。创建带锁文件的 Remotion 4.0.530 项目,检测本机 Chrome 并输出渲染命令;不覆盖已有无关目录,也不替换 Node 或下载浏览器。项目放在指定目录,已有 Blender/Chrome 可通过 `chatup macos --app blender --app chrome` 验证或安装。详见[Remotion 安装约定](https://arch.gh.wzhecnu.cn/ChatUp/commands/#remotion)。
70
+
48
71
  ## Chrome 与 iTerm2
49
72
 
50
73
  ```bash
@@ -74,7 +97,8 @@ chatup chatgpt --yes # Windows 首次安装时接受 Store 协议
74
97
  | --- | --- |
75
98
  | 基础运行环境 | `doctor`、`uv`、`nodejs`、`docker`、`zsh`、`chrome-for-testing`、`chromedriver`、`playwright`、`frp` |
76
99
  | 工作区脚手架 | `workspace` |
77
- | 桌面应用 | `chrome`、`iterm`(仅 macOS)、`chatgpt`(含 Codex) |
100
+ | 桌面应用 | `macos`(Snipaste/iTerm2/Chrome/Blender 多选)、`chrome`、`iterm`(仅 macOS)、`chatgpt`(含 Codex) |
101
+ | 视频项目 | `remotion` |
78
102
  | 本地服务安装 | `gitea`、`discourse`、`zulip`、`mysql`、`nginx`、`crs` |
79
103
  | Agent 工具链 | `cc-connect`、`claude`、`codex`、`cursor-agent`、`opencode`、`hermes`、`lark-cli` |
80
104
 
@@ -11,7 +11,7 @@ requires-python = ">=3.10"
11
11
  license = "MIT"
12
12
  dependencies = [
13
13
  "click>=8.0,<9.0",
14
- "chatstyle>=0.2.0,<0.3.0",
14
+ "chatstyle[tui]>=0.2.0,<0.3.0",
15
15
  "chatenv>=0.2.11,<0.3.0",
16
16
  "python-dotenv>=1.0,<2.0",
17
17
  "colorama",
@@ -62,6 +62,9 @@ include-package-data = true
62
62
  "chatup.setup" = [
63
63
  "assets/*.sh",
64
64
  "assets/hermes/*.sh",
65
+ "assets/remotion/*.json",
66
+ "assets/remotion/.gitignore",
67
+ "assets/remotion/src/*.jsx",
65
68
  "workspace/templates/default/zh/*.md",
66
69
  "workspace/templates/default/zh/projects/*.md",
67
70
  "workspace/templates/default/zh/discussion/*.md",
@@ -2,4 +2,4 @@
2
2
 
3
3
  __all__ = ["__version__"]
4
4
 
5
- __version__ = "0.2.18"
5
+ __version__ = "0.2.20"
@@ -7,7 +7,9 @@ from chatup import __version__
7
7
  from chatup.commands.chrome_for_testing import cli as chrome_for_testing_cli
8
8
  from chatup.commands.chromedriver import cli as chromedriver_cli
9
9
  from chatup.commands.desktop import chrome_cli, iterm_cli
10
+ from chatup.commands.macos import macos_cli
10
11
  from chatup.commands.playwright import cli as playwright_cli
12
+ from chatup.commands.remotion import remotion_cli
11
13
  from chatup.setup.cli import register_setup_commands
12
14
 
13
15
 
@@ -35,6 +37,8 @@ main.add_command(chromedriver_cli)
35
37
  main.add_command(playwright_cli)
36
38
  main.add_command(chrome_cli)
37
39
  main.add_command(iterm_cli)
40
+ main.add_command(macos_cli)
41
+ main.add_command(remotion_cli)
38
42
 
39
43
 
40
44
  if __name__ == "__main__":
@@ -17,6 +17,8 @@ def _install(app: str, **kwargs) -> None:
17
17
  click.echo(f"{result['app']} install plan ({result['platform']}):")
18
18
  if "url" in result:
19
19
  click.echo(f"Download: {result['url']}")
20
+ if "sha256" in result:
21
+ click.echo(f"SHA-256: {result['sha256']}")
20
22
  if "path" in result:
21
23
  click.echo(f"Install to: {result['path']} (verify publisher signature)")
22
24
  if "command" in result:
@@ -0,0 +1,53 @@
1
+ """Select and install the supported macOS desktop applications."""
2
+ from __future__ import annotations
3
+
4
+ import platform
5
+
6
+ import click
7
+
8
+ from chatup.interaction import (
9
+ abort_if_force_without_tty,
10
+ add_interactive_option,
11
+ ask_checkbox,
12
+ create_choice,
13
+ resolve_interactive_mode,
14
+ )
15
+
16
+ from .desktop import _install
17
+
18
+ MACOS_APPS = {"snipaste": "Snipaste", "iterm": "iTerm2", "chrome": "Google Chrome", "blender": "Blender"}
19
+
20
+
21
+ @click.command(name="macos")
22
+ @click.option("--app", "apps", type=click.Choice(list(MACOS_APPS)), multiple=True,
23
+ help="Install only this app; repeat to select several. Defaults to all supported apps.")
24
+ @click.option("--dry-run", is_flag=True, help="Preview selected apps without downloading or installing.")
25
+ @click.option("--log-level", type=click.Choice(["DEBUG", "INFO", "WARNING", "ERROR"], case_sensitive=False), default="INFO")
26
+ @add_interactive_option
27
+ def macos_cli(apps, dry_run, log_level, interactive) -> None:
28
+ """Install macOS apps; Blender is available on Apple Silicon."""
29
+ if platform.system() != "Darwin":
30
+ raise click.ClickException("chatup macos is supported on macOS only.")
31
+ available = dict(MACOS_APPS)
32
+ if platform.machine().lower() not in {"arm64", "aarch64"}:
33
+ available.pop("blender")
34
+ if "blender" in apps and "blender" not in available:
35
+ raise click.ClickException("Blender installation supports Apple Silicon macOS only.")
36
+ selected = list(dict.fromkeys(apps)) if apps else list(available)
37
+ _, can_prompt, force, _, need_prompt = resolve_interactive_mode(
38
+ interactive, auto_prompt_condition=not apps and not dry_run,
39
+ )
40
+ abort_if_force_without_tty(force, can_prompt, "Usage: chatup macos [--app NAME] [-i|-I]")
41
+ if need_prompt:
42
+ selected = ask_checkbox(
43
+ "Select macOS apps to install",
44
+ choices=[create_choice(label, name) for name, label in available.items()],
45
+ default_values=selected,
46
+ instruction="(Space: toggle, Enter: install selected, Ctrl-C: cancel)",
47
+ )
48
+ if not selected:
49
+ click.echo("No apps selected; nothing installed.")
50
+ return
51
+ click.echo("Selected apps: " + ", ".join(MACOS_APPS[name] for name in selected))
52
+ for app in selected:
53
+ _install(app, dry_run=dry_run, log_level=log_level)
@@ -0,0 +1,53 @@
1
+ """CLI for a local, reproducible Remotion video project."""
2
+ from pathlib import Path
3
+ import platform
4
+ import shlex
5
+ import subprocess
6
+
7
+ import click
8
+
9
+ from chatup.interaction import (
10
+ abort_if_force_without_tty,
11
+ add_interactive_option,
12
+ ask_path,
13
+ resolve_interactive_mode,
14
+ )
15
+
16
+
17
+ @click.command(name="remotion")
18
+ @click.argument("project_dir", required=False, type=click.Path(path_type=Path))
19
+ @click.option("--browser-executable", type=click.Path(dir_okay=False, path_type=Path),
20
+ help="Existing Chrome/Chromium executable to use in the suggested render command.")
21
+ @click.option("--dry-run", is_flag=True, help="Preview without downloading, executing or writing files.")
22
+ @click.option("--log-level", type=click.Choice(["DEBUG", "INFO", "WARNING", "ERROR"], case_sensitive=False), default="INFO")
23
+ @add_interactive_option
24
+ def remotion_cli(project_dir, browser_executable, dry_run, log_level, interactive):
25
+ """Initialize a local Remotion project with locked dependencies."""
26
+ from chatup.setup.remotion import setup_remotion
27
+
28
+ _, can_prompt, force, _, need_prompt = resolve_interactive_mode(
29
+ interactive, auto_prompt_condition=project_dir is None,
30
+ )
31
+ usage = "Usage: chatup remotion PROJECT_DIR [-i|-I]"
32
+ abort_if_force_without_tty(force, can_prompt, usage)
33
+ if need_prompt:
34
+ project_dir = ask_path("Remotion project directory", default=str(project_dir or Path.cwd() / "remotion-video"))
35
+ if not project_dir:
36
+ raise click.UsageError("PROJECT_DIR is required. Example: chatup remotion ./my-video -I")
37
+ try:
38
+ result = setup_remotion(project_dir, dry_run=dry_run, browser_executable=browser_executable, log_level=log_level)
39
+ except RuntimeError as exc:
40
+ raise click.ClickException(str(exc)) from exc
41
+ label = {"planned": "Install plan", "created": "Project ready", "already_initialized": "Already initialized"}[result["status"]]
42
+ click.echo(f"{label}: Remotion {result['version']} at {result['path']}")
43
+ if dry_run:
44
+ click.echo("Requires Node.js >=18.12 and npm >=9; installs project-local locked dependencies.")
45
+ click.echo("Dry run: no download, process execution or directory writes performed.")
46
+ click.echo("From the project directory, start Studio with: npm run studio")
47
+ if result["browser"]:
48
+ command = ["npm", "run", "render", "--", f"--browser-executable={result['browser']}"]
49
+ render = subprocess.list2cmdline(command) if platform.system() == "Windows" else shlex.join(command)
50
+ click.echo(f"Render with the existing browser: {render}")
51
+ else:
52
+ click.echo("No local Chrome detected. Run chatup chrome, then rerun with --browser-executable PATH for render guidance.")
53
+ click.echo("Browser downloads and Studio startup are not part of project initialization.")
@@ -0,0 +1,3 @@
1
+ node_modules/
2
+ out/
3
+ .cache/