rian-project-manager 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +156 -0
  3. package/THIRD_PARTY_NOTICES.txt +673 -0
  4. package/bin/rian.cjs +12 -0
  5. package/cmd/rian/main.go +17 -0
  6. package/dist/binaries/darwin-arm64/rian +0 -0
  7. package/dist/binaries/darwin-x64/rian +0 -0
  8. package/dist/binaries/linux-arm64/rian +0 -0
  9. package/dist/binaries/linux-x64/rian +0 -0
  10. package/dist/binaries/manifest.json +29 -0
  11. package/dist/binaries/win32-arm64/rian.exe +0 -0
  12. package/dist/binaries/win32-x64/rian.exe +0 -0
  13. package/go.mod +28 -0
  14. package/go.sum +44 -0
  15. package/internal/app/app.go +298 -0
  16. package/internal/app/app_test.go +85 -0
  17. package/internal/config/config.go +189 -0
  18. package/internal/config/config_test.go +101 -0
  19. package/internal/detect/detect.go +252 -0
  20. package/internal/detect/detect_test.go +86 -0
  21. package/internal/git/git.go +166 -0
  22. package/internal/git/git_test.go +73 -0
  23. package/internal/git/window_unix.go +7 -0
  24. package/internal/git/window_windows.go +8 -0
  25. package/internal/process/platform_unix.go +19 -0
  26. package/internal/process/platform_windows.go +25 -0
  27. package/internal/process/process.go +172 -0
  28. package/internal/process/process_test.go +137 -0
  29. package/internal/project/project.go +180 -0
  30. package/internal/project/project_test.go +71 -0
  31. package/internal/tools/lookup.go +41 -0
  32. package/internal/tools/platform_unix.go +34 -0
  33. package/internal/tools/platform_windows.go +52 -0
  34. package/internal/tools/platform_windows_test.go +29 -0
  35. package/internal/tools/tools.go +152 -0
  36. package/internal/tools/tools_test.go +56 -0
  37. package/internal/ui/actions.go +259 -0
  38. package/internal/ui/forms.go +156 -0
  39. package/internal/ui/model.go +220 -0
  40. package/internal/ui/styles.go +85 -0
  41. package/internal/ui/ui_test.go +170 -0
  42. package/internal/ui/update.go +470 -0
  43. package/internal/ui/view.go +459 -0
  44. package/lib/launcher.cjs +45 -0
  45. package/lib/platforms.cjs +20 -0
  46. package/package.json +41 -0
  47. package/scripts/build-binaries.cjs +60 -0
  48. package/scripts/check-package.cjs +49 -0
  49. package/scripts/ensure-binary.cjs +11 -0
  50. package/test/npm/launcher.test.cjs +45 -0
  51. package/test/npm/package.test.cjs +26 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Rian contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,156 @@
