@hanamorilabs/tab 0.1.2 → 0.1.3

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 CHANGED
@@ -59,8 +59,8 @@ Codex shows `FlockTab - Self-hosted` as its provider.
59
59
  tab login approve this machine in the console, once
60
60
  tab <agent> [args] claude, codex, grok, kimi, gemini, or any command, on the tab
61
61
  tab use pick or change the Agent this folder runs as (.flocktab)
62
- tab alias <name>... make plain `codex` run `tab codex` (shims in ~/.flocktab/bin)
63
- tab unalias <name> remove such a shim
62
+ tab alias setup <name>... make plain `codex` run `tab codex` (shims in ~/.flocktab/bin)
63
+ tab alias remove <name>... undo that; `tab alias list` shows them
64
64
  tab status flock, folder Agent, proxy health, provider key state
65
65
  tab version tab and proxy versions
66
66
  tab up | down self-hosted: start or stop the local proxy
@@ -72,16 +72,18 @@ tab help this list
72
72
  ## Aliases: plain `codex` on the tab
73
73
 
74
74
  ```
75
- tab alias codex claude
75
+ tab alias setup codex claude
76
76
  export PATH="$HOME/.flocktab/bin:$PATH" # once, in your shell rc
77
77
  codex # now runs: tab codex
78
+ tab alias remove codex # back to the plain codex
78
79
  ```
79
80
 
80
- `tab alias` writes a shim named after the command into `~/.flocktab/bin`
81
- (`codex.cmd` on Windows). With that folder first on `PATH`, the plain
82
- command runs on the tab. When `tab` spawns the real agent it removes its
83
- own shim folder from the child's `PATH`, so nothing loops. `tab alias` with
84
- no name lists them; `tab unalias codex` removes one. Prefer a shell alias?
81
+ `tab alias setup` writes a shim named after the command into
82
+ `~/.flocktab/bin` (`codex.cmd` on Windows). With that folder first on
83
+ `PATH`, the plain command runs on the tab. When `tab` spawns the real agent
84
+ it removes its own shim folder from the child's `PATH`, so nothing loops.
85
+ `tab alias list` shows them; `tab alias remove <name>` deletes the shim, and
86
+ the plain command is the real one again. Prefer a shell alias?
85
87
  `alias codex='tab codex'` in your rc does the same for that shell only.
86
88
 
87
89
  ## Secrets and colour
package/dist/cli.js CHANGED
@@ -7,7 +7,8 @@
7
7
  * tab codex [...args] Codex on the tab
8
8
  * tab <cmd> [...args] anything else, both APIs pointed at the tab
9
9
  * tab use pick (or change) the Agent this folder runs as
10
- * tab alias codex ... make plain `codex` run `tab codex` (shims in ~/.flocktab/bin)
10
+ * tab alias setup codex make plain `codex` run `tab codex` (shims in ~/.flocktab/bin)
11
+ * tab alias remove codex undo that; `tab alias list` shows them
11
12
  * tab status which flock, which Agent here, is the proxy up
12
13
  * tab version tab and proxy versions
13
14
  * tab up | down | update self-hosted: start, stop, or fetch the newest proxy
@@ -50,8 +51,8 @@ function usage() {
50
51
  cmd(others.join(" | tab "), "the same, for those agents"),
51
52
  cmd("<command> [args]", "any other agent, both APIs pointed at the tab"),
52
53
  cmd("use", "pick or change the Agent this folder runs as (.flocktab)"),
53
- cmd("alias <name>...", "make plain `codex` run `tab codex` (shims in ~/.flocktab/bin)"),
54
- cmd("unalias <name>", "remove such a shim"),
54
+ cmd("alias setup <name>...", "make plain `codex` run `tab codex` (shims in ~/.flocktab/bin)"),
55
+ cmd("alias remove <name>...", "undo that; `tab alias list` shows them"),
55
56
  cmd("status", "which flock, which Agent here, is the proxy up"),
56
57
  cmd("version", "tab and proxy versions"),
57
58
  cmd("up", "self-hosted: start the local proxy (fetches it the first time)"),
@@ -521,7 +522,20 @@ async function runAgent(name, args) {
521
522
  * `tab alias codex claude`: shims so the plain commands run on the tab.
522
523
  * `tab alias` alone lists them; `tab unalias codex` removes one.
523
524
  */
524
- async function alias(names, remove = false) {
525
+ async function alias(args, removeFlag = false) {
526
+ // `tab alias setup codex`, `tab alias remove codex`, `tab alias list`;
527
+ // the bare `tab alias codex` and `tab unalias codex` mean the same.
528
+ const [first, ...rest] = args;
529
+ let names = args;
530
+ let remove = removeFlag;
531
+ if (first === "setup" || first === "add")
532
+ names = rest;
533
+ else if (first === "remove" || first === "rm") {
534
+ names = rest;
535
+ remove = true;
536
+ }
537
+ else if (first === "list" || first === "ls")
538
+ names = [];
525
539
  if (names.length === 0 && !remove) {
526
540
  const existing = await listAliases();
527
541
  if (existing.length === 0)
@@ -531,7 +545,7 @@ async function alias(names, remove = false) {
531
545
  return pathHint();
532
546
  }
533
547
  if (names.length === 0) {
534
- fail("tab unalias needs a name.");
548
+ fail("tab alias remove needs a name, e.g. tab alias remove codex");
535
549
  return 2;
536
550
  }
537
551
  for (const name of names) {
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /** Written by scripts/write-version.mjs from package.json at build; `tab version` prints it. */
2
- export const TAB_VERSION = "0.1.2";
2
+ export const TAB_VERSION = "0.1.3";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanamorilabs/tab",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Run any AI agent on a FlockTab tab: tab claude, tab codex, tab <command>.",
5
5
  "license": "MIT",
6
6
  "type": "module",