@hasna/terminal 0.6.1 → 0.6.2

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.
Files changed (3) hide show
  1. package/dist/cli.js +49 -0
  2. package/package.json +1 -1
  3. package/src/cli.tsx +52 -0
package/dist/cli.js CHANGED
@@ -2,6 +2,55 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { render } from "ink";
4
4
  const args = process.argv.slice(2);
5
+ // ── Help / Version ───────────────────────────────────────────────────────────
6
+ if (args[0] === "--help" || args[0] === "-h" || args[0] === "help") {
7
+ console.log(`open-terminal v0.6.1 — Smart terminal for AI agents and humans
8
+
9
+ USAGE:
10
+ terminal Launch interactive NL terminal (TUI)
11
+ terminal <subcommand> Run a specific command
12
+
13
+ SUBCOMMANDS:
14
+ mcp serve Start MCP server (stdio transport)
15
+ mcp install --claude|--codex|--gemini|--all
16
+ Install as MCP server for AI agents
17
+ hook install --claude Install Claude Code PostToolUse hook
18
+ hook uninstall Remove hooks
19
+ recipe add <name> <cmd> Save a reusable command recipe
20
+ recipe list List saved recipes
21
+ recipe run <name> [--var=X] Run a recipe with variable substitution
22
+ recipe delete <name> Delete a recipe
23
+ collection create <name> Create a recipe collection
24
+ collection list List collections
25
+ project init Initialize project-scoped recipes
26
+ repo Show git repo state (branch + status + log)
27
+ symbols <file> Show file outline (functions, classes, exports)
28
+ stats Show token economy dashboard
29
+ sessions List recent terminal sessions
30
+ sessions stats Show session analytics
31
+ sessions <id> Show session details
32
+ snapshot Capture terminal state as JSON
33
+ --help Show this help
34
+ --version Show version
35
+
36
+ MCP TOOLS (20+):
37
+ execute, execute_smart, execute_diff, expand, browse,
38
+ search_files, search_content, search_semantic, read_file,
39
+ read_symbol, symbols, repo_state, explain_error, status,
40
+ bg_start, bg_stop, bg_status, bg_logs, bg_wait_port,
41
+ list_recipes, run_recipe, save_recipe, list_collections,
42
+ snapshot, token_stats, session_history
43
+
44
+ ENVIRONMENT:
45
+ CEREBRAS_API_KEY Cerebras API key (free, open-source default)
46
+ ANTHROPIC_API_KEY Anthropic API key (Claude models)
47
+ `);
48
+ process.exit(0);
49
+ }
50
+ if (args[0] === "--version" || args[0] === "-v") {
51
+ console.log("0.6.1");
52
+ process.exit(0);
53
+ }
5
54
  // ── MCP commands ─────────────────────────────────────────────────────────────
6
55
  if (args[0] === "mcp") {
7
56
  if (args[1] === "serve" || args.length === 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/terminal",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Smart terminal wrapper for AI agents and humans — structured output, token compression, MCP server, natural language",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.tsx CHANGED
@@ -4,6 +4,58 @@ import { render } from "ink";
4
4
 
5
5
  const args = process.argv.slice(2);
6
6
 
7
+ // ── Help / Version ───────────────────────────────────────────────────────────
8
+
9
+ if (args[0] === "--help" || args[0] === "-h" || args[0] === "help") {
10
+ console.log(`open-terminal v0.6.1 — Smart terminal for AI agents and humans
11
+
12
+ USAGE:
13
+ terminal Launch interactive NL terminal (TUI)
14
+ terminal <subcommand> Run a specific command
15
+
16
+ SUBCOMMANDS:
17
+ mcp serve Start MCP server (stdio transport)
18
+ mcp install --claude|--codex|--gemini|--all
19
+ Install as MCP server for AI agents
20
+ hook install --claude Install Claude Code PostToolUse hook
21
+ hook uninstall Remove hooks
22
+ recipe add <name> <cmd> Save a reusable command recipe
23
+ recipe list List saved recipes
24
+ recipe run <name> [--var=X] Run a recipe with variable substitution
25
+ recipe delete <name> Delete a recipe
26
+ collection create <name> Create a recipe collection
27
+ collection list List collections
28
+ project init Initialize project-scoped recipes
29
+ repo Show git repo state (branch + status + log)
30
+ symbols <file> Show file outline (functions, classes, exports)
31
+ stats Show token economy dashboard
32
+ sessions List recent terminal sessions
33
+ sessions stats Show session analytics
34
+ sessions <id> Show session details
35
+ snapshot Capture terminal state as JSON
36
+ --help Show this help
37
+ --version Show version
38
+
39
+ MCP TOOLS (20+):
40
+ execute, execute_smart, execute_diff, expand, browse,
41
+ search_files, search_content, search_semantic, read_file,
42
+ read_symbol, symbols, repo_state, explain_error, status,
43
+ bg_start, bg_stop, bg_status, bg_logs, bg_wait_port,
44
+ list_recipes, run_recipe, save_recipe, list_collections,
45
+ snapshot, token_stats, session_history
46
+
47
+ ENVIRONMENT:
48
+ CEREBRAS_API_KEY Cerebras API key (free, open-source default)
49
+ ANTHROPIC_API_KEY Anthropic API key (Claude models)
50
+ `);
51
+ process.exit(0);
52
+ }
53
+
54
+ if (args[0] === "--version" || args[0] === "-v") {
55
+ console.log("0.6.1");
56
+ process.exit(0);
57
+ }
58
+
7
59
  // ── MCP commands ─────────────────────────────────────────────────────────────
8
60
 
9
61
  if (args[0] === "mcp") {