1
+ # Rian
2
+
3
+ **Your local project desk.** A fast, keyboard-first terminal app for picking up work across development projects. Save a directory once; open your editor, coding tools, GitHub, shell, and project commands from one place.
4
+
5
+ Built in Go with [Bubble Tea](https://github.com/charmbracelet/bubbletea), [Lip Gloss](https://github.com/charmbracelet/lipgloss), and [Bubbles](https://github.com/charmbracelet/bubbles). Local JSON storage. No accounts or background service.
6
+
7
+ <!-- Screenshot placeholder: replace with a terminal capture of Rian in your own workspace. -->
8
+ ```text
9
+ RIAN / your project desk Ctrl+K actions
10
+
11
+ ╭─ Projects ─────────────────╮ ╭─ Cardly ──────────────────────────╮
12
+ │ › ★ Cardly main ● │ │ ~/dev/cardly │
13
+ │ Drift main ○ │ │ Node.js · pnpm · Next.js │
14
+ │ Rin dev ● │ │ │
15
+ │ │ │ GitHub FatalMistake02/Cardly │
16
+ │ │ │ Branch main Modified 3 │
17
+ │ │ │ Ahead 1 Behind 0 │
18
+ │ │ │ │
19
+ │ │ │ v VS Code o OpenCode │
20
+ │ │ │ K KiloCode c ChatGPT │
21
+ │ │ │ t Terminal g GitHub │
22
+ ╰────────────────────────────╯ ╰───────────────────────────────────╯
23
+
24
+ ↑↓ / jk navigate a add / search ? help q quit
25
+ ```
26
+
27
+ ## Features
28
+
29
+ - Resizable full-screen interface with a restrained `#fa11b0` accent, fuzzy project search, action palette, help, confirmations, and notifications.
30
+ - Favorites first, followed by recently used projects. Opening an action or starting a command records use.
31
+ - Project previews before saving, editable names/directories/URLs/GitHub overrides/tool settings, and custom commands.
32
+ - VS Code, OpenCode, KiloCode (`kilo` or `kilocode`), ChatGPT, GitHub, and project URLs. Missing tools are explained in the palette.
33
+ - Local Git status: branch, modified/untracked counts, ahead/behind, latest commit, and remote. The active project refreshes every 15 seconds and when the terminal regains focus. No automatic network calls.
34
+ - Detected commands, custom overrides, and one active background command per project with recent output, PID, start time, stop, and rerun.
35
+ - Git menu: fast-forward pull, push, fetch, staged commit, existing-branch switch, GitHub, and optional lazygit.
36
+
37
+ ## Install
38
+
39
+ Requires **Node.js 22+**. Install the npm package to get the `rian` command:
40
+
41
+ ```sh
42
+ npm install -g rian-project-manager
43
+ rian add .
44
+ rian
45
+ ```
46
+
47
+ Or try it without a global install:
48
+
49
+ ```sh
50
+ npx rian-project-manager
51
+ ```
52
+
53
+ The package includes native executables for **macOS, Windows, and Linux**, on both **ARM64 and x64**. No Go installation, compiler, or separate binary download is needed. The small Node launcher passes terminal input and output directly to Rian. Its installation script only ensures the current platform's executable has permission to run.
54
+
55
+ Git and coding tools are optional; install the tools you want and make their launchers available in `PATH`. On macOS, Rian also finds VS Code and ChatGPT in `/Applications` or `~/Applications`.
56
+
57
+ ### Build from source
58
+
59
+ Requires **Go 1.26+** to build:
60
+
61
+ ```sh
62
+ go build -trimpath -ldflags="-s -w" -o rian ./cmd/rian
63
+ ```
64
+
65
+ On Windows, use `-o rian.exe`. Move the resulting executable to a directory in your `PATH`. That single executable is all Rian needs; no Go installation is needed to run it.
66
+
67
+ ```sh
68
+ rian add .
69
+ rian
70
+ ```
71
+
72
+ The add command previews detection and asks for confirmation. Use `--yes` for scripts or automation after reviewing the directory. A modern UTF-8 terminal is recommended. The interface needs at least 52 columns × 16 rows; 100 × 30 gives the details more room.
73
+
74
+ ## CLI
75
+
76
+ | Command | Behavior |
77
+ | --- | --- |
78
+ | `rian` | Open the interface |
79
+ | `rian add <directory> [--yes]` | Inspect, preview, and save a project |
80
+ | `rian list [--json]` | List saved projects |
81
+ | `rian open <project>` / `rian vscode <project>` | Open VS Code |
82
+ | `rian terminal <project>` | Start a shell in the project directory |
83
+ | `rian opencode <project>` / `rian kilocode <project>` | Run the coding CLI interactively |
84
+ | `rian chatgpt <project>` / `rian github <project>` | Open ChatGPT or the repository |
85
+ | `rian run <project> <command>` | Run a detected/custom command in the foreground |
86
+ | `rian remove <project> [--yes]` | Remove the Rian entry; keep all project files |
87
+ | `rian config` | Print the config path |
88
+ | `rian --help` / `rian --version` | Show help or version |
89
+
90
+ Project lookup accepts an ID, an exact name, or an unambiguous fuzzy name. Quote names with spaces. Ambiguous matches print the matching names, IDs, and paths rather than selecting one.
91
+
92
+ ## Keyboard
93
+
94
+ | Keys | Action |
95
+ | --- | --- |
96
+ | `↑` / `k`, `↓` / `j` | Previous / next project |
97
+ | `Enter`, `Ctrl+K` | Project actions / command palette |
98
+ | `/`, `Esc` | Search / leave search or close a modal |
99
+ | `v`, `o`, `Shift+K` | VS Code, OpenCode, KiloCode |
100
+ | `c`, `t`, `g` | ChatGPT, shell, GitHub |
101
+ | `r`, `d`, `p` | Run command / active process, command menu, process output |
102
+ | `Shift+G`, `Ctrl+R` | Git menu, rescan project files/tools/Git |
103
+ | `f`, `a`, `e`, `Delete` | Favorite, add, edit, remove entry |
104
+ | `?`, `q` / `Ctrl+C` | Help, quit |
105
+
106
+ `k` always moves up; **Shift+K** launches KiloCode. Typing in inputs takes priority over project shortcuts.
107
+
108
+ In **Edit Project**, use `Tab` or arrows to move fields, `Space` to toggle settings, and `Ctrl+S` to save. In the **command menu**, `Ctrl+N` adds a command, `Ctrl+E` edits it or creates an override, and `Ctrl+D` removes a custom command. Removing an override restores the detected command. In **process output**, `s` stops the process tree, `r` reruns a stopped command, `f` toggles output following, and arrows/Page Up/Page Down scroll. Leaving output keeps the command running; quitting asks to stop active commands.
109
+
110
+ ## Platforms and launchers
111
+
112
+ - **Windows:** native executable, PowerShell (`pwsh` when available), batch-based tool launchers, and process-tree stopping.
113
+ - **Linux:** native executable, the shell from `$SHELL` (fallback `/bin/sh`), `xdg-open` or `gio` for URLs, and process-group stopping.
114
+ - **macOS:** native Apple Silicon and Intel executables, the shell from `$SHELL` (fallback `/bin/sh`), `open` for URLs/apps, and process-group stopping. VS Code and ChatGPT can be found in the system or user Applications folder. Mac builds are cross-compiled; testing on a physical Mac remains outstanding.
115
+
116
+ The Terminal action opens an interactive shell in the current terminal and suspends Rian until `exit`. OpenCode, KiloCode, lazygit, and Git actions also suspend the interface and restore it on exit. This preserves interactive input and credential prompts without depending on one terminal emulator. ChatGPT uses a `chatgpt` launcher if found, then the macOS ChatGPT app when installed, otherwise the browser at `https://chatgpt.com`. It does not upload project files or attach project context automatically.
117
+
118
+ ## Configuration and detection
119
+
120
+ Rian creates its config automatically:
121
+
122
+ | Platform | Default path |
123
+ | --- | --- |
124
+ | Windows | `%AppData%\rian\config.json` |
125
+ | Linux | `$XDG_CONFIG_HOME/rian/config.json`, or `~/.config/rian/config.json` |
126
+ | macOS | `~/Library/Application Support/rian/config.json` |
127
+
128
+ Set `RIAN_CONFIG_HOME` to use a different directory. Detailed UI errors go to `rian.log` alongside the config, with one rotated backup. Writes use a temporary file and a cross-process lock; invalid configs are preserved. If a crash leaves `config.json.lock`, remove that **empty lock directory** only after all Rian instances have exited.
129
+
130
+ Detection checks files in the project root: `package.json`, package-manager declarations and npm/pnpm/yarn/Bun lockfiles, `go.mod`, `Cargo.toml`, Python manifests, and Flutter's `pubspec.yaml`. It recognizes Next.js, Vite, Expo, React Native, and React dependencies. Every portable package-script name becomes a runnable command. It also suggests Go, Cargo, Python/pytest, Django, and Flutter commands. Suggestions require the corresponding runtimes/dependencies; Rian never installs them. A declared package manager wins over lockfiles. Custom commands override detected commands by name. Use **Ctrl+R** after changing project files.
131
+
132
+ GitHub remotes support HTTPS, SCP-style SSH, `ssh://`, and Git protocol URLs. Non-GitHub repositories still show local Git information. Commands execute only when selected, in the selected directory, using `cmd.exe` on Windows and the user's shell on Linux/macOS. Background commands capture output without an interactive stdin; run interactive programs through the shell action or `rian run`.
133
+
134
+ ## Development
135
+
136
+ ```sh
137
+ gofmt -w cmd internal
138
+ go test ./...
139
+ go vet ./...
140
+ go build ./cmd/rian
141
+ ```
142
+
143
+ To build and check all six npm executables:
144
+
145
+ ```sh
146
+ npm run build
147
+ npm test
148
+ npm run check:package
149
+ npm pack
150
+ ```
151
+
152
+ The build stamps the package version into each executable, records SHA-256 checksums and architecture information, and gathers dependency licenses. Package checks verify every binary and execute the host build. The npm package includes the Go source and third-party license notices. Generated artifacts live under `dist/binaries/`.
153
+
154
+ Code lives in focused packages under `internal/`: `project`, `config`, `detect`, `git`, `tools`, `process`, `ui`, and `app`. Platform helpers have Windows/Unix implementations. The UI schedules disk scans and external work asynchronously. Tests cover storage and concurrency, remote parsing, real Git status, detection, fuzzy lookup, process cleanup, CLI flows, keyboard routing, and terminal-size bounds.
155
+
156
+ Contributions should preserve the local-first model, keep tool execution out of rendering, and include focused tests for behavioral changes. Cloud accounts, sync, remote sessions, and a plugin system are outside this first version.