diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..119487b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Nexvyn + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 1dde165..4de5053 100644 --- a/README.md +++ b/README.md @@ -1,70 +1,107 @@ # OneClick Kit -One-click maintenance for Windows and Linux. The scripts are grouped by job: - -| Folder | What it does | Runs in the one-click | -|---|---|---| -| `cleanup/` | Browser caches, system junk, developer caches (prunes pnpm and npm, clears yarn, bun, pip) | Yes, first | -| `update/` | The whole system: OS, drivers and firmware, store apps, all other apps | Yes, second | -| `install/` | Fresh PC: reinstall your apps, then set up the shared dev cache | No, run `first_install` on a new PC | - -``` -windows/ OneClickKit.exe (after build), build.bat, cleanup/, update/, install/, src/ -linux/ oneclick.sh, cleanup/, update/, install/, lib/ -docs/ shared-cache.md, convert-project-prompt.md +A Windows and Linux development-machine toolkit for fresh installation, shared caches, project cleanup and routine maintenance. Designed for small SSDs and reproducible project environments. + +## Quick start + +**One entry point:** `windows\oneclick.bat` or `bash linux/oneclick.sh`. Running without arguments is a read-only preview. Select `install`, `update`, `clean`, `cache`, or `all`; add `--apply` and explicitly confirm to execute. The `all` operation installs the approved profile, configures shared caches, updates managed software and offers a separate confirmation for eligible idle outputs. It never silently clears browsers, Trash, system files or shared download stores. + +| Workflow | Windows | Linux | +| --- | --- | --- | +| Preview everything (safe default) | `windows\oneclick.bat` | `bash linux/oneclick.sh` | +| All operations | `windows\oneclick.bat all --apply` | `bash linux/oneclick.sh all --apply` | +| Install approved tools | `windows\oneclick.bat install --apply` | `bash linux/oneclick.sh install --apply` | +| Configure shared caches | `windows\oneclick.bat cache --apply` | `bash linux/oneclick.sh cache --apply` | +| Preview idle cleanup | `windows\oneclick.bat clean` | `bash linux/oneclick.sh clean` | +| Apply idle cleanup | `windows\oneclick.bat clean --apply` | `bash linux/oneclick.sh clean --apply` | +| Update only | `windows\oneclick.bat update --apply` | `bash linux/oneclick.sh update --apply` | + +Run from a checked-out repository. On a fresh machine, the confirmed install operation can bootstrap Node.js through a supported package manager; otherwise install it from its official source. Project cache commands require Node.js. On Windows, update and all operations require an elevated terminal; the launcher refuses to proceed without it. No restart is initiated by the unified launcher. + +## Approved tools + +These are the 25 approved tools in [profiles/development.json](profiles/development.json). The installer never adds other standalone applications. + +| Tool | Selection ID | Type | +| --- | --- | --- | +| [Traycer](https://traycer.ai/download) | `traycer` | Desktop app | +| [Cursor](https://cursor.com/) | `cursor` | Desktop app | +| [Moon](https://moonrepo.dev/moon) | `moon` | CLI | +| [GitHub CLI](https://cli.github.com/) | `github-cli` | CLI | +| [Biome](https://biomejs.dev/) | `biome` | Project dependency | +| [Vitest](https://vitest.dev/) | `vitest` | Project dependency | +| [Testing Library](https://testing-library.com/) | `testing-library` | Project dependency | +| [Playwright](https://playwright.dev/) | `playwright` | Project dependency | +| [Lighthouse](https://developer.chrome.com/docs/lighthouse/) | `lighthouse` | On demand | +| [Tauri](https://tauri.app/) | `tauri` | Project dependency | +| [Swift](https://swift.org/) | `swift` | Toolchain | +| [Kotlin](https://kotlinlang.org/) | `kotlin` | Toolchain | +| [Maestro](https://docs.maestro.dev/) | `maestro` | CLI | +| [Helium Browser](https://helium.computer/) | `helium` | Desktop app | +| [Cloudflare Kitesurf](https://developers.cloudflare.com/browser-run/kitesurf/) | `kitesurf` | Remote service | +| [Node.js](https://nodejs.org/en/download) | `nodejs` | Toolchain | +| [Notion](https://www.notion.so/desktop) | `notion` | Desktop app (Windows desktop; web on Linux) | +| [Discord](https://discord.com/download) | `discord` | Desktop app | +| [VLC](https://www.videolan.org/vlc/) | `vlc` | Desktop app | +| [7-Zip](https://www.7-zip.org/download.html) | `7zip` | Desktop app | +| [LocalSend](https://localsend.org/) | `localsend` | Desktop app | +| [FFmpeg](https://ffmpeg.org/download.html) | `ffmpeg` | CLI | +| [Figma](https://www.figma.com/downloads/) | `figma` | Desktop app (Windows desktop; web on Linux) | +| [WizTree](https://diskanalyzer.com/) | `wiztree` | Desktop app (Windows desktop only) | +| [Syncthing](https://syncthing.net/downloads/) | `syncthing` | Desktop app | + +Install adapters currently cover selected WinGet packages on Windows and supported apt packages on Linux. Tools without an adapter are reported with official links; project dependencies remain project-pinned, and remote services require separate setup. The all-tools option installs only supported adapters, not every item in the catalog. Required compiler/runtime prerequisites are documented separately by each tool. The old exported application setup is still available through the separate `save_my_apps` and `install_apps` scripts; it is not part of the curated profile. + +## Shared development cache + +Shared package downloads (npm, pnpm, Yarn, Bun, pip and uv), eligible Rust compiler artifacts (sccache), and supported Gradle and browser downloads are configured centrally. Project-specific Rust build outputs are isolated by workspace/worktree. The project runner sets the appropriate target directory; normal Cargo invocations retain their existing configuration. + +| Budget | Target | +| --- | --- | +| Aggregate disposable development data | 35 GiB (warning at 25 GiB) | +| Cargo target per project | 5 GiB (warning at 4 GiB) | +| Shared sccache | 5 GiB | +| Recommended free space | 40 GiB | +| Idle dependencies | 24 hours before eligible for review | +| Idle build outputs | 48 hours before eligible for review | + +Budgets are retention targets, not hard quotas; active builds must be allowed to complete. + +```sh +node tools/devcache.mjs activate /path/to/project +node tools/devcache.mjs run /path/to/project -- cargo build +node tools/devcache.mjs status +node tools/devcache.mjs deactivate /path/to/project +node tools/devcache.mjs plan ``` -## Windows +Activation restores missing dependencies from the project's existing lockfile. Pin active or important projects to keep their generated files. Use [shared-cache.md](docs/shared-cache.md) for details and [convert-project-prompt.md](docs/convert-project-prompt.md) for existing projects. -**One click** +## One-click idle cleanup -1. Run `windows\build.bat` once. It creates `windows\OneClickKit.exe` with the C# compiler that ships with Windows, so nothing needs to be installed. -2. Double-click `OneClickKit.exe` and accept the admin prompt. -3. A 10-second countdown starts. Press any key to start now, or Esc to cancel. -4. It runs browser cleanup, Windows cleanup, developer cache cleanup, then updates. At the end it shows a summary and asks before restarting. +The clean-idle launchers preview registered inactive projects and their eligible generated dependency and build directories. With `--apply` they show the exact paths and ask for explicit interactive confirmation. Close editors, dev servers, tests and watches; preserve release artifacts and custom files before confirming. Active, pinned, recently used or unsafe paths are skipped. Shared package download stores are preserved to make restores faster. No unattended bulk deletion. -**What it touches** +## Update only -- Browser cleanup closes Chrome, Edge, Brave and Firefox and clears their cache for every profile. It never deletes history, cookies, passwords, logins or bookmarks. -- Windows cleanup clears your temp folder, Windows temp, old Windows Update downloads, the Delivery Optimization cache, crash reports and dumps, Windows logs older than 7 days, and the Recycle Bin. It reports how much space it freed. It does not clear Prefetch, because Windows uses Prefetch to start apps faster. -- Developer cleanup runs `pnpm store prune` (removes only packages no project uses), `npm cache verify` (removes only broken or unused entries), `yarn cache clean`, `bun pm cache rm` and `pip cache purge` for the tools you have. The npm cache and pnpm store can be your [shared cache](docs/shared-cache.md), so they are only pruned, never wiped. -- Updates cover Microsoft Defender definitions, Windows Update (including drivers and other Microsoft products, through PSWindowsUpdate, which is installed automatically), Microsoft Store apps and every winget app. It never restarts by itself. +Run the update-only launcher with `--apply` to update without invoking cleanup. -**Fresh PC** +- Windows: Windows Update and supported drivers, Defender definitions, Microsoft Store update requests and WinGet-managed applications. +- Linux: the detected apt, dnf, pacman or zypper package manager, Flatpak, Snap and supported firmware through fwupd. -1. On your old PC, run `windows\install\save_my_apps.bat`. It writes `apps.json` next to the script. Commit that file if you want it in the repo. -2. On the new PC, clone the repo and run `windows\install\first_install.bat`. It installs the apps from `apps.json`, then runs `setup_shared_cache.bat`. That creates the [shared dev cache](docs/shared-cache.md), installs `sccache` and `pnpm` if they are missing, and points pnpm, npm, Cargo, sccache, Gradle and Puppeteer at it. -3. Restart the PC, then run `pnpm install` in each project. To move an existing project onto the shared cache, paste [convert-project-prompt.md](docs/convert-project-prompt.md) into that project's AI. +Coverage depends on installed package managers and supported devices; independently installed apps may require their own updater. Restart is never automatic without user confirmation. -Each part also runs on its own: `install_apps.bat`, `setup_shared_cache.bat`. +## Optional legacy system cleanup -## Linux +The existing browser/system maintenance helpers remain separate from the unified launcher. They can close browser processes and clear system junk including Trash or Recycle Bin, so use their dry-run options and explicitly review them. The legacy Windows executable, built with `windows\build.bat`, makes no changes when opened without arguments and requires explicit confirmation with `--apply` for its combined maintenance workflow. -Supports apt (Ubuntu, Debian, Mint, Pop!_OS), dnf (Fedora), pacman (Arch, Manjaro) and zypper (openSUSE), plus Flatpak, Snap and fwupd firmware updates. +## Development and tests -```bash -git clone https://github.com/Nexvyn/OneClick-Kit.git -cd OneClick-Kit -bash linux/oneclick.sh +```sh +node --test tests/development.test.mjs ``` -Run it as your normal user, not with `sudo`. It asks for your password once. It runs the same four steps as on Windows, using your distro's tools, then shows a summary and asks before restarting. - -**Fresh PC:** run `bash linux/install/save_my_apps.sh` on the old machine and commit the `packages-*.txt`, `flatpak.txt` and `snap.txt` files if you want them in the repo. On the new machine run `bash linux/install/first_install.sh`. It installs the apps, then sets up the [shared dev cache](docs/shared-cache.md) (settings go in a marked block in `~/.profile`). - -## Preview first - -Every script has a preview mode that changes nothing and prints what it would do: - -- Windows: `OneClickKit.exe --dry-run`, or any script with `/dryrun`, for example `windows\cleanup\clean_windows_junk.bat /dryrun` -- Linux: `bash linux/oneclick.sh --dry-run`, or any script with `--dry-run` - -## Run one step - -Every script also works on its own. Double-click a `.bat` file, or run `bash linux//