fauxnix-cli 0.7.1 → 0.9.0
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/README.md +6 -0
- package/dist/cli.js +11 -1
- package/dist/commands/files.d.ts +4 -1
- package/dist/commands/files.js +356 -89
- package/dist/commands/install-all.js +7 -4
- package/dist/commands/sysinfo.js +3 -2
- package/dist/commands/text-filters.d.ts +2 -1
- package/dist/commands/text-filters.js +67 -7
- package/dist/commands/text-io.d.ts +2 -1
- package/dist/commands/text-io.js +95 -4
- package/dist/executor.d.ts +13 -1
- package/dist/executor.js +83 -13
- package/dist/mcp.d.ts +19 -0
- package/dist/mcp.js +79 -18
- package/dist/parser.js +55 -24
- package/dist/ps-host.d.ts +46 -2
- package/dist/ps-host.js +181 -17
- package/dist/registry.d.ts +54 -0
- package/dist/registry.js +182 -0
- package/dist/translator.js +65 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -153,6 +153,11 @@ development:
|
|
|
153
153
|
- **text filters**: `grep egrep sed awk sort uniq cut tr` — sed/awk scripts are parsed at
|
|
154
154
|
translate time (unsupported constructs throw named errors, never silently misbehave)
|
|
155
155
|
- **text I/O**: `echo printf cat head tail wc tee nl tac md5sum sha1sum sha256sum base64 seq yes xargs`
|
|
156
|
+
|
|
157
|
+
`cp` / `mv` / `rm` / `touch` / `tee` / `grep` / `head` / `du` carry a `CommandSpec`: unknown
|
|
158
|
+
options fail with a GNU-style usage error instead of being ignored. Implemented GNU holes:
|
|
159
|
+
`cp -n` / `mv -n` / `touch -c` / `tee --append` / `grep -m` / `head --lines` / `du --max-depth`.
|
|
160
|
+
`fauxnix list --json` and `docs/command-specs.md` dump the same metadata.
|
|
156
161
|
- **shell/system**: `cd pwd export unset env printenv ps kill pkill pgrep sleep which type whoami
|
|
157
162
|
id groups date uname hostname uptime free nproc clear true false test [ [[ : pushd popd dirs sudo
|
|
158
163
|
timeout man history less more source . eval exit alias set`
|
|
@@ -196,6 +201,7 @@ fauxnix optimizes for the commands agents actually run. Documented deviations:
|
|
|
196
201
|
- `yes` is capped at 65,536 lines — PS 5.1 pipelines cannot signal upstream producers to stop, so
|
|
197
202
|
an unbounded `yes | head` would hang.
|
|
198
203
|
- `tail -f`, `eval`, `alias`, heredocs, `while`/`until`/`case`,
|
|
204
|
+
`env -i`/`--ignore-environment`,
|
|
199
205
|
and background `&` are rejected with actionable error messages instead of misbehaving.
|
|
200
206
|
(`if/then/elif/else/fi`, `for x in ...`, backtick substitution, `command -v`, pipeline `read`,
|
|
201
207
|
dotenv-style `source`, and word-level `$((...))` arithmetic expansion are supported.)
|
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@ import { spawn } from 'node:child_process';
|
|
|
2
2
|
import { FauxnixSession } from './executor.js';
|
|
3
3
|
import { parseCommand } from './parser.js';
|
|
4
4
|
import { translateCommandList } from './translator.js';
|
|
5
|
-
import { registeredNames } from './registry.js';
|
|
5
|
+
import { listCommandsJson, registeredNames, specsMarkdown } from './registry.js';
|
|
6
6
|
import { encodeCommand } from './encoding.js';
|
|
7
7
|
import { startMcpServer } from './mcp.js';
|
|
8
8
|
import { packageVersion } from './version.js';
|
|
@@ -15,6 +15,8 @@ Usage:
|
|
|
15
15
|
fauxnix translate "cmd" show the PowerShell translation only
|
|
16
16
|
fauxnix mcp start the MCP stdio server (for agent harnesses)
|
|
17
17
|
fauxnix list list translated commands
|
|
18
|
+
fauxnix list --json same list as machine-readable capability metadata
|
|
19
|
+
fauxnix list --markdown CommandSpec tables (same text as docs/command-specs.md)
|
|
18
20
|
fauxnix check verify the local PowerShell environment
|
|
19
21
|
fauxnix --version
|
|
20
22
|
|
|
@@ -31,6 +33,14 @@ export async function runCli(argv) {
|
|
|
31
33
|
return;
|
|
32
34
|
}
|
|
33
35
|
if (verb === 'list') {
|
|
36
|
+
if (rest[0] === '--json') {
|
|
37
|
+
console.log(JSON.stringify(listCommandsJson(), null, 2));
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (rest[0] === '--markdown') {
|
|
41
|
+
console.log(specsMarkdown());
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
34
44
|
const names = registeredNames();
|
|
35
45
|
console.log(names.length + ' translated commands:');
|
|
36
46
|
for (const n of names)
|
package/dist/commands/files.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import { Handler } from '../registry.js';
|
|
1
|
+
import { CommandSpec, Handler } from '../registry.js';
|
|
2
|
+
/** Destructive file commands migrated first (#130). Unspec'd handlers stay unchecked.
|
|
3
|
+
* cp/mv `-f`/`--force` is always-on overwrite (Copy-Item/Move-Item -Force); listed so `cp -rf` stays valid. */
|
|
4
|
+
export declare const specs: CommandSpec[];
|
|
2
5
|
export declare const handlers: Record<string, Handler>;
|