### Install fauxnix for Kimi Code Source: https://github.com/20000419/fauxnix/blob/main/docs/examples/kimi.md Idempotent install command that writes the same keys as the manual JSON block below. Requires Node.js ≥ 22.20.0 and PowerShell 5.1. ```bash fauxnix install --kimi ``` -------------------------------- ### Install fauxnix for Qwen Code Source: https://github.com/20000419/fauxnix/blob/main/README.md Installs the fauxnix MCP server for Qwen Code. The installer preserves the rest of `settings.json` and writes the same absolute launcher. ```bash fauxnix install --qwen ``` -------------------------------- ### Generated Qwen settings.json shape Source: https://github.com/20000419/fauxnix/blob/main/docs/examples/qwen.md Example of the MCP server configuration written by 'fauxnix install --qwen'. Paths shown are examples; use the values written by the installer rather than copying from another machine. ```json { "mcpServers": { "fauxnix": { "command": "C:\\Program Files\\nodejs\\node.exe", "args": [ "C:\\Users\\you\\AppData\\Roaming\\npm\\node_modules\\fauxnix-cli\\dist\\index.js", "mcp" ] } } } ``` -------------------------------- ### Install, test, build, and live-check commands Source: https://github.com/20000419/fauxnix/blob/main/README.md Run the development workflow: install dependencies, run the unit and integration test suite (Windows-only, auto-skipped elsewhere), optionally run the same suite through PowerShell 7 by setting FAUXNIX_PS, build the project, and perform a quick live check with npx tsx. ```powershell npm install npm test # unit + real-PowerShell integration suite (Windows only, auto-skipped elsewhere) $env:FAUXNIX_PS = 'pwsh'; npm test # same suite through PowerShell 7 npm run build npx tsx scratch/run.mjs "any bash command" # quick live check ``` -------------------------------- ### Install and manage the native shell facade for Claude Code Source: https://github.com/20000419/fauxnix/blob/main/README.md Builds a fauxnix-backed bash.exe (~85 MB) and sets CLAUDE_CODE_GIT_BASH_PATH; restart Claude Code after. `fauxnix doctor` reports the launcher status. `fauxnix install --claude-shell-off` restores the previous setting. The launcher is a copy of your own node.exe with the facade bundle injected via Node SEA. ```bash fauxnix install --claude-shell # builds a fauxnix-backed bash.exe (~85 MB) and sets # CLAUDE_CODE_GIT_BASH_PATH; restart Claude Code after fauxnix doctor # reports the launcher status fauxnix install --claude-shell-off # restores the previous setting ``` -------------------------------- ### Verify fauxnix installation Source: https://github.com/20000419/fauxnix/blob/main/docs/examples/qwen.md Run 'fauxnix check' and 'fauxnix doctor' to verify the installation. Encoding is UTF-8 by default (FAUXNIX_NATIVE_ENCODING unset). 'doctor' reports whether Qwen's fauxnix entry uses the generated absolute launcher. Restart Qwen Code to reload MCP. ```bash fauxnix check fauxnix doctor ``` -------------------------------- ### PowerShell host startup command Source: https://github.com/20000419/fauxnix/blob/main/SECURITY.md Shows the exact command line used to start the resident PowerShell host. The host is launched with -NoProfile, -NonInteractive, and -ExecutionPolicy Bypass, using a temporary script file. The executable is either the fixed 5.1 path or an absolute pwsh.exe selected at session construction. ```text -NoProfile -NonInteractive -ExecutionPolicy Bypass -File /fauxnix--host.ps1 ``` -------------------------------- ### Install fauxnix-cli and verify with doctor Source: https://github.com/20000419/fauxnix/blob/main/README.md Installs the fauxnix-cli npm package globally, configures an MCP harness (Claude, Codex, OpenCode, Kimi, or Qwen), and runs doctor to verify encoding, harness config, and MCP round-trip. Idempotent; prints exactly what changed. Requires Windows with PowerShell 5.1+ and Node.js ≥ 22.20.0. Node 18/20 are unsupported in v2. ```bash npm install -g fauxnix-cli fauxnix install --claude # or --codex / --opencode / --kimi / --qwen fauxnix doctor # verifies encoding, harness config, and MCP round-trip ``` -------------------------------- ### Install fauxnix for Claude Code Source: https://github.com/20000419/fauxnix/blob/main/docs/examples/claude.md Idempotent installation command that writes the same keys as the manual JSON block. Requires Windows, Node.js ≥ 22.20.0, and PowerShell 5.1. ```bash fauxnix install --claude ``` -------------------------------- ### Install fauxnix for OpenCode via CLI Source: https://github.com/20000419/fauxnix/blob/main/docs/examples/opencode.md Preferred idempotent installation that writes the same configuration keys as the manual JSON block. Requires Windows, Node.js ≥ 22.20.0, and the fauxnix-cli package installed globally. ```bash fauxnix install --opencode ``` -------------------------------- ### Set FAUXNIX_PS to pwsh and run fauxnix check Source: https://github.com/20000419/fauxnix/blob/main/docs/powershell-7.md Install PowerShell 7 so pwsh.exe is in a non-empty, absolute PATH directory, then set the FAUXNIX_PS environment variable before starting fauxnix. The check command must report the resolved absolute pwsh.exe path and 'edition : Core'. ```powershell $env:FAUXNIX_PS = 'pwsh' fauxnix check ``` -------------------------------- ### Send a batch plan to the bash_batch MCP tool Source: https://github.com/20000419/fauxnix/blob/main/README.md Example JSON payload for the `bash_batch` MCP tool. It compiles every step before execution, runs the plan atomically in one session, and returns one structured result per step in a single MCP round trip (stops on first nonzero exit by default). ```json { "steps": [ { "id": "write", "command": "printf 'a\\r\\nb' > data.txt" }, { "id": "measure", "command": "wc -c data.txt" } ] } ``` -------------------------------- ### CLI equivalent for smoke test Source: https://github.com/20000419/fauxnix/blob/main/docs/examples/kimi.md Runs the same command as the smoke test via CLI, producing the same stdout. ```bash fauxnix 'echo hi' ``` -------------------------------- ### Install fauxnix for Codex Source: https://github.com/20000419/fauxnix/blob/main/docs/examples/codex.md Preferred idempotent installation that writes the same keys as the manual config block. Requires Windows, Node.js ≥ 22.20.0, and PowerShell 5.1. ```bash fauxnix install --codex ``` -------------------------------- ### Install fauxnix-cli@2.0.0 after publication Source: https://github.com/20000419/fauxnix/blob/main/docs/releases/v2.0.0.md Install the explicit published version globally and verify with --version and doctor. Requires Node.js 22.20.0 or later; Node 18/20 are rejected by the CLI and engine-strict installation. ```powershell npm install -g fauxnix-cli@2.0.0 fauxnix --version fauxnix doctor ``` -------------------------------- ### Smoke test commands for MCP bash tool Source: https://github.com/20000419/fauxnix/blob/main/docs/examples/qwen.md Run each line through the MCP 'bash' tool (not PowerShell). v0.10.0-safe: no while/until/case, no arrays. Comments are expected stdout; every command exits 0. The 'for' loop prints two lines (a then b). CLI equivalent: 'fauxnix 'echo hi''. ```bash echo hi # hi printf '%s=%d\n' x 42 # x=42 echo $(echo nested) # nested echo $((1+1)) # 2 unset X; echo ${X:-def} # def if true; then echo YES; fi # YES for x in a b; do echo $x; done # a\nb false || echo FELLBACK # FELLBACK echo hi | grep hi # hi true; echo $? # 0 ``` -------------------------------- ### Add fauxnix MCP server to Claude Code Source: https://github.com/20000419/fauxnix/blob/main/README.md Registers the fauxnix MCP server with Claude Code using the `claude mcp add` command. The `fauxnix mcp` command starts the stdio server. ```bash claude mcp add fauxnix -- fauxnix mcp ``` -------------------------------- ### Install fauxnix-cli from tarball before publication Source: https://github.com/20000419/fauxnix/blob/main/docs/releases/v2.0.0.md Until the v2.0.0 release is published, install the supplied tarball instead of the npm package. The tarball path is ./fauxnix-cli-2.0.0.tgz. ```powershell npm install -g ./fauxnix-cli-2.0.0.tgz ``` -------------------------------- ### Install fauxnix-cli via npm Source: https://github.com/20000419/fauxnix/blob/main/CHANGELOG.md Install the fauxnix-cli package globally using npm. This command appears in both v0.13.0 and v0.12.0 changelog entries. ```bash npm i -g fauxnix-cli ``` -------------------------------- ### Run fauxnix CLI via npx with inline command Source: https://github.com/20000419/fauxnix/blob/main/README.md Use npx to run fauxnix-cli without installing. The first command executes a shell command directly; the second uses the 'translate' subcommand to translate a find command. ```bash npx fauxnix-cli@latest "ls -la src | head -3" ``` ```bash npx fauxnix-cli@latest translate "find . -name '*.log' -mtime +7 -delete" ``` -------------------------------- ### Configure fauxnix MCP server in Kimi Code mcp.json Source: https://github.com/20000419/fauxnix/blob/main/README.md Manual configuration for Kimi Code in `~/.kimi-code/mcp.json`. MCP servers live in a JSON file, not the TOML config. ```json { "mcpServers": { "fauxnix": { "command": "C:\\Program Files\\nodejs\\node.exe", "args": ["C:\\Users\\\\AppData\\Roaming\\npm\\node_modules\\fauxnix-cli\\dist\\index.js", "mcp"] } } } ``` -------------------------------- ### Bash facade spike: argv contract over dist/ Source: https://github.com/20000419/fauxnix/blob/main/docs/rfc-bash-facade.md Implements the argv contract (-c, --version, stdin marker session) over dist/ without new execution code. Must import install-all.js for handler registration; otherwise everything degrades to native passthrough. Uses one FauxnixSession per process so cwd/env persist across markers. ```javascript import '../../dist/commands/install-all.js'; // handler registration is mandatory import { parseCommand } from '../../dist/parser.js'; import { translateCommandList, EXECUTE_TRANSLATION } from '../../dist/translator.js'; import { FauxnixSession } from '../../dist/executor.js'; const MARKER_RE = /([\s\S]*?)<\/bash-input>/; async function runOne(session, cmd) { return session.run(translateCommandList(parseCommand(cmd), EXECUTE_TRANSLATION)); } // -c: translate, execute, write stdout/stderr, process.exit(result.exitCode) // stdin: for every block run + emit `N`; // one FauxnixSession per process ⇒ cwd/env persist across markers. ``` -------------------------------- ### Configure fauxnix MCP server in OpenCode opencode.json Source: https://github.com/20000419/fauxnix/blob/main/README.md Manual configuration for OpenCode in `opencode.json`. Uses the absolute Node executable and entry path. ```json { "mcp": { "fauxnix": { "type": "local", "command": ["C:\\Program Files\\nodejs\\node.exe", "C:\\Users\\\\AppData\\Roaming\\npm\\node_modules\\fauxnix-cli\\dist\\index.js", "mcp"] } } } ``` -------------------------------- ### Configure fauxnix MCP server in Codex config.toml Source: https://github.com/20000419/fauxnix/blob/main/README.md Manual configuration for Codex in `~/.codex/config.toml` or via `codex mcp add`. Uses the absolute Node executable and entry path for spawn-safe execution. In non-interactive `codex exec` mode, MCP tool calls are auto-denied; pass `--dangerously-bypass-approvals-and-sandbox` or run interactively. ```toml [mcp_servers.fauxnix] command = 'C:\Program Files\nodejs\node.exe' args = ['C:\Users\\AppData\Roaming\npm\node_modules\fauxnix-cli\dist\index.js', 'mcp'] ``` -------------------------------- ### Create GitHub release from tag Source: https://github.com/20000419/fauxnix/blob/main/CONTRIBUTING.md Create the GitHub release from the already-published tag using CHANGELOG-derived notes. Add --prerelease for release candidates. ```bash gh release create ... --verify-tag --notes-file ... ``` -------------------------------- ### Publish stable release with --tag latest Source: https://github.com/20000419/fauxnix/blob/main/CONTRIBUTING.md Publish a stable release from the same clean checkout, entering the OTP at npm's prompt. ```bash npm publish --tag latest ``` -------------------------------- ### Build and benchmark runtime workloads Source: https://github.com/20000419/fauxnix/blob/main/docs/rfc-runtime-checkpoint-fast-path.md Builds the project and runs the runtime workload benchmark against a baseline checkout. The benchmark alternates order, uses separate sessions and fixtures, excludes boot/setup/translation from execution timing, verifies outputs, and returns raw samples. FAUXNIX_BENCH_ROUNDS defaults to 15; FAUXNIX_BENCH_ENV_COUNT optionally adds synthetic environment entries. ```powershell npm run build ``` ```powershell node scripts/benchmark-runtime-workloads.mjs C:/path/to/baseline . ``` ```powershell $env:FAUXNIX_PS = 'pwsh' node scripts/benchmark-runtime-workloads.mjs C:/path/to/baseline . ``` -------------------------------- ### Set FAUXNIX_DIFF_ORACLE to bash.exe path and run vitest Source: https://github.com/20000419/fauxnix/blob/main/test/differential/README.md Points the environment variable to a specific bash.exe location when Git for Windows is not in a default location, then runs the differential test. ```powershell $env:FAUXNIX_DIFF_ORACLE = 'C:\Program Files\Git\bin\bash.exe' npx vitest run test/differential.test.ts ``` -------------------------------- ### Verify npm authentication and profile Source: https://github.com/20000419/fauxnix/blob/main/CONTRIBUTING.md Confirm the expected maintainer account has auth-and-writes 2FA before publishing. ```bash npm whoami ``` ```bash npm profile get ``` -------------------------------- ### Read back release metadata Source: https://github.com/20000419/fauxnix/blob/main/CONTRIBUTING.md Verify the published package version, gitHead, dist.integrity, and dist-tag before announcing. ```bash npm view fauxnix-cli@X.Y.Z version gitHead dist.integrity ``` ```bash git rev-list -n 1 vX.Y.Z ``` ```bash npm dist-tag ls fauxnix-cli ``` ```bash npx --yes --package=fauxnix-cli@X.Y.Z fauxnix --version ``` -------------------------------- ### Host boot ready message Source: https://github.com/20000419/fauxnix/blob/main/docs/rfc-persistent-powershell-host.md Sent once from the PowerShell host to Node at startup, indicating the host is ready to receive frames. ```json {"ready":true} ``` -------------------------------- ### Set FAUXNIX_DIFF_ORACLE to '1' and run vitest Source: https://github.com/20000419/fauxnix/blob/main/test/differential/README.md Enables the oracle by setting the environment variable to '1' and runs the differential test. If the variable is unset or bash.exe is missing, the runner skips. ```powershell $env:FAUXNIX_DIFF_ORACLE = '1' npx vitest run test/differential.test.ts ``` -------------------------------- ### Create annotated tag and dry-run publish Source: https://github.com/20000419/fauxnix/blob/main/CONTRIBUTING.md Create a local annotated tag and run a dry-run publish. The publish lifecycle repeats strict tag, typecheck, full-suite, and packed-install checks. ```bash git tag -a vX.Y.Z -m "vX.Y.Z" ``` ```bash npm publish --dry-run ``` -------------------------------- ### Publish release candidate with --tag next Source: https://github.com/20000419/fauxnix/blob/main/CONTRIBUTING.md Publish a release candidate from the same clean checkout. Never publish an RC without --tag next; npm otherwise moves latest. ```bash npm publish --tag next ``` -------------------------------- ### Bump version with npm version Source: https://github.com/20000419/fauxnix/blob/main/CONTRIBUTING.md Run this command to update package.json and lockfile version fields. Do not hand-edit src/cli.ts or src/mcp.ts because src/version.ts supplies runtime versions. ```bash npm version X.Y.Z --no-git-tag-version ``` -------------------------------- ### Check target version absence on npm Source: https://github.com/20000419/fauxnix/blob/main/CONTRIBUTING.md Verify the target version is not already published before creating a tag. ```bash npm view fauxnix-cli versions --json ``` -------------------------------- ### fauxnix CLI output for successful and failing commands Source: https://github.com/20000419/fauxnix/blob/main/README.md Shows terminal output when running fauxnix with a successful command and a failing command. The failing command prints a Unix-style error message instead of a PowerShell stack trace. ```text $ fauxnix "ls -la src | head -2" -rw-r--r-- 1 me me 1204 Aug 16 09:12 ast.ts -rw-r--r-- 1 me me 8192 Aug 16 09:12 cli.ts $ fauxnix "cat nope.txt" cat: nope.txt: No such file or directory # not a PowerShell stack trace ``` -------------------------------- ### Manual Codex MCP configuration (config.toml) Source: https://github.com/20000419/fauxnix/blob/main/docs/examples/codex.md Append this table to %USERPROFILE%\.codex\config.toml (or %CODEX_HOME%\config.toml if CODEX_HOME is set). Do not wipe other sections. Harness CLI equivalent: codex mcp add fauxnix -- fauxnix mcp. ```toml [mcp_servers.fauxnix] command = "fauxnix" args = ["mcp"] ``` -------------------------------- ### Manual Claude Code MCP configuration Source: https://github.com/20000419/fauxnix/blob/main/docs/examples/claude.md JSON block to merge into %USERPROFILE%\.claude.json (or %CLAUDE_CONFIG_DIR%\.claude.json if set). Merge mcpServers.fauxnix without wiping other servers. CLI equivalent: claude mcp add fauxnix -- fauxnix mcp. ```json { "mcpServers": { "fauxnix": { "command": "fauxnix", "args": ["mcp"] } } } ``` -------------------------------- ### Run test suite with vitest Source: https://github.com/20000419/fauxnix/blob/main/CONTRIBUTING.md Use `npx vitest run --dir test` to run the test suite locally. The `--dir test` scope is important because vitest's default include pattern picks up stray untracked `*.test.ts` files elsewhere in the working tree, which can inflate or contaminate test counts. ```bash npx vitest run --dir test ``` -------------------------------- ### Manual OpenCode MCP configuration (default shape) Source: https://github.com/20000419/fauxnix/blob/main/docs/examples/opencode.md Default configuration shape using mcp.fauxnix. Merge into the config file at %USERPROFILE%\.config\opencode\opencode.json (or %XDG_CONFIG_HOME%\opencode\opencode.json if XDG_CONFIG_HOME is set) without wiping other keys. ```json { "mcp": { "fauxnix": { "type": "local", "command": ["fauxnix", "mcp"] } } } ``` -------------------------------- ### Rollback dist-tag to last good version Source: https://github.com/20000419/fauxnix/blob/main/CONTRIBUTING.md Move the affected channel back to the last good version after a failed release. ```bash npm dist-tag add fauxnix-cli@LAST_GOOD latest ``` -------------------------------- ### Node-to-host run command Source: https://github.com/20000419/fauxnix/blob/main/SECURITY.md JSON frame sent from the node to the host for each command segment. scriptB64 is decoded to UTF-8 and invoked as a scriptblock. env values are strings; an empty string unsets the variable, preventing a missing '<' redirect from leaking FAUXNIX_STDIN_FILE. ```json {"v":2,"type":"run","id":"…","scriptB64":"…","env":{"FAUXNIX_CWD":"…","FAUXNIX_PREV_EXIT":"0","FAUXNIX_STDIN_FILE":""},"stdoutLimit":8388608,"stderrLimit":1048576} ``` -------------------------------- ### Manual OpenCode MCP configuration (mcp.servers shape) Source: https://github.com/20000419/fauxnix/blob/main/docs/examples/opencode.md Alternative configuration shape when mcp.servers already exists as an object. Place fauxnix under mcp.servers.fauxnix and do not add a sibling mcp.fauxnix. ```json { "mcp": { "servers": { "fauxnix": { "type": "local", "command": ["fauxnix", "mcp"] } } } } ``` -------------------------------- ### Deprecate bad npm version Source: https://github.com/20000419/fauxnix/blob/main/CONTRIBUTING.md Deprecate the bad version with an upgrade reason. ```bash npm deprecate fauxnix-cli@BAD "upgrade to X.Y.Z: REASON" ``` -------------------------------- ### Run local matrix with and without FAUXNIX_PS Source: https://github.com/20000419/fauxnix/blob/main/docs/powershell-7.md Run the local test matrix manually: first remove the FAUXNIX_PS environment variable and run npm test, then set it to 'pwsh' and run npm test again. This verifies both editions in the same session. ```powershell Remove-Item Env:FAUXNIX_PS -ErrorAction SilentlyContinue npm test $env:FAUXNIX_PS = 'pwsh' npm test ``` -------------------------------- ### Push tag and verify peeled commit Source: https://github.com/20000419/fauxnix/blob/main/CONTRIBUTING.md Push only the tag and compare the peeled commit from the remote with the local release commit. An annotated tag's unpeeled ref is the tag object, not the release commit. ```bash git push origin vX.Y.Z ``` ```bash git ls-remote origin "refs/tags/vX.Y.Z^{}" ``` ```bash git rev-list -n 1 vX.Y.Z ``` -------------------------------- ### set -- a 'x y'; echo "$2" Source: https://github.com/20000419/fauxnix/blob/main/docs/rfc-positional-params.md Sets two positional parameters where the second contains a space, then echoes the second parameter. Expected output: `x y`. ```bash set -- a 'x y'; echo "$2" ``` -------------------------------- ### set -- a b; echo "$@" Source: https://github.com/20000419/fauxnix/blob/main/docs/rfc-positional-params.md Sets two positional parameters and echoes all of them as separate words. Expected output: `a b`. ```bash set -- a b; echo "$@" ``` -------------------------------- ### Handshake message (protocol v2) Source: https://github.com/20000419/fauxnix/blob/main/SECURITY.md JSON frame sent by the host to announce readiness. Protocol v2 includes capabilities; v1 with {"ready":true} is still accepted. The cancel capability is false, meaning the host cannot stop an in-flight scriptblock without killing the process. ```json {"v":2,"type":"ready","capabilities":{"cancel":false,"maxChunkBytes":65536,"stderrMarker":true}} ``` -------------------------------- ### set -- a b; echo $1 $# Source: https://github.com/20000419/fauxnix/blob/main/docs/rfc-positional-params.md Sets two positional parameters and echoes the first and count. Expected output: `a 2`. ```bash set -- a b; echo $1 $# ``` -------------------------------- ### GNU oracle: extension beyond NF with custom OFS Source: https://github.com/20000419/fauxnix/blob/main/docs/rfc-awk-field-assignment.md Validates extension beyond NF and custom OFS. Sets OFS to ':' in a BEGIN block, assigns $4, then prints NF and the rebuilt record. ```sh printf 'a b\n' | awk 'BEGIN {OFS=":"} {$4="x"; print NF, $0}' ``` -------------------------------- ### Add a case to corpus.json Source: https://github.com/20000419/fauxnix/blob/main/test/differential/README.md Append an object to the 'cases' array in corpus.json. The 'id' must be unique, and 'source' should cite the audit/PR/RFC. The command must be self-contained. ```json { "id": "grep-e-or", "cmd": "grep -e a -e c letters.txt", "source": "#152" } ``` -------------------------------- ### Node to host per-segment frame Source: https://github.com/20000419/fauxnix/blob/main/docs/rfc-persistent-powershell-host.md Sent from Node to the host for each translated segment. Contains a unique ID, the base64-encoded UTF-8 script, and environment variables as strings. An empty string unsets a variable. ```json {"id":"","scriptB64":"","env":{"FAUXNIX_CWD":"...","FAUXNIX_PREV_EXIT":"0","FAUXNIX_STDIN_FILE":""}} ``` -------------------------------- ### Host to Node frame response Source: https://github.com/20000419/fauxnix/blob/main/docs/rfc-persistent-powershell-host.md Sent from the host to Node after executing a frame, containing the base64-encoded stdout and stderr bytes and the exit code. ```json {"id":"","stdoutB64":"","stderrB64":"","exitCode":0} ``` -------------------------------- ### GNU oracle: whitespace normalization with awk '{$1=$1; print}' Source: https://github.com/20000419/fauxnix/blob/main/docs/rfc-awk-field-assignment.md Validates the new field-rebuild operation by normalizing whitespace in a two-column record. The output is the rebuilt record with fields separated by the default OFS (a space). ```sh printf ' 1 LA\n 2 NYC\n' | awk '{$1=$1; print}' ``` -------------------------------- ### GNU oracle: field reordering with awk '{$1=$1; print $2, $1}' Source: https://github.com/20000419/fauxnix/blob/main/docs/rfc-awk-field-assignment.md Validates subsequent field reordering after the field-rebuild operation. The output prints the second field followed by the first, separated by the default OFS. ```sh printf ' 1 LA\n 2 NYC\n' | awk '{$1=$1; print $2, $1}' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.