A set of scripts to quickly configure a new computer (macOS, Windows, Linux).
Download the latest release and extract:
curl -fsSL -o init-computer.tar.gz \
https://github.com/axgd-code/ok_computer/releases/download/$(curl -s https://api.github.com/repos/axgd-code/ok_computer/releases/latest | grep tag_name | cut -d'"' -f4)/init-mac-scripts.tar.gz
tar -xzf init-computer.tar.gzRun the installer using the included okc helper:
chmod +x okc
./okc initOr install okc system-wide first and then run:
chmod +x okc install_okc.sh
sudo ./install_okc.sh
okc initgit clone https://github.com/axgd-code/ok_computer.git
cd ok_computer
chmod +x okc install_okc.sh
./install_okc.sh # optional: install okc into your PATH
okc initsrc/: main scripts and helperssrc/init.sh: OS detection and orchestratorsrc/init_conf_macOs.sh,src/init_conf_windows.sh: platform-specific stepssrc/packages.conf: package list used by installerssrc/app.sh: app management helper (install/add/remove/list)src/dotfiles.sh: dotfiles sync and symlink managementsrc/wifi_from_kdbx.sh: import Wi‑Fi profiles from KeePassXC vaultssrc/update.sh: update packages and toolssrc/setup_auto_update.sh: configure automated updates
test/: local checks and scripts
Copy .env.example to .env.local and edit the values to match your setup.
Important variables:
SYNC_DIR: path to your synchronized folder (OneDrive, Synology Drive, Dropbox, ...)PACKAGES_CONF_DIR: optional remote folder to keep a sharedpackages.confOBSIDIAN_VAULT,VSCODE_CONFIG: optional paths for Obsidian or VS Code sync
Automatic update schedule (optional):
AUTO_UPDATE_HOUR(0-23, default: 21)AUTO_UPDATE_MINUTE(0-59, default: 0)
Example .env.local:
AUTO_UPDATE_HOUR=21
AUTO_UPDATE_MINUTE=0src/setup_auto_update.sh will read .env.local and configure:
- macOS: a
launchdagent - Windows: a scheduled task via
schtasks - Linux: a cron job
The okc script dispatches to src/<command>.sh. Examples:
Dotfiles:
okc dotfiles init # initialize dotfiles sync
okc dotfiles setup # create symlinks
okc dotfiles sync # push changes to sync folder
okc dotfiles restore # restore from sync folder
okc dotfiles status # show statusApp manager:
okc app install firefox
okc app uninstall firefox
okc app list
okc app add some-app
okc app remove some-appAutomatic updates:
okc setup_auto_update
# or
bash src/setup_auto_update.shWi‑Fi import from KeePassXC:
okc wifi_from_kdbx --db /path/to/vault.kdbx --group "Wi-Fi"
# or
bash src/wifi_from_kdbx.sh --db /path/to/vault.kdbx --group "Wi-Fi"src/packages.conf lists packages and the cross-platform mappings used by the installers. You can keep a personal copy of this list in a synced folder and point PACKAGES_CONF_DIR at it.
App manager helpers (src/app.sh) can add or remove entries from packages.conf, install/uninstall apps, and check availability across platforms.
Keep your dotfiles in a synced directory (OneDrive, Synology Drive, Dropbox...) and use src/dotfiles.sh to manage symlinks and restore files.
Common commands:
bash src/dotfiles.sh init
bash src/dotfiles.sh setup
bash src/dotfiles.sh sync
bash src/dotfiles.sh restore
bash src/dotfiles.sh statusYou can also sync specific targets (packages, Obsidian vault, VS Code) using subcommands.
Run local checks:
bash test/test.shSee LICENSE
If you want, I can also:
- prepare a short
CONTRIBUTING.mdwith how to test and add packages, or - update
ui/README.mdto match this style.
Optional `.env.local` variables (used by [src/init.sh](src/init.sh) to run import automatically at the end of initialization):
- `WIFI_KDBX_DB="/path/to/vault.kdbx"`
- `WIFI_KDBX_GROUP="Wi‑Fi"` (default)
- `WIFI_KDBX_KEY_FILE="/path/to/keyfile.key"` (if needed)
- `WIFI_KDBX_ASK_PASS=1` to force interactive password prompt (do not store passwords in files/env)
- `WIFI_KDBX_DRY_RUN=1` to simulate actions
Useful options:
- `--key-file <file>` : if the vault uses a keyfile
- `--dry-run` : show actions without modifying the system
- Authentication: let keepassxc-cli prompt for the password, or export `KEEPASSXC_CLI_PASSWORD` before running the script
- See the script: [src/wifi_from_kdbx.sh](src/wifi_from_kdbx.sh)
## Tests des scripts
Exécuter les vérifications locales :
```bash
bash test/test.sh
Le script vérifie :
- Syntaxe bash :
bash -nsur tous les scripts - Lint :
shellchecksi disponible - Structure : présence de répertoires et fichiers requis
- Format packages.conf : colonnes avec séparateurs
|valides - VERSION : format sémantique
X.Y.Z - Permissions : scripts marqués comme exécutables
Créer une archive locale des scripts :
tar -czf init-mac-scripts.tar.gz -C src .- .github/workflows/ci.yml : à chaque push, compile et publie les scripts comme artefact
- .github/workflows/release.yml : à chaque tag
v*, crée une release GitHub avec les scripts
- Mettre à jour VERSION
- Commiter
- Créer un tag et pousser :
git tag v1.0.1
git push origin v1.0.1GitHub Actions crée la release automatiquement.
Voir le fichier LICENSE
Le script okc permet d'appeler rapidement les scripts présents dans src/ sans préfixer par bash src/....
Exemples :
okc init # lance src/init.sh
okc app install firefox # lance src/app.sh install firefox
okc dotfiles sync # lance src/dotfiles.sh sync
okc packages sync # alias géré via src/dotfiles.sh packagesInstallation recommandée (copie/symlink dans votre PATH) :
chmod +x okc install_okc.sh
./install_okc.sh
# ou (installation système)
sudo ./install_okc.shLe script install_okc.sh installe okc dans /usr/local/bin si possible, sinon dans ~/.local/bin et ajoute ~/.local/bin à ~/.profile si nécessaire.
Vous pouvez aussi installer manuellement :
chmod +x okc
sudo ln -sf "$PWD/okc" /usr/local/bin/okcAprès installation, exécutez okc depuis n'importe où.