@gengjiawen/os-init
v1.19.0
Published
[](https://www.npmjs.com/package/@gengjiawen/os-init)
Readme
os-init CLI
A CLI tool to quickly configure development tools and environments.
Usage
Setup Dev Environment
pnpx @gengjiawen/os-init set-dev <SSH_PUBLIC_KEY>Sets up a Docker-based development environment with SSH access. This command will:
- Copy
dev-setupdirectory to your current directory (or specify with-t, --target <dir>) - Configure SSH public key in Dockerfile
- Automatically run
docker-compose build && docker-compose up -d(if docker-compose is available) - Display SSH connection command with your local IP address
Example:
pnpx @gengjiawen/os-init set-dev "ssh-rsa AAAAB3NzaC1yc2..."Setup Android Development Environment
pnpx @gengjiawen/os-init set-androidSets up a complete Android development environment on macOS and Linux. This command will:
- Install Android SDK to
~/Android(or custom path with--android-home <path>) - Download and install Android SDK Command-line Tools, Platform Tools, Build Tools, CMake, and NDK
- Automatically accept Android SDK licenses
- Configure environment variables in your shell config (~/.bashrc, ~/.zshrc, or ~/.config/fish/config.fish)
- Works on both macOS (Intel and Apple Silicon) and Linux
- No sudo access required
Example:
# Custom installation path
pnpx @gengjiawen/os-init set-android --android-home ~/my-android-sdk
# Skip environment variable configuration
pnpx @gengjiawen/os-init set-android --skip-env-varsSetup Fish Shell Import Script
pnpx @gengjiawen/os-init set-fishSets up Fish shell to automatically import environment variables from .bashrc. This command will:
- Detect if Fish shell is installed (by checking for
~/.config/fish/config.fish) - Add an import script to
~/.config/fish/config.fishthat reads environment variables from~/.bashrc - Automatically convert Bash-style environment variable syntax to Fish shell syntax
- Handle PATH variables correctly (converting
:separators to spaces) - Skip if the import script already exists
This is useful when you have environment variables configured in .bashrc but want to use them in Fish shell without duplicating configuration.
Example:
pnpx @gengjiawen/os-init set-fishGenerate Mihomo Config
pnpx @gengjiawen/os-init set-clash
pnpx @gengjiawen/os-init set-clash --download
pnpx @gengjiawen/os-init set-clash --target ~/mihomo/config.ymlGenerates a Mihomo config.yml from the built-in template. This command will:
- Write
./config.ymlin the current directory by default - Download the Mihomo binary to the config directory when
--downloadis set - Support a custom output path with
-t, --target <path>
After generating the config, you can keep Mihomo running with pm2:
pm2 start mihomo --name mihomo -- -f /absolute/path/to/config.yml && pm2 saveConfigure Claude Code
pnpx @gengjiawen/os-init set-cc <API_KEY>Configures Claude Code with your API key. This command will:
- Write
~/.claude/settings.json - Write VSCode Claude extension config in user
settings.json - Install global tool:
@anthropic-ai/claude-code
Configure Codex CLI
pnpx @gengjiawen/os-init set-codex <API_KEY>Configures Codex CLI with your API key. This command will:
- Write
~/.codex/config.toml - Write
~/.codex/auth.json - Install global tool:
@openai/codex
Configure OpenCode CLI
pnpx @gengjiawen/os-init set-opencode <API_KEY>Configures OpenCode CLI with your API key. This command will:
- Write
~/.config/opencode/opencode.json - Install global tool:
opencode-ai(providesopencodecommand)
Configure Raycast AI
pnpx @gengjiawen/os-init set-raycast-ai <API_KEY>Configures Raycast AI providers with your API key. This command will:
- Write
~/.config/raycast/ai/providers.yaml
Project generated by gengjiawen/ts-scaffold
