Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ jobs:
hash -r
./2-GenSoftware.sh

oracular-basic:
name: Ubuntu Oracular (26.04) - Basic Setup + GenSoftware
runs-on: ubuntu-latest
resolute-basic:
name: Ubuntu Resolute Raccoon (26.04) - Basic Setup + GenSoftware
runs-on: ubuntu-26.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
27 changes: 22 additions & 5 deletions 1-BasicSetUp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ if [[ ! -n $CIINSTALL ]]; then
fi

# Terminal multiplexer: byobu (tmux)
execute sudo apt-get install unzip git byobu magic-wormhole openssh-server python3-pip htop curl expect neofetch ffmpeg software-properties-common git-delta git-lfs -y
execute sudo apt-get install unzip git byobu magic-wormhole openssh-server python3-pip htop curl expect ffmpeg software-properties-common git-delta git-lfs -y
# neofetch is gone from Ubuntu 26.04; fastfetch is its successor
if apt-cache show neofetch >/dev/null 2>&1; then
execute sudo apt-get install neofetch -y
else
execute sudo apt-get install fastfetch -y
fi
if ! is_ci; then
execute sudo apt-get install xrdp -y
execute sudo apt-get install xclip xsel -y # this is used for the copying tmux buffer to clipboard buffer
Expand Down Expand Up @@ -205,12 +211,19 @@ else
sudo systemctl restart docker
fi

## Install Node.js 24 (LazyVim plugins, the coding-setup console and the agent CLIs need it)
node_major="$(node -p 'process.versions.node.split(".")[0]' 2>/dev/null || echo 0)"
if [ "$node_major" -ge 24 ]; then
echo "Node.js $(node -v) already installed, skipping installation"
else
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash -
sudo apt install -y nodejs
fi

## Install Neovim with all essential lazyvim plugins
if [ -x "$(command -v nvim)" ] && [ -d ~/.config/nvim ]; then
echo "Neovim and LazyVim already installed, skipping installation"
else
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
sudo apt install -y build-essential "lua5.1" luarocks ripgrep fd-find fzf

mkdir -p ~/.local/bin
Expand All @@ -221,8 +234,12 @@ else
rm -rf ~/.local/share/nvim/
rm -rf ~/.config/nvim/

sudo add-apt-repository ppa:neovim-ppa/unstable -y
sudo apt update
# LazyVim needs Neovim 0.11.2 or newer. Releases whose archive ships less get the unstable PPA.
nvim_candidate="$(apt-cache policy neovim | awk '/Candidate:/ {print $2}')"
if [ -z "$nvim_candidate" ] || [ "$nvim_candidate" = "(none)" ] || dpkg --compare-versions "$nvim_candidate" lt 0.11.2; then
sudo add-apt-repository ppa:neovim-ppa/unstable -y
sudo apt update
fi
sudo apt install -y neovim

git clone https://github.com/LazyVim/starter ~/.config/nvim
Expand Down
5 changes: 4 additions & 1 deletion 2-GenSoftware.sh
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,10 @@ fi
if [ -x "$(command -v xhisper)" ]; then
echo "xhisper already installed, skipping it"
else
execute sudo apt-get install -y build-essential pipewire pipewire-utils jq ffmpeg wl-clipboard python3-gi gir1.2-gtk-3.0 bc
# The pipewire tools package is named pipewire-bin or pipewire-utils depending on the release.
pipewire_tools=pipewire-bin
if apt-cache show pipewire-utils >/dev/null 2>&1; then pipewire_tools=pipewire-utils; fi
execute sudo apt-get install -y build-essential pipewire "$pipewire_tools" jq ffmpeg wl-clipboard python3-gi gir1.2-gtk-3.0 bc
xhisper_src="$(mktemp -d)"
# This branch is the fork actually in use. abszar/main does not carry the conda and X11 fixes.
git clone --depth 1 --branch fix/conda-env-and-clipboard-detection https://github.com/rsnk96/xhisper-ubuntu-linux.git "$xhisper_src"
Expand Down
10 changes: 10 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Agents

