fauxnix-cli 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -26,7 +26,7 @@ export async function runCli(argv) {
26
26
  }
27
27
  const [verb, ...rest] = argv;
28
28
  if (verb === '--version' || verb === '-v') {
29
- console.log('fauxnix 0.2.0');
29
+ console.log('fauxnix 0.2.1');
30
30
  return;
31
31
  }
32
32
  if (verb === 'list') {
package/dist/executor.js CHANGED
@@ -234,8 +234,11 @@ async function runPlans(plans, session, opts, afterSegment, scriptFile) {
234
234
  clearTimeout(timer);
235
235
  afterSegment();
236
236
  const decodePref = resolveNativePref();
237
- let segOut = decodeOutput(Buffer.concat(outBufs), decodePref);
238
- let segErr = normalizeStderr(decodeOutput(Buffer.concat(errBufs), decodePref));
237
+ // GNU line discipline: PowerShell's console layer terminates every line
238
+ // with CRLF; bash tools expect LF (redirect-written files and byte counts
239
+ // must match coreutils, e.g. `head -2 f > out.txt; wc -c out.txt`)
240
+ let segOut = decodeOutput(Buffer.concat(outBufs), decodePref).replace(/\r\n/g, '\n');
241
+ let segErr = normalizeStderr(decodeOutput(Buffer.concat(errBufs), decodePref)).replace(/\r\n/g, '\n');
239
242
  if (running.killed) {
240
243
  segErr += '\nbash: command timed out after ' + Math.round(timeoutMs / 1000) + 's';
241
244
  }
package/dist/mcp.js CHANGED
@@ -7,19 +7,19 @@ import { translateCommandList, wrapScript, translatePipelineBody } from './trans
7
7
  import { registeredNames } from './registry.js';
8
8
  import './commands/install-all.js';
9
9
  const TOOL_NAME = process.env.FAUXNIX_TOOL_NAME || 'bash';
10
- const TOOL_DESCRIPTION = `Execute a Linux/bash-style command on this Windows machine.
11
-
12
- Commands are deterministically translated to PowerShell and executed natively — no WSL or VM.
13
- Output is formatted to look like GNU/Linux tooling (ls -l, ps aux, df -h ...), errors look like bash errors, and text encoding (UTF-8/GBK) is handled automatically.
14
-
15
- Supported: pipes (|), && / || / ;, redirections (> >> 2> 2>&1 < /dev/null), variables ($VAR $HOME ~), command substitution $(...), and ${registeredNames().length}+ coreutils-style commands (${registeredNames().slice(0, 18).join(', ')}...).
16
- Unknown commands (git, node, npm, python, cargo...) are passed through and executed natively with argv-style quoting.
17
- Not supported: heredocs, backticks, control flow (if/for/while), background jobs.
18
-
19
- CWD, environment variables, export/unset and cd persist across calls within this session.
10
+ const TOOL_DESCRIPTION = `Execute a Linux/bash-style command on this Windows machine.
11
+
12
+ Commands are deterministically translated to PowerShell and executed natively — no WSL or VM.
13
+ Output is formatted to look like GNU/Linux tooling (ls -l, ps aux, df -h ...), errors look like bash errors, and text encoding (UTF-8/GBK) is handled automatically.
14
+
15
+ Supported: pipes (|), && / || / ;, redirections (> >> 2> 2>&1 < /dev/null), variables ($VAR $HOME ~), command substitution $(...), and ${registeredNames().length}+ coreutils-style commands (${registeredNames().slice(0, 18).join(', ')}...).
16
+ Unknown commands (git, node, npm, python, cargo...) are passed through and executed natively with argv-style quoting.
17
+ Not supported: heredocs, backticks, control flow (if/for/while), background jobs.
18
+
19
+ CWD, environment variables, export/unset and cd persist across calls within this session — but prefer COMBINING related commands in one call with ; or && (e.g. 'cd src && ls | wc -l'); each call is a fresh translation+process, so batching is faster than many tiny calls.
20
20
  Exit codes follow bash conventions (0 ok, 1 fail, 2 usage/serious, 127 command not found, 124 timeout).`;
21
21
  export async function startMcpServer() {
22
- const server = new McpServer({ name: 'fauxnix', version: '0.2.0' }, { capabilities: { tools: {} } });
22
+ const server = new McpServer({ name: 'fauxnix', version: '0.2.1' }, { capabilities: { tools: {} } });
23
23
  const session = new FauxnixSession();
24
24
  server.tool(TOOL_NAME, TOOL_DESCRIPTION, {
25
25
  command: z.string().describe('The bash-style command line to run'),
package/package.json CHANGED
@@ -1,58 +1,58 @@
1
- {
2
- "name": "fauxnix-cli",
3
- "version": "0.2.0",
4
- "description": "Fauxnix — run Linux-style commands on Windows via deterministic PowerShell translation. No VM, no WSL. MCP server + CLI for AI agents.",
5
- "type": "module",
6
- "bin": {
7
- "fauxnix": "dist/index.js"
8
- },
9
- "files": [
10
- "dist",
11
- "README.md",
12
- "LICENSE"
13
- ],
14
- "scripts": {
15
- "build": "tsc",
16
- "test": "vitest run",
17
- "test:watch": "vitest",
18
- "typecheck": "tsc --noEmit",
19
- "dev": "tsx src/index.ts"
20
- },
21
- "keywords": [
22
- "bash",
23
- "powershell",
24
- "translate",
25
- "translator",
26
- "linux",
27
- "windows",
28
- "mcp",
29
- "mcp-server",
30
- "ai-agent",
31
- "claude-code",
32
- "codex",
33
- "opencode",
34
- "kimi-code",
35
- "shell",
36
- "gbk",
37
- "utf8"
38
- ],
39
- "engines": {
40
- "node": ">=18"
41
- },
42
- "license": "MIT",
43
- "repository": {
44
- "type": "git",
45
- "url": "git+https://github.com/20000419/fauxnix.git"
46
- },
47
- "dependencies": {
48
- "@modelcontextprotocol/sdk": "^1.12.0",
49
- "iconv-lite": "^0.6.3",
50
- "zod": "^3.24.0"
51
- },
52
- "devDependencies": {
53
- "@types/node": "^20.14.0",
54
- "tsx": "^4.19.0",
55
- "typescript": "^5.5.0",
56
- "vitest": "^2.1.0"
57
- }
58
- }
1
+ {
2
+ "name": "fauxnix-cli",
3
+ "version": "0.2.1",
4
+ "description": "Fauxnix — run Linux-style commands on Windows via deterministic PowerShell translation. No VM, no WSL. MCP server + CLI for AI agents.",
5
+ "type": "module",
6
+ "bin": {
7
+ "fauxnix": "dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "README.md",
12
+ "LICENSE"
13
+ ],
14
+ "scripts": {
15
+ "build": "tsc",
16
+ "test": "vitest run",
17
+ "test:watch": "vitest",
18
+ "typecheck": "tsc --noEmit",
19
+ "dev": "tsx src/index.ts"
20
+ },
21
+ "keywords": [
22
+ "bash",
23
+ "powershell",
24
+ "translate",
25
+ "translator",
26
+ "linux",
27
+ "windows",
28
+ "mcp",
29
+ "mcp-server",
30
+ "ai-agent",
31
+ "claude-code",
32
+ "codex",
33
+ "opencode",
34
+ "kimi-code",
35
+ "shell",
36
+ "gbk",
37
+ "utf8"
38
+ ],
39
+ "engines": {
40
+ "node": ">=18"
41
+ },
42
+ "license": "MIT",
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "git+https://github.com/20000419/fauxnix.git"
46
+ },
47
+ "dependencies": {
48
+ "@modelcontextprotocol/sdk": "^1.12.0",
49
+ "iconv-lite": "^0.6.3",
50
+ "zod": "^3.24.0"
51
+ },
52
+ "devDependencies": {
53
+ "@types/node": "^20.14.0",
54
+ "tsx": "^4.19.0",
55
+ "typescript": "^5.5.0",
56
+ "vitest": "^2.1.0"
57
+ }
58
+ }