This repository is two layers.

1. `1-BasicSetUp.sh` and `2-GenSoftware.sh` rebuild a desktop Ubuntu install. Follow `README.md`. Do not run those scripts as part of an unrelated code change.
2. `coding-setup/` is the agent workstation: CLIProxy on `127.0.0.1:8317`, the quota console, T3 Code pointed at an isolated Claude home, and Tailscale Serve so other devices of the same user start sessions on this machine.

When the task is to rebuild that workstation, replicate it on a new laptop, or change how Claude, T3, or the proxy are wired, read [coding-setup/AGENTS.md](coding-setup/AGENTS.md) and follow it. That directory is self-contained and can be split into its own repository later.

Do not commit OAuth files, API keys, management keys, or a filled-in `config.yaml`. The copies under `coding-setup/config/` are templates.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ These are the scripts that I use to set my Ubuntu up as quick as possible. Feel

## Build Status:

Every script is stable and validates with [CI](https://github.com/features/actions) to make sure everything works as expected. The scripts are tested on Ubuntu 24.04 (Noble) and 26.04 (Oracular) LTS releases.
Every script is stable and validates with [CI](https://github.com/features/actions) to make sure everything works as expected. The scripts are tested on Ubuntu 24.04 (Noble) and 26.04 (Resolute Raccoon) LTS releases.

You can see the build results in the [Actions tab](https://github.com/rsnk96/Ubuntu-Setup-Scripts/actions) of this repository.

## Usage instructions
First download/clone this repository

Then execute them in the terminal in the sequence of filenames using `./1-BasicSetUp.sh` and `./2-GenSoftware.sh`.

The agent workstation (CLIProxy, the quota console, T3 Code, and Tailscale) is a separate layer. After the two scripts, `cd coding-setup && ./install.sh` builds it and `./check.sh` verifies it. Its source, sanitized configs, and notes live in [`coding-setup/`](coding-setup/README.md). An agent rebuilding that stack should start at [`coding-setup/AGENTS.md`](coding-setup/AGENTS.md).
* `1-BasicSetUp.sh` - Sets up terminal configuration (Zsh + Zim), download accelerator (aria2), Anaconda Python, shell aliases, Docker, Nvidia drivers (if detected), Neovim with LazyVim, and other essential tools. **Note:** After running this script, you should reboot your PC if you have an Nvidia GPU so that the display driver loads properly.
* `2-GenSoftware.sh` - Installs general purpose software including VS Code, Cursor IDE, browsers (Brave, Chrome), GitHub and GitLab CLIs, the AWS Session Manager plugin, xhisper, dltop, herdr, Snap VLC and Surfshark, Stremio, and other utilities.

Expand Down Expand Up @@ -67,7 +69,7 @@ Log out and back in once both scripts finish. Reboot instead if an Nvidia driver
* **Adding a new OS user:** If setting up multiple users on the OS, try to use the script `./add_new_user.sh` in this repo. It will set the correct settings for them to also benefit from zsh, conda, etc.
* Make sure that your system time and date is correct and synchronized before running the scripts, otherwise this will cause failure while trying to download the packages.
* These scripts are written and tested on the following configurations:
* Ubuntu 24.04 (Noble) and 26.04 (Oracular) LTS releases
* Ubuntu 24.04 (Noble) and 26.04 (Resolute Raccoon) LTS releases
* 64-bit Intel/AMD Processors
* NVIDIA GPUs (drivers will be automatically installed if detected)

Expand Down
43 changes: 43 additions & 0 deletions coding-setup/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Coding setup agents

When the user wants this workstation rebuilt, moved to a new machine, or wired the same way again, run `./install.sh` and follow [README.md](README.md). The script is the procedure, the README explains it, and this file is the contract. If they disagree, trust the script for commands and this file for what you must not do.

This directory is the source of truth and can stand alone as its own repository. The parent `AGENTS.md` only points here.

## Do this

- On a blank Ubuntu machine, run the parent `1-BasicSetUp.sh` and `2-GenSoftware.sh` first, when those scripts are present.
- Run `./install.sh`. On a terminal it pauses to offer the Claude login (a browser on that machine, once per subscription). Where it could not, run `./install.sh login claude` per subscription (`codex` only if the user asks), then `./check.sh`. Report the real output of `check.sh`; a WARN is not a pass.
- Prefer re-running one phase to editing a deployed file by hand. Phases are idempotent and merge into existing settings.
- Keep the proxy on `127.0.0.1:8317` with `management.allow-remote: false`, and T3 on loopback (`serverExposureMode: "local-only"`). Tailscale Serve is published by T3 itself.
- Leave `CLAUDE_CONFIG_DIR` pointed at `~/.claude-cliproxy` for the login session. `install.sh` writes `~/.config/environment.d/claude-cliproxy.conf`. It is read at login, and T3's history lookup uses it instead of `providers.claudeAgent.homePath`.
- CLIProxyAPI is not pinned: `install.sh proxy` installs the newest release and checks the sha256 GitHub publishes for the asset. After an upgrade, run `npm test` in `cliproxy-console/` and read the board for an Anthropic or management-API error banner.
- Run `npm test` in `cliproxy-console/` after any console change. The console runs from the repo through `~/.local/share/cliproxy-console`, so `systemctl --user restart cliproxy-console.service` picks the edit up.
- Change the README, `install.sh`, `check.sh` and the units together. A behaviour that exists in only one of them is a bug.

## Do not do this

- Do not copy `~/.cli-proxy-api/*.json`, `~/.claude-cliproxy/.credentials.json`, `keys.env`, `cliproxy-console/data/settings.json`, or a filled-in `config.yaml` into the repository.
- Do not print management keys, client API keys, OAuth tokens, or Tailscale login URLs in chat, commit logs, or a pasted process listing. Do not put a key on a `curl` command line.
- Do not run `tailscale serve` by hand against T3. Do not publish port 8317 or 8787 with Serve or Funnel. Do not enable Funnel, an exit node, or subnet routes.
- Do not set `server.host` to an empty string or `0.0.0.0`, and do not set T3's `serverExposureMode` to `network-accessible`.
- Do not unset `CLAUDE_CONFIG_DIR` or point it at `~/.claude`. Session fork will not see transcripts written under the isolated home.
- Do not replace `~/.t3/userdata/settings.json` or `desktop-settings.json` wholesale. Edit `desktop-settings.json` only while T3 is closed; the app rewrites it on exit.
- Do not start the console by hand (`node server.mjs`) and leave it running. It must be the systemd unit, or it dies with the shell that started it.
- Do not point the console unit at a Node that cannot import `node:sqlite`. The unit's `ExecStartPre` will refuse to start; fix the Node, not the check.
- Do not `enable-linger` or enable autologin unless the user wants services to outlive a desktop login. Say that the T3 desktop app still stops at logout.
- A Claude login callback from a dead process cannot be redeemed. Start a new `./install.sh login claude`.

## Files an agent may edit

| Change | Where |
| --- | --- |
| Quota board behaviour | `cliproxy-console/` |
| Default proxy routing | `config/cli-proxy-api.config.yaml` |
| Units | `config/*.service` |
| Claude overlay | `config/claude-cliproxy.settings.example.json` |
| Login-session `CLAUDE_CONFIG_DIR` | `config/claude-cliproxy.environment.conf` |
| T3 keys this stack owns | `config/t3-settings.snippet.json`, `config/t3-desktop-settings.snippet.json` |
| Login autostart | `config/t3code-autostart.desktop` |
| Provisioning and verification | `install.sh`, `check.sh` |
| Rebuild steps | `README.md` and this file, together |
Loading
Loading